First question : Is it possible to use a StringGrid as a datasource in LazReport? I ask because I have a program that has several tabs, and in each are several stringgrids. I don't have a database, and all the documentation and demos seem to show use of LazReport only with databases. If it is possbile to import StringGrid content into a LazReport, could anyone guide me?
Second question : Assuming that the answer to question 1 is no, it is not possible, then I gather it is possible to use a temporary memory resident database structure using TMemDataset from the Data Access tab (as Laksen pointed out to me in IRC). So I could have a button that, when pressed, loads the content of the stringgrids into the database which is then used as the partner object of LazReport. However, I'm not entirely clear on how that works either? What would be the method of loading all the rows and column of one or more stringgrids into a MemDataSet? This demo is useful but I imagine applying that to a stringgrid with 10 columns and say a thousand rows might be confusing (
http://www.pp4s.co.uk/main/tu-db-memdataset.html).
Also very comprehensive is
http://wiki.freepascal.org/How_to_write_in-memory_database_applications_in_Lazarus/FPC but again, no mention of StringGrid.
As it stands, I am thinking that a method is :
1) Use sg.savetocsvfile('output.csv')
2) Use MemDataSet.LoadFromCSV('output.csv') to load the saved stringgrid content to the data set
3) Use the MemDataSet for the LazReport linking
4) Generate the Report
But this seem like rather a lot of input\output when the data is already in the StringGrid and I just want to export it to a report using LazReport
Thanks for any guidance