Search the Wiki

Viewing 281 to 315 of 409 items

Forcing Group Headers to Start on Odd Pages

Question: "I have a report that is printing duplexed and therefore I want to force the group headers to start on odd pages." Solution: Set the TppGroup.StartOnOddPage to True.  This option is also available in the Groups dialog in the report designer.
0

Forcing a Page Break

TECH TIP: Forcing a Page Break Question:  “How can I force a page break occur based upon a condition calculated at run-time.” The latest versions of ReportBuilder include a TppPageBreak component which may be placed anywhere inside a report and automatically force a page break.  This is the recommended method for forcing a page break  Full Article…

0

Duplex Printing Legalese to the Back of Every Page

TECH TIP:  Printing a Disclaimer on the Back of Every Page. Question: “I want to use duplexing to print some legalese on the back of every page of my report. How do I do this?” Answer:  This is fairly easy to do – basically, every odd numbered page will contain data, while every even numbered  Full Article…

0

How To…Standard Header/Footer

Question “How can I implement a standard header and footer for all of my reports? Solutions 1. When implementing form based reports, you can use Delphi’s form inheritance to create a base report layout Notes: Do not use inheritance for the DataPipelines, unless you set AutoCreateFields to False. Do not use Delphi form inheritance for  Full Article…

0

How To…Skip First X Labels

Question “How can I skip the first X number of labels on a sheet, so that my users can reuse label sheets?” Solution The following exmple shows how to use the DetailBand.BandsPerRecord to to skip X number of labels. Download: SkipLabels.zip Download: SkipLabelsLeftToRight.zip Sample Delphi code: procedure TForm1.btnPreviewClick(Sender: TObject); begin // get number of labels  Full Article…

0

How To…Repeat Labels

Question “How can I print X number of labels for each record?” Solution This example shows how to use the DetailBand.BandsPerRecord property to print X number of labels for each record. Download: RepeatLabels.zip Sample Delphi code: procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject); var liCount: Integer; begin {check BandsPerRecordCount, it resets to 1 when all bands for the prior  Full Article…

0

Adding Custom Labels to the Label Wizard

The ReportBuilder Label Wizard contains an extensible architecture that enables additional sets of labels to be created and registered. Creating new label sets is a very simple process. Open ppLabelDef.pas located in RBuilder\Source.This unit contains the TppLabelSet class which is the abstract ancestor class for all label sets. This class contains the necessary logic to  Full Article…

0

Suppress Group Footer When Only One Detail

When you are calculating totals in the group footer band, it is often useful to suppress the group footer band when only one detail band exists for the group.  This simplifies the format of the report, because it is unnecessary to repeat the same number twice (once in the detail band and once in the  Full Article…

0

How To…Keep Nested Groups Together

Question “The report engine seems to become occationally confused when I try to keep nested groups together.  How do I work around this?” Solution Separate your nested groups into subreports. -Main Report –Group 1 –Subreport 1 —Group 2 —Subreport 2 —-Group 3 etc… This will require you to rethink your data as you will now  Full Article…

0

How To…Group on First Letter

Question “How do I group on the first letter of a field?” Solution The easiest way to accomplish this is to taylor your original SQL code to your grouping needs.  If you add a field that only selects the first letter of another field, grouping on that field is very easy from ReportBuilder.  In most  Full Article…

0

How To…Display a Group Footer on Every Page

Question “How do I ensure that the group footer will display on every page of my report?” Solution This can be helpful if you need a page summary band, similar to the page footer band but snaps to the last detail band. Use the DetailBand.BeforePrint event to determine if the group will break before space  Full Article…

0

How To…Detect the Last Group Detail

Question “How do I detect the last detail printed in a group?” Solution Create a separate dataset that counts the values present for each group based on the grouping field.  You can then use this information to determine when the detail band has reached its final record for that group and you can make alterations  Full Article…

0

How To…Align Group Footer to Bottom

Question “How can I align the Group Footer to the bottom of the page?” Solution The following example uses the GrouppFooter.BeforePrint event to to align a static height group footer to the bottom of the page. Download: AlignGroupFooterToBottom.zip Sample Delphi code: procedure TForm1.ppGroupFooterBand1BeforePrint(Sender: TObject); var lPageBottom: Single; begin {Get the bottom of the page from the  Full Article…

0

How To…Write Checks Using ReportBuilder

Question “Is it possible to print pre-formatted checks using ReportBuilder?” Solution The following example uses a free Delphi library NumWords to convert numerical values into English text.  This allows you to convert a dollar amount to a text string for check writing purposes.  The full version of this library including other language translations is available  Full Article…

0

How To…Print Receipts

Question “How can use ReportBuilder to print receipts to a continous roll of paper?” Solution Receipts have a unique characteristic in that they typically print on a continuous roll of paper – there is no concept of page size. For continuous printing use title/summary bands and remove the header/footer. Size the detail band to print  Full Article…

0

Forms Emulation

Customers often ask how to include their pdf forms in ReportBuilder so they can do forms emulation like the tax form shown in one of the Developer’s Guide tutorials. The solution is convert the PDF to a metafile (WMF/EMF). A high quality metafile will contain a list of Windows GDI commands required to render the form to  Full Article…

0

How To…Start a Left to Right Column on a New Row

Question “How can I force each group to start at the beginning of a new row when using left-to-right columns?” Solution Inside the GroupFooter.AfterGenerate event, set the TppEngine.CurrentColumn property to -1. This will force the next column printed to be the 0 (first) position. Download: StartLeftToRightColumnOnNewRow.zip Sample Delphi code: procedure TForm1.ppGroupFooterBand1AfterGenerate(Sender: TObject); begin ppReport.Engine.CurrentColumn :=  Full Article…

0

How To…Prevent an Orphaned Summary Band

Question “The summary band of my report displays alone on the last page of my report. Is there a way to move the last detail band to the next page to prevent this behavior?” Solution This can be done by measuring the amount of space the last detail plus the summary band take on the  Full Article…

0

How To…Fille Line With Dots

Question “How can I format each line with something like ‘Value…..’ such that ‘.’ characters are used to fill the remaining space?” Solution This example shows how to Use a Variable and its OnCalc event to append the appropriate number of ‘.’to each line. Download: FillLineWithDots.zip Sample Delphi code: uses ppTypes, ppUtils; procedure TForm1.ppVariable1Calc(Sender: TObject;  Full Article…

0

How To…Fill Space After the Last Column

Question “Once my columns have finished printing on a page, how can I fill the remaining space to the bottom of the page?” Solution Use a group footer band to fill the space.  Inside the GroopFooterBand.BeforePrint event, check the remaining space on the page and resize the band to match that size. Download: FillSpaceAfterLastColumn.zip Sample  Full Article…

0

How To…Create Header and Footer Columns

Question “How can I create a header column (to the left) and a footer column (to the right) of my column data?” Solution Use the group header and group footer bands as the header and footer columns.  Place a region in each band and size them to roughly the length of the page.  These will  Full Article…

0

How To…Create Conditional Columns

Question “How can I show multiple columns in certain cases, then revert back to a single column in other cases in the same report?” Solution Use x number of child subreports to act as each column, and a single full width subreport to act as the single column.  Then toggle the visibility of each subreport  Full Article…

0

How To…Align the Group Footer for Every Column

Question “How do I line up the group footer bands when using multiple columns and the amount of records in each group is different?” Solution This can be done by copying the draw commands in the existing group footers then moving them to the proper position on the page lined up with the lowest group  Full Article…

0

How To…Align Memo Bottoms

Question “How can I align the bottoms of two stretching memos?” Solution This example contains a report with two stretching Memos inside a Region. Region.KeepTogether is set to True. The Memo OnDrawCommandCreate event is used to obtain a reference to the DrawCommand object that is created each time the object generates on the page. The Detail  Full Article…

0

Displaying Boolean Field Values

Formatting boolean data fields with ReportBuilder can be performed using either of the following techniques: Specify a value for the TppDBText.DisplayFormat property. Example: DBText1.DisplayFormat := ‘True;False’; Specify a value for the TField.DisplayValues property of the dataset. Example: TField1.DisplayValues := ‘Yes;No;’ Note: If you have TField.DisplayValues assigned, please do not assign DBText.DisplayFormat.

0

Currency Formatting

Currently when formatting currency display formats, ReportBuilder internally calls FloatToStrF with a ffCurrency paramter. This honors the Windows currency settings. There are two ways to override this behavior: Create a Descendant of TppDisplayFormat See ppDisplayFormat.pas. You can easily create a descendant of TppDisplayFormat and specify that your TmyDisplayFormat be used by ReportBuilder to perform formatting.  Full Article…

0

How To…Change the existing display formats

Question “How do I change the current display formats provided with ReportBuilder (or add new display formats)?” Solution The built-in display formats are defined in the GetDisplayFormats routine of the TppDisplayFormat class inside the ppDisplayFormat.pas file. Descending from this class gives you the opportunity to replace these values as well as customize the way ReportBuilder  Full Article…

0

Toolbars

The various toolbars accessible from the design workspace are documented in this section. The toolbars are dockable and follow the Office97 interface style. The Toolbars are accessible from the View | Toolbars menu option of the Report Designer or by right-clicking on the docking area at the top of the Report Designer. The Report Tree  Full Article…

0

Subreports

In traditional banded-style report writers, reports that can be printed from a single source of data are quite easy to create. But if the content of the report consists of information from several different sources of data, the choices become quite limited. One option is to use SQL to join the data together into one  Full Article…

0

Smart Layouts

ReportBuilder allows you to create highly dynamic report layouts. The SubReport, Memo, RichText, and Region components have the ability to expand or contract to accommodate the information they contain. There are a host of properties designed to keep your reports looking good in the variety of situations created by these dynamic components.    Property Description   Full Article…

0

Report Wizard

The Report Wizard is one of the many parts of ReportBuilder that reflects a level of professionalism and attention to detail found in no other reporting product. If you or your end-users have utilized standard Windows wizards in other products, then you will be able to quickly recognize and use the ReportBuilder Report Wizard. The  Full Article…

0

Form Emulation

Form Emulation is the process of taking a paper-based or electronic form and rendering a likeness of it. The likeness may include formatting of the form itself, or may only contain the data which will ‘fill-out’ the form. There are two basic issues that a form emulation solution must resolve: How will the formatting of  Full Article…

0

Drag and Drop Support

ReportBuilder contains a Report Wizard that allows you to quickly create an entire report layout. This is great for generating an entire report, but what if you need to create only a portion of a complex report? Drag and drop functionality is an ideal solution for this problem because it allows you to create a  Full Article…

0

How To…Create a Crosstab via Code

Question “How can I create and configure a crosstab using code?” Solution The following example adds a crosstab to the detail band and defines row, column, and value dimensions. Download: CreateCrosstabViaCode.zip uses ppClass, daDataModule, ppReport, ppCTMain; procedure TForm1.CreateCrosstabInCode(aReport: TppReport); var lCrossTab: TppCrossTab; liRowDimension: Integer; liValueDimension: Integer; begin // create crosstab and place in the detail  Full Article…

0