problem definition:
having data with symbolic colors (i.e each teacher is noted with a color)
in DataGridView
displaying a simple SELECT
query result, I managed to color each row with its teacher's color
using visual studio 2012 and crystal report for VS 13.0.5
public void setColor() {
int index = this.Dgv.Columns["color"].Index;
foreach (DataGridViewRow row in this.Dgv.Rows)
{
System.Drawing.ColorConverter cc = new System.Drawing.ColorConverter();
System.Drawing.Color c = (System.Drawing.Color)cc.ConvertFromString(row.Cells[index].Value.ToString());
row.DefaultCellStyle.BackColor = c;
}
this.Dgv.ClearSelection();
}
I'd like to get a similarly styled report in crystal report but I'm having problems with color manipulation, the far I could get was alternating row color as many articles online help me through.
crystal report color issues I've found while searching were solved by applying the logic in a formula but in my case the colors are within the bound dataset (color values like "WHITE", "#FF0092" etc)
I thought of changing how the color is stored to (rr,gg,bb) to make use of the Color function in crystal report, would the function accept the string instead of 3 parameters?
to wrap my question up:
- is it possible to achieve the same level of color-control in crystal reports as in C#?
- is it possible to string-manipulate the (rr,gg,bb) string to extract the 3 needed parameters?
any pointers are appreciated
please include explanation since I'm a CR newbie
thank you