是否可以在SQL Server Reporting Services 2005中应用样式表和样式表类

时间:2021-02-11 08:22:46

I've got a batch of reports to which certain changes need to be applied in how the reports are presented. I know how to modify the Reporting Services stylesheet but is it also possible to apply custom CSS classes to items as they are rendered to the browser?

我有一批报告需要对报告的呈现方式进行某些更改。我知道如何修改Reporting Services样式表,但是也可以在项目呈现给浏览器时将自定义CSS类应用于项目?

Does Reporting Services support any type of Visual Inheritance that I could use to accomplish similar functionality in a different way?

Reporting Services是否支持可用于以不同方式完成类似功能的任何类型的Visual Inheritance?

4 个解决方案

#1


There are some articles on SqlCentral.com which are showing how to apply Style in a different (and centralized) way:

SqlCentral.com上有一些文章展示了如何以不同的(集中的)方式应用Style:

http://www.sqlservercentral.com/articles/Reporting+Services/65853/ http://www.sqlservercentral.com/articles/Reporting+Services/65811/

Visual Inheritance is not supported.

不支持可视继承。

#2


Taken From ASP.NET Forums

摘自ASP.NET论坛

Microsoft provides a style sheet named ReportingServices.css that is used by SQL Server Reporting Services. For my local workstation installation this style sheet is found in the c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager\Styles folder. The classes that are referenced by different html elements are predefined in this style sheet. You style your reports by editing this style sheet.

Microsoft提供了一个名为ReportingServices.css的样式表,由SQL Server Reporting Services使用。对于本地工作站安装,此样式表位于c:\ Program Files \ Microsoft SQL Server \ MSSQL.2 \ Reporting Services \ ReportManager \ Styles文件夹中。在此样式表中预定义了由不同html元素引用的类。您可以通过编辑此样式表来设置报告的样式。

There is no link to this style sheet in a report's html. There is, however, an inline style section in the html rendered for each report. I believe that Microsoft creates the inline style section based on the contents of ReportingServices.css. Doing it this way (rather than allowing you to link in your own style sheet) allows the report rendering engine to have the knowledge it needs to control page breaks, column wrapping, and other formatting issues.

报告的html中没有此样式表的链接。但是,为每个报告呈现的html中都有一个内联样式部分。我相信Microsoft会根据ReportingServices.css的内容创建内联样式部分。这样做(而不是允许您在自己的样式表中链接)允许报表呈现引擎具有控制分页符,列包装和其他格式问题所需的知识。

#3


See http://www.simple-talk.com/sql/reporting-services/reporting-services-with-style/ for what I think is a better way of doing this, and easy to implement, you can even put the datasource for your style into a template, so the dev building reports just uses the template, and it's already there.

请参阅http://www.simple-talk.com/sql/reporting-services/reporting-services-with-style/,我认为这是一种更好的方法,并且易于实现,您甚至可以放置数据源为了将你的风格变成模板,所以开发构建报告只使用模板,它已经存在。

#4


From "Customizing Style Sheets for HTML Viewer and Report Manager" (http://technet.microsoft.com/en-us/library/ms345247%28SQL.90%29.aspx)

从“自定义HTML查看器和报表管理器的样式表”(http://technet.microsoft.com/en-us/library/ms345247%28SQL.90%29.aspx)

You can use the rc:StyleSheet URL access parameter to specify a custom style sheet on the report URL.

您可以使用rc:StyleSheet URL访问参数在报告URL上指定自定义样式表。

http://localhost/reportserver?/AdventureWorksSampleReports/Product+Line+Sales&rs:Command=Render&rc:Stylesheet=MyStyleSheet

#1


There are some articles on SqlCentral.com which are showing how to apply Style in a different (and centralized) way:

SqlCentral.com上有一些文章展示了如何以不同的(集中的)方式应用Style:

http://www.sqlservercentral.com/articles/Reporting+Services/65853/ http://www.sqlservercentral.com/articles/Reporting+Services/65811/

Visual Inheritance is not supported.

不支持可视继承。

#2


Taken From ASP.NET Forums

摘自ASP.NET论坛

Microsoft provides a style sheet named ReportingServices.css that is used by SQL Server Reporting Services. For my local workstation installation this style sheet is found in the c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager\Styles folder. The classes that are referenced by different html elements are predefined in this style sheet. You style your reports by editing this style sheet.

Microsoft提供了一个名为ReportingServices.css的样式表,由SQL Server Reporting Services使用。对于本地工作站安装,此样式表位于c:\ Program Files \ Microsoft SQL Server \ MSSQL.2 \ Reporting Services \ ReportManager \ Styles文件夹中。在此样式表中预定义了由不同html元素引用的类。您可以通过编辑此样式表来设置报告的样式。

There is no link to this style sheet in a report's html. There is, however, an inline style section in the html rendered for each report. I believe that Microsoft creates the inline style section based on the contents of ReportingServices.css. Doing it this way (rather than allowing you to link in your own style sheet) allows the report rendering engine to have the knowledge it needs to control page breaks, column wrapping, and other formatting issues.

报告的html中没有此样式表的链接。但是,为每个报告呈现的html中都有一个内联样式部分。我相信Microsoft会根据ReportingServices.css的内容创建内联样式部分。这样做(而不是允许您在自己的样式表中链接)允许报表呈现引擎具有控制分页符,列包装和其他格式问题所需的知识。

#3


See http://www.simple-talk.com/sql/reporting-services/reporting-services-with-style/ for what I think is a better way of doing this, and easy to implement, you can even put the datasource for your style into a template, so the dev building reports just uses the template, and it's already there.

请参阅http://www.simple-talk.com/sql/reporting-services/reporting-services-with-style/,我认为这是一种更好的方法,并且易于实现,您甚至可以放置数据源为了将你的风格变成模板,所以开发构建报告只使用模板,它已经存在。

#4


From "Customizing Style Sheets for HTML Viewer and Report Manager" (http://technet.microsoft.com/en-us/library/ms345247%28SQL.90%29.aspx)

从“自定义HTML查看器和报表管理器的样式表”(http://technet.microsoft.com/en-us/library/ms345247%28SQL.90%29.aspx)

You can use the rc:StyleSheet URL access parameter to specify a custom style sheet on the report URL.

您可以使用rc:StyleSheet URL访问参数在报告URL上指定自定义样式表。

http://localhost/reportserver?/AdventureWorksSampleReports/Product+Line+Sales&rs:Command=Render&rc:Stylesheet=MyStyleSheet