将任何文件上传到 SSRS 报表服务器的目的是什么?
What is the purpose of uploading any file to the SSRS Report Server?
我是这个 Microsoft SSRS 报表服务器的新手。我正在尝试创建包含图像和外部链接的报告 reports/websites。我刚刚看到这个选项可以将任何文件上传到报告服务器。
但是我不知道如何在报告中使用这些上传的文件builder/designer。我可以 select 上传的图片。
是否可以选择在 Report Builder 中使用上传到 Reports Server 的文件?如果是,请告诉我如何,如果不是,那么将这些文件上传到服务器的目的是什么?
谢谢,
R。文卡特桑
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.
我是这个 Microsoft SSRS 报表服务器的新手。我正在尝试创建包含图像和外部链接的报告 reports/websites。我刚刚看到这个选项可以将任何文件上传到报告服务器。
但是我不知道如何在报告中使用这些上传的文件builder/designer。我可以 select 上传的图片。
是否可以选择在 Report Builder 中使用上传到 Reports Server 的文件?如果是,请告诉我如何,如果不是,那么将这些文件上传到服务器的目的是什么?
谢谢,
R。文卡特桑
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.