How to print a stringgrid (incl. formating)?
I want to print a TStringGrid - and I want the output to look like the stringgrid. The columns in the print should have the same width as the columns in the stringgrid. The colours should be the same and the font should be the same and so on.
Can someone give me a hint on how I could do that??
Any response is most welcome.
Regards,
Mikael
Can someone give me a hint on how I could do that??
Any response is most welcome.
Regards,
Mikael
Comments
I don't think that FR can do this. I guess you need a Stringgrid which has a print-component. I think DevExpress with its XtraGrid has such a component.
hth
Sascha
Perhaps FR is not able to print a stringgrid with formating automatically, but I can not believe that is in not possbile to do it somehow.
If we take a look at the PrintStringGrid demo, I wonder if it is possible
to modify the Cross variable, so that I can change properties of
a cell - and thereby make the print look like a stringgrid
I am a complete newbie to FR, so any help is most welcome.
Regards,
Mikael
Regards,
Mikael
It is very resource-hungry, but also the best-looking one.
You can paint your string grid to a custom bitmap (see PaintTo method), then either paste it to the database or use one of those in-memory TDataSet inheritors (for example, RxMemoryData).
Here is what I plan to do:
1. Have an empty fastreport component on my form.
2. Design the report by code. Something like this:
3. Use report???s OnBeforePrint event to populate the report with data. Something like this: