Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Tuesday, March 27, 2012

Can we change the style of reports just like css of html

it is stupidity to change color and background for each reports.."Template" report is provided so that you fix up all the things you require
for each report and then copy in a particular folder, so whenever you go for
creating a new report this template can be selected.
Amarnath
"lieshengren" wrote:
> it is stupidity to change color and background for each reports..
>
>|||thanks very much.
My friend give me another way to change the color some other options of
report.
"write the vb expression @.column color, put color configuration in database
"...
oh . so it is hard to write first time. but easy to change.
User's information is about 1000 reocords in the system, so i build a table
to save some color schemas then let user to save a schema to session
information which they want .
^_^!...
but low performance when there is a big user's information.
"Amarnath" <Amarnath@.discussions.microsoft.com> wrote in message
news:14D750CC-8A50-4CB6-A4FoA-D639AE6AA2DD@.microsoft.com...
> "Template" report is provided so that you fix up all the things you
> require
> for each report and then copy in a particular folder, so whenever you go
> for
> creating a new report this template can be selected.
> Amarnath
> "lieshengren" wrote:
>> it is stupidity to change color and background for each reports..
>>|||If you want to avoid the performance issue you could do something like this
instead of the dynamic vb expression:
* -- create the original report with a custom property indicating the "style
element" -- would be the class -- of as many individual textboxes and other
layout items as you want
* -- when a user wants to assign a color scheme, load the original RDL up as
XML and use the class information to adjust the color and any other
attributes you support in the RDL metadata. You can do this through the DOM
if you like -- I do it through XSLT but people here are probably tired of
hearing about that <g>. It doesn't matter how you implement it.
* -- save a copy of the RDL to a new name -- include a theme ID or something
concatenated with the original report name. Save the user's preference.
* -- at runtime, look up whether the user has a theme associated with that
report (or, if the user picks one theme for all reports, look up to see if
this user has picked a theme). If they have, swap the name of the report to
run for the correct "themed" version.
Now you have a very small hit at runtime and a very flexible reporting
application -- which can support anything that CSS can support and that is
also supported by RDL. You can choose to support more attributes over time,
if you like, even if you just start with color.
>L<
"lieshengren" <lieshengren@.163.com> wrote in message
news:uFhCZT7hHHA.3472@.TK2MSFTNGP04.phx.gbl...
> thanks very much.
> My friend give me another way to change the color some other options of
> report.
> "write the vb expression @.column color, put color configuration in
> database "...
> oh . so it is hard to write first time. but easy to change.
> User's information is about 1000 reocords in the system, so i build a
> table to save some color schemas then let user to save a schema to
> session information which they want .
> ^_^!...
> but low performance when there is a big user's information.
>
> "Amarnath" <Amarnath@.discussions.microsoft.com> wrote in message
> news:14D750CC-8A50-4CB6-A4FoA-D639AE6AA2DD@.microsoft.com...
>> "Template" report is provided so that you fix up all the things you
>> require
>> for each report and then copy in a particular folder, so whenever you go
>> for
>> creating a new report this template can be selected.
>> Amarnath
>> "lieshengren" wrote:
>> it is stupidity to change color and background for each reports..
>>
>sql

Sunday, March 25, 2012

Can we a use a CSS or equivalent for a reports(RDLC File)

Hi,

I will be using RDLC files to display reports in various pages.

My Question is this.

I need to use the same type of formatting of color,fonts,font sizes and the background colors so that the same can be used across the reports.

This is somewhat like using a CSS file for aspx pages.

Any ideas... , solution........, .......

Hi,

Just wondering!

We have CSS for the aspx and the HTML pages.

Are there no ways to set a golbal standard for the Reports( Ok, be it a Server report or a local report.). Is it not correct what I am asking.

|||I've been looking into this also, and I found some old threads stating that themes and css are not supported but that they may be in the next version.|||

Hello,

Formatting for reports can be expression based. Create your reports using a standard formula for similar items and pass in values through a dataset. Another option would be to take formatting information in as parameters. The RDL file is just an XML file, you could modify it directly if you want. Here is a link to information on programmatically generating RDLs: http://technet.microsoft.com/en-us/library/ms154583.aspx. RDLs and RDLCs are very similar, and the same techniques could be used.

Good luck,

Larry

|||I need a clarification.

How do I assign a class in the css to a text box.

Say I have a class .txtboxTahomaBold in the CSS, how do I assign the class to the textbox. I do not find any property for the controls (textbox, table .... )|||

