Monday, March 19, 2012
Applying CSS to SRS Reports
SRS ?
Since i figured out there is one property comes with SP1 i.e.,
rc:Stylesheet=Mystylename (without css extension) but this solution can only
resolve my half problem i.e., it applies only to parameter section and
toolbar section of the report but i wanted to apply for complete report
display while rendering it or displaying with the use of ReportViewer control.
Any Help is appreciated.
Thanks in advance.
APatelWe have the same want, we ended up using a near identity xsl to transorm the
unstyled report into 3 styles that we use as a subreport. The outer report
uses the style as a parameter, then we show/hide the subreports based on the
style...Yes it's very clunky, I'm looking for suggestions on a better way.
Here's my xsl file:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:msrs="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition"
xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
exclude-result-prefixes="msrs xs fn">
<xsl:output encoding="iso-8859-1" method="xml" omit-xml-declaration ="yes"
indent="yes"/>
<xsl:template match="//msrs:FontFamily">
<msrs:FontFamily>Tahoma</msrs:FontFamily>
</xsl:template>
<xsl:template
match="//msrs:Textbox/msrs:Style[msrs:BackgroundColor='#fbee83']/msrs:BackgroundColor">
<msrs:BackgroundColor>#4e0000</msrs:BackgroundColor>
<msrs:Color>White</msrs:Color>
</xsl:template>
<xsl:template
match="//msrs:Textbox/msrs:Style[msrs:BackgroundColor='SandyBrown']/msrs:BackgroundColor">
<msrs:BackgroundColor>Maroon</msrs:BackgroundColor>
<msrs:Color>White</msrs:Color>
</xsl:template>
<xsl:template match="//msrs:Textbox/msrs:Style[contains(., 'Mod 2,
"White", "Wheat"')]/msrs:BackgroundColor">
<msrs:BackgroundColor>= iif(RowNumber(Nothing) Mod 2, "White",
"LightGrey")</msrs:BackgroundColor>
</xsl:template>
<xsl:template match="@.* | node()" priority="-2">
<xsl:copy>
<xsl:apply-templates select="@.* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
"APatel" <APatel@.discussions.microsoft.com> wrote in message
news:B6D65976-EF0D-4BD0-A8A0-798CD71678A5@.microsoft.com...
> Hi , I hava a quick question about can we apply Css to actual repots in
> the
> SRS ?
> Since i figured out there is one property comes with SP1 i.e.,
> rc:Stylesheet=Mystylename (without css extension) but this solution can
> only
> resolve my half problem i.e., it applies only to parameter section and
> toolbar section of the report but i wanted to apply for complete report
> display while rendering it or displaying with the use of ReportViewer
> control.
> Any Help is appreciated.
> Thanks in advance.
> APatel
Applying colors to reports
Is there a way to apply .css or Skin files to all reports. Changing colors in each and every page is a little cumbersome.
Thanks in advance
Unfortunately no. HTML control is on the wishlist for the next version I believe.|||How about creating a custom assembly and putting your formatting functions in this centralized shared library? Instead of hard-coding colors in your report, reference the shared library. I am in the process of creating 50 reports where the color scheme has not been finalized, and I need the ability to change the color scheme globally. Maybe I can code a way to pull the formatting information from a database table. It would be easier to update the colors that way, instead of having to redeploy the assembly dll with every color change.|||We have been looking for the same thing, finally we did put our colors (textual) in a database-table and assign text and background colors with an expression, causes some work to do, this for earch report but once done, you can change al your reports depending on the season or whatever crazy reason to change layouts.
Even our header images come from a database so during some periods we can (just like google) do some funny stuff.
Users mostly appreciate it.
Applying colors to reports
Is there a way to apply .css or Skin files to all reports. Changing colors in each and every page is a little cumbersome.
Thanks in advance
Unfortunately no. HTML control is on the wishlist for the next version I believe.|||How about creating a custom assembly and putting your formatting functions in this centralized shared library? Instead of hard-coding colors in your report, reference the shared library. I am in the process of creating 50 reports where the color scheme has not been finalized, and I need the ability to change the color scheme globally. Maybe I can code a way to pull the formatting information from a database table. It would be easier to update the colors that way, instead of having to redeploy the assembly dll with every color change.|||We have been looking for the same thing, finally we did put our colors (textual) in a database-table and assign text and background colors with an expression, causes some work to do, this for earch report but once done, you can change al your reports depending on the season or whatever crazy reason to change layouts.
Even our header images come from a database so during some periods we can (just like google) do some funny stuff.
Users mostly appreciate it.
Sunday, March 11, 2012
Applying a .css to a .rdl file
Hello all,
I'm using Reporting Services 2005 and have been developing reports using Visual Studio 2005. There will eventually be a large number of reports, all of which will need to adhere to my company's standard look and feel.
To this end I was wondering if it were possible to apply a .css stylesheet to the contents of a .rdl report?
I've been digging round the web and can't seem to come across a definitive answer either way.
I am fairly new to Reporting Services so apologies in advance if this has been asked before.
Thanks
I believe there is no way of doing thisSaturday, February 25, 2012
Application of HTMLviewer.css to reports called through Report Man
reportingservices.css style sheet working well.
As we will be calling reports from within Report Manager, we would like to
apply the HTMLviewer.css file to every report called through Report Manger.
This would enable us to get the same look and feel in the Report Manager as
well as the parameter area / HTML viewer.
Does anyone know if it is possible to implement this?
Thanks
DarrenHi!
Really, you have to snag the report call inside the report manager and to
replace it with your url (a call to report server which differs from the one
generated by report manager only in that it the name of css file as a
parameter - rs:StylSheet it seems to me). It's not very difficult, but
requires concentration. I can recommend a book - Hitchiker's guide to
Reporting Services by Peter Blackburn. It can be very helpful.
Regards, Ailil
"Darren" wrote:
> We are customizing Report Manager and have been able to get the
> reportingservices.css style sheet working well.
> As we will be calling reports from within Report Manager, we would like to
> apply the HTMLviewer.css file to every report called through Report Manger.
> This would enable us to get the same look and feel in the Report Manager as
> well as the parameter area / HTML viewer.
> Does anyone know if it is possible to implement this?
> Thanks
> Darren
>|||Great,
Thanks Ailil - so it can be done! I've actually got that book, but not
knowing Java, got a bit lost. I'll get our Java person to have a look at it
- hopefully it will be possible to pass the report string as a variable and
simply add the stylesheet command to the end.
Darren
"Ailil" wrote:
> Hi!
> Really, you have to snag the report call inside the report manager and to
> replace it with your url (a call to report server which differs from the one
> generated by report manager only in that it the name of css file as a
> parameter - rs:StylSheet it seems to me). It's not very difficult, but
> requires concentration. I can recommend a book - Hitchiker's guide to
> Reporting Services by Peter Blackburn. It can be very helpful.
> Regards, Ailil
> "Darren" wrote:
> > We are customizing Report Manager and have been able to get the
> > reportingservices.css style sheet working well.
> >
> > As we will be calling reports from within Report Manager, we would like to
> > apply the HTMLviewer.css file to every report called through Report Manger.
> > This would enable us to get the same look and feel in the Report Manager as
> > well as the parameter area / HTML viewer.
> >
> > Does anyone know if it is possible to implement this?
> >
> > Thanks
> > Darren
> >
> >|||Hello!
Now I'm a bit lost ;). Why Java? Where are you going to use Java in the
Report Manager? It can be quite ok without java :), particularly if you
already have the book.
Regards, Ailil
"Darren" wrote:
> Great,
> Thanks Ailil - so it can be done! I've actually got that book, but not
> knowing Java, got a bit lost. I'll get our Java person to have a look at it
> - hopefully it will be possible to pass the report string as a variable and
> simply add the stylesheet command to the end.
> Darren
> "Ailil" wrote:
> > Hi!
> >
> > Really, you have to snag the report call inside the report manager and to
> > replace it with your url (a call to report server which differs from the one
> > generated by report manager only in that it the name of css file as a
> > parameter - rs:StylSheet it seems to me). It's not very difficult, but
> > requires concentration. I can recommend a book - Hitchiker's guide to
> > Reporting Services by Peter Blackburn. It can be very helpful.
> >
> > Regards, Ailil
> >
> > "Darren" wrote:
> >
> > > We are customizing Report Manager and have been able to get the
> > > reportingservices.css style sheet working well.
> > >
> > > As we will be calling reports from within Report Manager, we would like to
> > > apply the HTMLviewer.css file to every report called through Report Manger.
> > > This would enable us to get the same look and feel in the Report Manager as
> > > well as the parameter area / HTML viewer.
> > >
> > > Does anyone know if it is possible to implement this?
> > >
> > > Thanks
> > > Darren
> > >
> > >|||Hi Ailil,
I figured that we would have to intercept the call to the Report Server as
shown on page 533, to replace the standard URL call generated by Report
Manager, with a URL where the parameter 'rc:Stylesheet = htmlviewer' is added
to the end.
Thanks
Darren
"Ailil" wrote:
> Hello!
> Now I'm a bit lost ;). Why Java? Where are you going to use Java in the
> Report Manager? It can be quite ok without java :), particularly if you
> already have the book.
> Regards, Ailil
> "Darren" wrote:
> > Great,
> >
> > Thanks Ailil - so it can be done! I've actually got that book, but not
> > knowing Java, got a bit lost. I'll get our Java person to have a look at it
> > - hopefully it will be possible to pass the report string as a variable and
> > simply add the stylesheet command to the end.
> >
> > Darren
> >
> > "Ailil" wrote:
> >
> > > Hi!
> > >
> > > Really, you have to snag the report call inside the report manager and to
> > > replace it with your url (a call to report server which differs from the one
> > > generated by report manager only in that it the name of css file as a
> > > parameter - rs:StylSheet it seems to me). It's not very difficult, but
> > > requires concentration. I can recommend a book - Hitchiker's guide to
> > > Reporting Services by Peter Blackburn. It can be very helpful.
> > >
> > > Regards, Ailil
> > >
> > > "Darren" wrote:
> > >
> > > > We are customizing Report Manager and have been able to get the
> > > > reportingservices.css style sheet working well.
> > > >
> > > > As we will be calling reports from within Report Manager, we would like to
> > > > apply the HTMLviewer.css file to every report called through Report Manger.
> > > > This would enable us to get the same look and feel in the Report Manager as
> > > > well as the parameter area / HTML viewer.
> > > >
> > > > Does anyone know if it is possible to implement this?
> > > >
> > > > Thanks
> > > > Darren
> > > >
> > > >|||Hi!
Hey :). You mean JavaScript :). It's a bit different thing )
Regards, Ailil
"Darren" wrote:
> Hi Ailil,
> I figured that we would have to intercept the call to the Report Server as
> shown on page 533, to replace the standard URL call generated by Report
> Manager, with a URL where the parameter 'rc:Stylesheet = htmlviewer' is added
> to the end.
> Thanks
> Darren
> "Ailil" wrote:
> > Hello!
> > Now I'm a bit lost ;). Why Java? Where are you going to use Java in the
> > Report Manager? It can be quite ok without java :), particularly if you
> > already have the book.
> >
> > Regards, Ailil
> >
> > "Darren" wrote:
> >
> > > Great,
> > >
> > > Thanks Ailil - so it can be done! I've actually got that book, but not
> > > knowing Java, got a bit lost. I'll get our Java person to have a look at it
> > > - hopefully it will be possible to pass the report string as a variable and
> > > simply add the stylesheet command to the end.
> > >
> > > Darren
> > >
> > > "Ailil" wrote:
> > >
> > > > Hi!
> > > >
> > > > Really, you have to snag the report call inside the report manager and to
> > > > replace it with your url (a call to report server which differs from the one
> > > > generated by report manager only in that it the name of css file as a
> > > > parameter - rs:StylSheet it seems to me). It's not very difficult, but
> > > > requires concentration. I can recommend a book - Hitchiker's guide to
> > > > Reporting Services by Peter Blackburn. It can be very helpful.
> > > >
> > > > Regards, Ailil
> > > >
> > > > "Darren" wrote:
> > > >
> > > > > We are customizing Report Manager and have been able to get the
> > > > > reportingservices.css style sheet working well.
> > > > >
> > > > > As we will be calling reports from within Report Manager, we would like to
> > > > > apply the HTMLviewer.css file to every report called through Report Manger.
> > > > > This would enable us to get the same look and feel in the Report Manager as
> > > > > well as the parameter area / HTML viewer.
> > > > >
> > > > > Does anyone know if it is possible to implement this?
> > > > >
> > > > > Thanks
> > > > > Darren
> > > > >
> > > > >|||Yeah - meant JavaScript not Java.
I've posted another message re changing the default htmlviewer style sheet
as the SP2 readme file says that there is a config setting where you can
change the default style sheet.
Thanks for your help.
Darren
"Ailil" wrote:
> Hi!
> Hey :). You mean JavaScript :). It's a bit different thing )
> Regards, Ailil
> "Darren" wrote:
> > Hi Ailil,
> >
> > I figured that we would have to intercept the call to the Report Server as
> > shown on page 533, to replace the standard URL call generated by Report
> > Manager, with a URL where the parameter 'rc:Stylesheet = htmlviewer' is added
> > to the end.
> >
> > Thanks
> > Darren
> >
> > "Ailil" wrote:
> >
> > > Hello!
> > > Now I'm a bit lost ;). Why Java? Where are you going to use Java in the
> > > Report Manager? It can be quite ok without java :), particularly if you
> > > already have the book.
> > >
> > > Regards, Ailil
> > >
> > > "Darren" wrote:
> > >
> > > > Great,
> > > >
> > > > Thanks Ailil - so it can be done! I've actually got that book, but not
> > > > knowing Java, got a bit lost. I'll get our Java person to have a look at it
> > > > - hopefully it will be possible to pass the report string as a variable and
> > > > simply add the stylesheet command to the end.
> > > >
> > > > Darren
> > > >
> > > > "Ailil" wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > Really, you have to snag the report call inside the report manager and to
> > > > > replace it with your url (a call to report server which differs from the one
> > > > > generated by report manager only in that it the name of css file as a
> > > > > parameter - rs:StylSheet it seems to me). It's not very difficult, but
> > > > > requires concentration. I can recommend a book - Hitchiker's guide to
> > > > > Reporting Services by Peter Blackburn. It can be very helpful.
> > > > >
> > > > > Regards, Ailil
> > > > >
> > > > > "Darren" wrote:
> > > > >
> > > > > > We are customizing Report Manager and have been able to get the
> > > > > > reportingservices.css style sheet working well.
> > > > > >
> > > > > > As we will be calling reports from within Report Manager, we would like to
> > > > > > apply the HTMLviewer.css file to every report called through Report Manger.
> > > > > > This would enable us to get the same look and feel in the Report Manager as
> > > > > > well as the parameter area / HTML viewer.
> > > > > >
> > > > > > Does anyone know if it is possible to implement this?
> > > > > >
> > > > > > Thanks
> > > > > > Darren
> > > > > >
> > > > > >