Page 1 of 2

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 4:48 am
by jpascual
I have a dataset containing fields with ARGB color format. I want to assign the dataset to a table of Stimulsoft to paint the table cell background color depending on the field.
Is it possible to paint the background color of a cell in code?

thanks

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 5:35 am
by Alex K.
Hello,

Please see the sample report in attachment.

Thank you.

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 6:06 am
by jpascual
Thanks for the example.
But I can not write the name of the color in the table cell.
My example is the following dataset I have two fields, name and color. So I need to write the name and color background color.
the color is different from the name and may vary for the same name.
I need to check if the color codes of the cell 3 is X, then the background color is X.

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 6:11 am
by Alex K.
Hello,

Please send us a simple report with data for analisys.

Thank you.

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 8:20 am
by jpascual
I have a report with a sample.

how I Can upload the file to the forum?

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 8:21 am
by Alex K.
Hello,

After post you can click Attach and upload the file.

Thank you.

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 8:31 am
by jpascual
ok thanks, I attacht the file.

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 8:36 am
by Alex K.
Hello,

Also please, let us know how do you specify the color in the data source (string, number)?
Please show us a sample.

Thank you.

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 8:43 am
by jpascual
the color is a string, the color is in format ARGB. For example "-1" to white color. -256 to yellow.

the color is the field "color_cuadrante" in the datasource "turnos"

Coloring cells in a table by code

Posted: Tue Nov 09, 2010 9:14 am
by Alex K.
Hello,

You can change the previous sample

Code: Select all

public static System.Drawing.Color ARGBToColor(string ArgbColor)
{
	Color color = Color.Empty;
	color = Color.FromArgb(int.Parse(ArgbColor));
	return color;
}

Thank you.