Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Change Backgorund Color Post Reply Post New Topic
Author Message
rcflyer2005
Newbie
Newbie


Joined: 20 Jan 2009
Location: United States
Online Status: Offline
Posts: 6
Quote rcflyer2005 Replybullet Topic: Change Backgorund Color
    Posted: 26 Jan 2009 at 11:41am
This if my first Crystal Report! I using CR XI.

I am creating a report from a MySQL table.  There are 1400+ rows.  Each row is a separate report.  That is, what is on page 1 has nothing to do with what is on page 2 or page 1000.  I'm just dumping 1 row of data on one report  1400+ times. 

In each table row, I have the RGB values that I want to apply to that page only.  After I place the RGB values on the report and set them non-display, how do I combine the 3 values and set the background property?

Also, where can I find a list of properties I can modify?

Thanks much.
Cheers!


Edited by rcflyer2005 - 26 Jan 2009 at 11:49am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2009 at 12:29pm
Have a little trouble following you here but you can set the backgroud color of any section conditionally by:
select your Section Expert
click on on the section you want to format (e.g. Details)
click on the COLOR tab (on the right)
click the formula editor and insert your formula there.
I hope you have a table that has all of your color schemas with corresponding pages and you can use that in your formula.
you can use "Color (Rvalue,Gvalue,Bvalue)" as formula to set the color.


Edited by DBlank - 26 Jan 2009 at 12:30pm
IP IP Logged
rcflyer2005
Newbie
Newbie


Joined: 20 Jan 2009
Location: United States
Online Status: Offline
Posts: 6
Quote rcflyer2005 Replybullet Posted: 26 Jan 2009 at 1:19pm
Some Background:
This is not a production report.  It is a "means to an end" to get invoice data into pdf format.  It is just that some pages have a background color.  That is all.  It's not logical or it is supposed to make sense. 

The table contains test invoice data.  Most invoices are printed on white paper.  However, some vendors print their invoices on color paper.  I'm trying to simulate that.  Think of each page being an invoice a company has received from 1400+ vendors.  That's why the pages are not related.  When CR prints page 1, I want it to get the RGB values and make the background the values of RGB.  Do the same for page 2,3,...,page1400+.  Each row in the db is a page break. 

If I created a formula, what would I type in it?  If I put the RGB values on the report they would be fields colorR, colorG and colorB.  Or I can put the three values in one field, separated by a comma and use one field.

Sorry for the confusion!

thanks much!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2009 at 1:37pm
So you have a table with vendor names and the colums for the R, B and G values that you can link to the invoice data on the vendor? If so what field type are the "color" columns.

Edited by DBlank - 26 Jan 2009 at 1:44pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2009 at 2:12pm
If the above is accurate you can bypass dealing with page numbers and handle it based on your joins to the vendors. If you only have the vendors that use color in the "color table" you would need to handle instances where they are not listed. I have never tried this and don't really have good data for testing the process but this might work (replace the {table.field} with the appropraite fields from your color table):
if isnull ({colortable.vendorfield}) then crNoColor else Color (int({colortable.Rvaluefield}),int({colortable.Bvaluefield}),int({colortable.Gvaluefield}))


Edited by DBlank - 26 Jan 2009 at 2:28pm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.