Home Datapipelines

Limiting a TeeChart to a Single Record

I am writing an invoicing program that runs through hundreds of invoices each month. Each invoice presents a visual indication of the project budget (the TeeDBChart). I struggled with the issue of limiting a TeeDBChart within a Report to the current record only. Here is my solution.

Set up a memory-based table (e.g., FDMemTable) to hold the data you want to chart. Link each series to the Fields within this table. On the report's DBPipeline, use the OnDataChange event to write the contents to the memory-based table. You need to empty the memory-based table first so that it will only contain one record at a time. In my case, I needed three financial items for a stacked bar chart.

Example of the ppDBPipelineReportQuery.OnDataChange event I used the following code:

FDMemTableMyChart.TotalBudget.Value := dm.ReportQueryTotalBudget.Value;
FDMemTableMyChart.TotalSpent.Value := dm.ReportQueryTotalSpent.Value;
FDMemTableMyChart.CurrentInvoice.Value := dm.ReportQueryTotal.Value + dm.ReportQueryTotalSpent.Value;
Sign In or Register to comment.