
If I could I would pay you for your help. If you have the time and inclination please let me know if you have come up with a solution to my other main quandary under the Thread heading "one report, choose from multiple data sources.” I know it’s going to take a form or something on the front end as Crystal doesn’t do this on its own (so says BO Tech Support.) You can add a text object, but leave it.
#IF THEN FORMULA FOR ALTERNATING COLORS IN CRYSTAL REPORTS MOD#
if RecordNumber mod 2 0 then red else blue This will give me a result but the total detail section is get coloured. For that i have use below procedure Right Click Details Section -> Chose Colour tab -> Use formula ie. Share Improve this answer answered at 19:59 user3692405 1 2 Add a comment 0 Right click field 1. These are the numbers that you will see when you create a custom color. You have aided me very much and I have notified others about this post so too can benefit from it. Hi All, I want to display coloured alternating rows in a report. if x> 0 then formula color (159,255,159) else formula crRed end if 'The values in the color (159,255,159) are color (red, green, blue). I'm pretty sure there are better ways to accomplish the end result, however being so green in programming and never having to get to this extreme in Crystal Reporting and the fact that I'm up against a deadline, I have just get it to work and then later make it more efficient. So I would have to apply you logic at the top most Main Report level and then insert this crosstab into it. Because of the complexity of the data the clients wish to see and the nature of the report it was necessary to create several different SQL views and then several crosstabs based on those SQL views, and finally insert them as sub in the Main Report. It wouldn't be much trouble to make it a subreport, however this particular report is one of 12 crosstabs inserting into the Main Report.

The crosstab is the only object in the report (except the group which is suppressed.) Yes the topn sort is happening on the crosstab itself. LB RE: Alternating row colors in crosstabs MSBrady (TechnicalUser) Then you can format your cells, your total column, and your row labels using the earlier mentioned formulas. If remainder(val(CurrentFieldValue),2)= 0 then crYellow else crNocolorĢ) If your row label isn't a number and you don't have many rows, you could create a formula to add a leading number to your row label, as in the following example, where the Then select the row label->right click->change border->background->x+2 and enter:

Repeat this formula for the row total column. If it is a database field or formula, remove the curly brackets, so that the row field looks like "table.rowfield" or the formula looks like substituting your actual row field name, of course. where you place your row field within the quotes. If remainder(GridRowColumnValue ("table.rowfield"),2) = 0 then crYellow else nocolor

You can do alternate rows of color in an inserted crosstab by doing the following.ġ) If your row label happens to be a consecutive number:įirst select a cell while in design or preview mode->right click->change border->background->x+2 and enter:
