Is it possible to export all TwwDataGrid objects including column images?
The functions wwDataGrid.ExportHtml(), wwDataGrid.ExportXML() and wwDataGrid.ExportSylk() exports only the data but I need an exact copy of the grid as it is displayed to the user.
It would be perfect if an ExportPDF() function is created :-)
This is not supported. However if you only have a single page of data, you could create a bitmap though of the grid with the following code which would capture the grid exactly as it is shown on the screen
var bitmap: TBitmap;
begin
bitmap:= wwdatagrid1.MakeScreenshot;
bitmap.SaveToFile('c:\users\roywoll\documents\test.bmp');
bitmap.free;
end;
You could even create multiple pages if you have more data by putting some logic to scroll the grid to the next page and then capturing the screenshot again.
Thanks for the tip but I need to export all the data.
I was able to export the data using TMS FlexCel. For this, I did the following:
1) I created a spreadsheet template (in runtime).
2) With FlexCel I generated a report using dataset data (connected to TwwDataGrid)
3) With FlexCel I exported the final spreadsheet in PDF or XLSx.
I suggest that in a future release you implement the ability to export all grid data in PDF (Including images).