Search code examples
reporting-servicesreportingreportbuilder3.0report-designer

What is the purpose of uploading any file to the SSRS Report Server?


I am new to this Microsoft SSRS Reports Server. I am trying to create reports with images and links to external reports/websites. I just saw this option to upload any file to the reports server.

enter image description here

But I do not know how to use these uploaded files in the Report builder/designer. I am able to select the uploaded images.

Is there an option to use the files uploaded in the Reports Server in the Report Builder ? If so, please tell me how and if not then what is the purpose of having these files uploaded in the server ?

Thanks,

R. Venkatesan


Solution

  • Is there an option to use the files uploaded in the Reports Server in the Report Builder ?

    You are lucky to ask such a question before having designed a lot of reports.

    Let me take a simple common example:

    Imagine you have a Company logo you want to include in the header of the reports.
    You design 100 reports with this logo embedded in the report.
    Your company then decides to change their logo, you will have to update all the reports to include the new logo...

    That's when adding images resources to the server becomes interesting.

    If so, please tell me how and if not then what is the purpose of having these files uploaded in the server ?

    Here is how to handle this simple Logo example:

    Add an image resource to the report server, say CompanyLogo.png, in the report folder Logos.

    The image is now accessible when you go to the following URL:

    http://<YourReportServer>/ReportServer[_<InstanceName>]?%2fLogos%2fCompanyLogo.png
    

    Now in your report, go in Image Properties => General

    • Set the image source DropDown to External
    • In Use this image, add the link to the image

    Now the report will display the image from the report server.
    If you update the image, the report will use the new image.

    You can improve this by:

    • Using Globals!ReportServerUrl instead of a hardcoded value (in case the report server URL changes)
    • Using the expression =IIf(Globals!ReportServerUrl = nothing, <ReportServerURL>, <Globals!ReportServerUrl>) + <ImagePath>, when you notice it doesn't work in BIDS and want the image to display in preview mode also
    • Having an Execution account configured in the Configuration Manager to prevent adding rights to the Logos folder to everybody who needs to display the logo
    • Having the image path coming from the database instead of a hardcoded value (if you want the same report that can render with different logos, or just an easier way to specify a different image)

    EDIT

    But the Reports Server allows us to upload other file format too. May I know what is the purpose of this option ?

    An example that comes to my mind is that in a report you can add links to other resources, such as a PDF for example.
    In this case, the PDF will not be rendered by Reporting Services but the browser.

    So the question could be, why restricting the MIME types that can be uploaded on the Report Server, if the browser could possibly render it?

    Additional info from MSDN:

    All other files, including shared data source (.rds) files, are uploaded as resources. Resources are not processed by a report server, but can be viewed in Report Manager if the report server supports the MIME type of the file.

    Source: Upload a File or Report (Report Manager)

    All resources originate as files on a file system, which are subsequently uploaded to a report server. Except for the 4 megabyte default file size limitations imposed by ASP.NET, there are no restrictions on the kinds of files you can upload. However, when published to a report server as a resource, file types that have equivalent MIME types are more optimal than others. For example, resources that are based on HTML and JPG files will open in a browser window when the user clicks the resource, rendering the HTML as a Web page and the JPG as an image that the user can see. In contrast, resources that do not have equivalent MIME types, such as desktop application files, for example, may not be rendered in the browser window.

    Whether a resource can be viewed by report users depends on the viewing capabilities of the browser. Because resources are not processed by the report server, the browser must provide the viewing capability to render a specific MIME type. If the browser cannot render the content, users who view the resource see only the general properties of the resource.

    Source: Reporting Services Report Server (Native Mode)