Click to See Complete Forum and Search --> : Alternating Crystal Report Back Colors


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

jawadhashmi
July 12th, 2008, 04:23 AM
Eric,

I have not that much idea how you can do it from the code. There could be an idea
you cab create a UFL which can check this from the file
Or you can store these configurations which can be taken by the Crystal Report.

Also there would be a way of sending the parameters to the report by the application. Check this out.