>I've a grid in which the user can select a color (GetColor()) and the row is then colored with that color (using DynamicBackColor). The color is also stored in a field of the cursor underlying the grid.
>I've the need to print a report (Set ReportBehavior 80) with the colors as displayed in the grid.
>
>How can I obtain the result?
>
>TIA
You actually can, but it needs a slight hack at the .frx report file...
Create the report with a rectangle for the background you want, size it where you need, etc. Double click the control and put something unique in the "COMMENT" property of the control to refer back to. Something like "CHANGE THIS BACK COLOR". Make sure the sample rectangle shape has showing SOMETHING as a backcolor even if its defaulted to a light grey so you know the shading is properly set and not in a transparent vs opaque vs no fill mode...
Then, in the process before actually building the report, build a new temp copy of the report something like
select * from (yourReport.frx) into table c:\Temp\MyTestReportCopy.frx
use in select( "YourReport" )
use c:\Temp\MyTestReportCopy.frx
replace FillRed with (redcolor.fromgrid),;
FillGreen with (greencolor.fromgrid),;
FillBlue with (bluecolor.fromgrid);
for atc( "CHANGE THIS BACK COLOR", Comment ) > 0
use
report form c:\Temp\MyTestReportCopy.frx preview / or to print / etc...