I am sorry to have misslead you. You do not get to assign CSS to the textboxes, but you can assign the regular SSRS formatting to each text box on a report prior to displaying it. The easiest way would be to create formulas within the report based on data that you provide through a dataset. For example, set the Font formula to =FieldsTextBoxTahomaBold.Value and have the dataset pass in the string "Normal, Tahoma, 11pt, Bold". Of course, you could also modify the XML, but that is more trouble than it is worth.

I will try and get an example written up on my blog. I will post a link here when I do.

Larry

|||

Thanks.

Waiting for your reply.

|||

Formatting your report based on the user or the data is relatively straight forward once you get the trick. To demonstrate, create a report with a valid connection to an instance of Microsoft SQL Server and use the following SQL as your query:

Code Snippet

SELECT
CASE @.param
WHEN 0 THEN 'Blue'
WHEN 1 THEN 'Red'
END AS color,
CASE @.param
WHEN 0 THEN '12pt'
WHEN 1 THEN '24pt'
END AS size

and create five text boxes with the following attributes:
TextBox1
Value: Color
Color: =First(Fields!color.Value)

TextBox2
Value: Size
Font: Normal, Arial, =First(Fields!size.Value), Normal

TextBox3
Value: Both
Color: =First(Fields!color.Value)
Font: Normal, Arial, =First(Fields!size.Value), Normal

TextBox4
Value: =First(Fields!color.Value)

TextBox5
Value: =First(Fields!size.Value)

Sorry for the delay. The article at http://smithmier.com/blog/?p=38 has a picture of the results, but it really isn't required to understand the concept.

|||

Hi Larry,

Thanks for the post.

I will check it out.

Can we a use a CSS or equivalent for a reports(RDLC File)

Hi,

I will be using RDLC files to display reports in various pages.

My Question is this.

I need to use the same type of formatting of color,fonts,font sizes and the background colors so that the same can be used across the reports.

This is somewhat like using a CSS file for aspx pages.

Any ideas... , solution........, .......

Hi,

Just wondering!

We have CSS for the aspx and the HTML pages.

Are there no ways to set a golbal standard for the Reports( Ok, be it a Server report or a local report.). Is it not correct what I am asking.

|||I've been looking into this also, and I found some old threads stating that themes and css are not supported but that they may be in the next version.|||

Hello,

Formatting for reports can be expression based. Create your reports using a standard formula for similar items and pass in values through a dataset. Another option would be to take formatting information in as parameters. The RDL file is just an XML file, you could modify it directly if you want. Here is a link to information on programmatically generating RDLs: http://technet.microsoft.com/en-us/library/ms154583.aspx. RDLs and RDLCs are very similar, and the same techniques could be used.

Good luck,

Larry

|||I need a clarification.

How do I assign a class in the css to a text box.

Say I have a class .txtboxTahomaBold in the CSS, how do I assign the class to the textbox. I do not find any property for the controls (textbox, table .... )|||

I am sorry to have misslead you. You do not get to assign CSS to the textboxes, but you can assign the regular SSRS formatting to each text box on a report prior to displaying it. The easiest way would be to create formulas within the report based on data that you provide through a dataset. For example, set the Font formula to =FieldsTextBoxTahomaBold.Value and have the dataset pass in the string "Normal, Tahoma, 11pt, Bold". Of course, you could also modify the XML, but that is more trouble than it is worth.

I will try and get an example written up on my blog. I will post a link here when I do.

Larry

|||

Thanks.

Waiting for your reply.

|||

Formatting your report based on the user or the data is relatively straight forward once you get the trick. To demonstrate, create a report with a valid connection to an instance of Microsoft SQL Server and use the following SQL as your query:

Code Snippet

SELECT
CASE @.param
WHEN 0 THEN 'Blue'
WHEN 1 THEN 'Red'
END AS color,
CASE @.param
WHEN 0 THEN '12pt'
WHEN 1 THEN '24pt'
END AS size

and create five text boxes with the following attributes:
TextBox1
Value: Color
Color: =First(Fields!color.Value)

TextBox2
Value: Size
Font: Normal, Arial, =First(Fields!size.Value), Normal

TextBox3
Value: Both
Color: =First(Fields!color.Value)
Font: Normal, Arial, =First(Fields!size.Value), Normal

TextBox4
Value: =First(Fields!color.Value)

TextBox5
Value: =First(Fields!size.Value)

Sorry for the delay. The article at http://smithmier.com/blog/?p=38 has a picture of the results, but it really isn't required to understand the concept.

|||

Hi Larry,

Thanks for the post.

I will check it out.