Page 1 of 1

[ReportWorkshop][Demo] Using data from TListView

Posted: Thu Jun 14, 2018 4:16 pm
by Sergey Tkachenko
Typically, Report Workshop uses data from databases, and many data provider components are included for different databases.
But reports are not necessary linked to databases.

This demo shows how to get data from TListView:
ListViewReport.zip
(4.91 KiB) Downloaded 4893 times
It does not use any database, all data are taken from TListView controls.
It does not use dataprovider components, instead, it uses TRVReportGenerator.OnCreateQueryProcessor event.
In your application, you can use both a data provider component and this event, thus using data both from TListViews and from databases.
This demo uses names of TListView controls as data queries.

Report template (generated in code):
ListView-Report-Template.png
ListView-Report-Template.png (16.21 KiB) Viewed 77388 times
Result:
ListView-Report-Result.png
ListView-Report-Result.png (21.73 KiB) Viewed 77388 times
This demo includes RVReportListViewQueryProcessor.pas containing TRVReportListViewQueryProcessor. It allows using data from TListView in reports.
It is very simple, so you can use it as a base for your query processors (for example, getting data from TStringGrid, TStringList, or arrays).
If you need help or additional examples, let me know.