Search the Wiki

Viewing 379 to 381 of 409 items

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…

0

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…

0

How To…Calc a Dynamic Detail Height

Question “How do I calculate the height of each dynamic detail band’s height as the report is generating?” Solution Use the DetailBand.BeforeGenerate to find the top of each band and the DetailBand.AfterPrint event to find the bottom and calculate the height.  Do this during the first pass of the report to find each height before  Full Article…

0