Stir reports in Reporting Services 2005 Web Application Maintenance Hello everyone!
During the various workshops and training that I animated about Reporting Services 2005, a question comes up regularly : Interoperability.
Indeed, if Reporting Services is very well integrated in the world. Net, especially with the ReportViewer component, how can we integrate a report in a classic ASP page? Reporting Services how to fly from a single frame?
While integration of Reporting Services through the URL of the report server is relatively simple, it is however not the same for the settings to customize the display. And there are few elements of documentation available to us. I therefore propose here a selection of useful parameters for integrating Reporting Services reports in Web pages.
Create for example the report "My
Rapport.rdl " which is stored in a new folder "Test
" of our Reporting Services server.
In order to test all parameters, we add a parameter in our report called "
DateDuJour .
By default, the URL
http://localhost/reportserver? 2fTest%% + Report 2fMon allows me to get my report - of course starting from the premise that the report server is well in address
http://localhost/reportserver and the Report Manager is located at
http://localhost/Reports .
It is possible to prevent the user from having to enter the setting by adding the parameter in the URL:
http://localhost/reportserver? 2fTest%% + Report & 2fMon DateDuJour = 1.1 / 2007 However, the record still has got a heavy toolbar and allows the user to modify at will the report parameters.
There are actually many parameters to customize the display of our report. We distinguish two broad categories:
- server settings prefixed by the namespace rs,
- Parameters Rendering components prefixed by the namespace rc.
Here are the server settings the most useful:
- rs: Command
This parameter defines the action taken by the server. By default, the value of this parameter is set to "Render
" for reports and "
ListChildren " for folders.
There are also two other possible values for this parameter: "
GetRessourceContents " and "
GetDataSourceContents .
If you specify this parameter, the URL of our relationship becomes:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & DateDuJour = 01/01/2007 - rs: Format The format is undoubtedly one of the preferred settings for users. It allows to define the format of the report from existing formats (
HTML3.2 ,
HTML4.0 ,
HTMLOWC ,
MHTML, IMAGE
,
Excel, CSV
,
PDF ,
XML) or other extensions if they are available on the server.
So if you want to get our report in PDF, the URL of our relationship becomes:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rs: Format = PDF & DateDuJour = 01/01/2007 - rs: ParameterLanguage This parameter allows to overcome the culture of the client browser by specifying a specific culture. The default is the value of the client browser.
example, we can force the culture of our report using the following URL:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rs: ParameterLanguage = en & DateDuJour = 01 / 01/2007 - rs: Snapshot Parameter Snapshot allows you to use the capture of a report made at a time and one o'clock sharp. This snapshot is stored in the database Reporting Services.
This parameter receives a long time without timezone. Our URL is:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rs: Snapshot = 2007-05-22T15: 41:08 This parameter obviously requires that the history of the report be enabled.
- rs: ClearSession this parameter to force the browser to clear its cache and reload a new version of the report.
In our case, the URL becomes:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rs: = true & ClearSession DateDuJour = 01/01/2007 - rs: SessionID A parameter that identifies an active session when the report server does not use cookies.
The URL takes the following form:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rs: SessionID = uwoits45rufhhg55f2i3hm55 & DateDuJour = 01/01/2007 We will now consider some rendering parameters useful:
- rc: Toolbar This setting allows you to display or hide the entire toolbar.
For example, if we want to hide Toolbar, our URL is:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rc: Toolbar = false & DateDuJour = 01/01/2007 value Default is obviously set to "true
.
- rc: Parameters This parameter does not hide the fact that the edition of the report parameters of the toolbar. The value of this parameter does not affect whether the precedent is set to "false
.
So if we want the report parameters are fixed, our URL is:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rc: Parameters = false & DateDuJour = 01/01/2007 The default is obviously set to "
true. "
- rc: Section This parameter displays the report page you want. By default, Reporting Services displays the first page of the report.
To view the second page, we write:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rc: Section = 2 & DateDuJour = 01/01/2007 This parameter is particularly useful if one wishes to develop its own toolbar.
- rc: Zoom It is a given parameter can be operated with versions of Internet Explorer 5.0 or later.
Possible values for this parameter are: *
"
page + width" to occupy the entire width of the browser,
* "Whole
+ page" to maximize space in the browser to view the report on a single page
* an integer corresponding to a percentage, the default is "100
.
- rc: LinkTarget Useful if your report contains hyperlinks, this parameter can specify the window frame or the destination of links in your report.
The possible values include: *
"_blank
"
* "_self
"
* "_parent
"
* "
_top"
* Or any other valid target name .
- rc: FindString, rc: StartFind, rc: EndFind The parameter rc: FindString can filter the records of the report. This parameter is often used in conjunction with the parameters
rc: StartFind and
rc: EndFind that can confine the search.
For example, to search for the string "Test
" in the first 2 pages of the report, the URL will be:
http://localhost/reportserver?%% 2fTest 2fMon + Report & rc: FindString = Test & rc: StartFind = 1 & rc: EndFind = 2 & DateDuJour = 01/01/2007 - rc: Stylesheet The last parameter I will elaborate in this post can define a style sheet to apply the report.
The CSS must be present in the repertoire of styles, default
C: \\ Program Files \\ Microsoft SQL Server \\ MSSQL \\ Reporting Services \\ ReportServer \\ Styles To apply the stylesheet "
mystyle.css ", the URL becomes :
http://localhost/reportserver?%% 2fTest 2fMon + Report & rs: Command = Render & rc: Stylesheet = myStyle & DateDuJour = 01/01/2007 Note as the report's call for the absence of extension.
I will conclude by the fact that most of the parameters presented here are valid as service packs
Reporting Services 2000, and therefore this section does not apply only to users of Reporting Services 2005
.
soon for another article!