epruben
July 7th, 2008, 03:14 PM
I recently developed a class that creates a crystal report document from a listview control. The crystal report document is then shown using a crystal reports viewer. To make the report look nicer I added some design time conditional formatting. To do this I:
1. Opened the report document (rpt) file designer
2. right clicked on the Details section and selected Section Expert.
3. Selected the Color tab and pressed Formula button (X+2).
4. Endered the following formula code: If Remainder (RecordNumber, 2) <> 0 then Color(254, 252, 203) else crWhite
This causes every other row of data to be drawn with the "Info" backcolor.
My question is:
Is it possible to modify the reports conditional formatting formula at runtime (i.e. in code just before the report is shown in the report viewer)? I would like the software user to control the color or wether or not alternate backcolors are shown at all. Answers with C# or VB code would be great. Thanks in advance!!
Eric
Eric
1. Opened the report document (rpt) file designer
2. right clicked on the Details section and selected Section Expert.
3. Selected the Color tab and pressed Formula button (X+2).
4. Endered the following formula code: If Remainder (RecordNumber, 2) <> 0 then Color(254, 252, 203) else crWhite
This causes every other row of data to be drawn with the "Info" backcolor.
My question is:
Is it possible to modify the reports conditional formatting formula at runtime (i.e. in code just before the report is shown in the report viewer)? I would like the software user to control the color or wether or not alternate backcolors are shown at all. Answers with C# or VB code would be great. Thanks in advance!!
Eric
Eric