Question “How do I display totals calculated inside a subreport in my main report?” Solution Delphi: Update the main report variables directly inside the OnCalc event of a variable inside your subreport. RAP: Declare a global TppVariable from the Module view inside the code workspace (RAP). Set the global variable equal to a TppVariable in Full Article…
Search the Wiki
How To…Count Distinct Records
Question “How do I count only the distinct records in my dataset using ReportBuilder?” Solution Keep track of the distinct records using a TStringList object. Download: CountDistinct.zip Sample Delphi code: procedure TForm1.FormCreate(Sender: TObject); begin FDistincts := TStringList.Create; end; procedure TForm1.FormDestroy(Sender: TObject); begin FDistincts.Free; end; procedure TForm1.ppReport1StartFirstPass(Sender: TObject); begin FDistincts.Clear; end; procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject); var liIndex: Full Article…
How To…Calculate the Current Print Position
Question “How do I calculate the current position of a component after it has been generated to a report?” Solution Use the OnDrawCommandCreate event of the component to get the current position on the page, then use the conversion utility functions in ppUtils.pas to convert the value into report units. Download: CalcPrintPosition.zip Sample Delphi code: Full Article…