Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting color fonts in the Cross tab 1

Status
Not open for further replies.

raj0927

Programmer
Oct 8, 2010
26
US
Hi - I am inserting the cross tab with the result value and each value has a HTMLColorcode attached to it. so when i am using this crosstab is there a way i can make the font color change based on the HTMLColorCode.
 
You need to be more specific about what you are trying to do. Is there just one summary field? What are the row and column fields as entered into the crosstab expert? What criteria are you using to determine which color the field should be?

-LB
 
1) Yes there is only summary feild which are the test results
2) Rows are the test names,columns are collection dates and summary is the test result number
3)There is feild by name result_type_color_cd which tells the color for theat particulat test result.These color code are in the HTML Color Code format '66FFCC- Green'

the query is in the format
test_name Collection_date test_result result_type_color_cd
ABC 07-01-2011 5.4H 66FFCC
XYZ 07-07-2011 3.2L 66CCFF

Corostab is in the format

07-01-2011 07-07-2011
ABC 5.4H
XYZ 3.2L

The Font Color for 5.4H should be green since the result_type_color_cd is 66FFCC.How can i tie these codes to the test_result





 
What CR version are you using? Do you already know how to use the HTML color code in Crystal and just need to know to use it within a crosstab?

-LB
 
I am using the crystal reports 2008, i have done other reports using the HTMLColorCode.Need to know how can i do that for the crosstab.
 
Well, I am not familiar with how to use HTML color codes in CR, but since it is held in a different field, you would have to add that field as a crosstab summary and then use the formatting area of that field to pass the value in a variable to the other summary so you could implement the color.

If you can show me how you would ordinarily use the HTML color code field in Crystal to get the desired color, I could then direct you more specifically in how to use the variable method in the crosstab.

-LB
 
i have created a function by name HTMLColortoCRCOlor,so usually what i do is i go into the format feild and insert the font formula as HTMLColortoCRColor(result_typed_color_cd).
 
So add the font formula as another summary field. Then right click on it->format field->suppress->x+2 and enter:

whileprintingrecords;
numbervar fcol := currentfieldvalue;
true

Then select the other summary->format field->font->color->x+2 and enter:

whileprintingrecords;
numbervar fcol;

I can't really test this, but let me know if it works. You can then resize the font summary cell to minimize the height.

-LB
 
I have inserted the formula into my report but since there are two additional rows on my report the formula is not working properly i guess or may be i am doing something wrong.I have attached the report for reference.
 
 http://www.mediafire.com/?65ny49s2f76en
The color summary needs to be summary #1 so that it can pass the value to summary #2. So just switch the order of the summaries. When I did that, some results were red, some blue, and most were black. Is that what you would expect? Also, if you minimize/adjust the height of the suppressed color summary, and change your customized groupname to "use a formula":

chr(13)+ ToText ({RETURN_REPORT_DATA.DESCR})

...the results can be better aligned.

-LB
 
Okay, I see that it isn't resetting, I guess because the custom function is null when there is no color, so the variable keeps reading the previous value. But you can select the result summary and in the font tab->strikeout->x+2 (below the font color), enter:

whileprintingrecords;
numbervar fcol := 0;
defaultattribute

This will reset it.

-LB
 
I have inserted the formula but it doesnt get reset
 
I tested this on the report that you provided via download, and it did reset. You should be entering this formula in the same crosstab row for the result summary as you did for the color formula. Be sure to enter it in the strikeout formula area (just because it is processed after the color formula).

If you can't get it to work, please be very specific about what you did so I can troubleshoot it.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top