| ||||||||
Simple reportBefore creating any report, place TfrDBDataset or TfrUserDataset component on Delphi form. You must have as many TfrxxxDataset components as much data bands in your report, and link it to Delphi's TDataSource->TDataset components (if you dealing with DB data). This is a simplest kind of report. For creating it, you should place "Master data" band on the page, then place objects with appropriate data on it: You also should connect "Master data" band to appropriate dataset (TfrDBDataset or TfrUserDataset components). Example of this and other reports you can see in demo. Master-Detail reportFor creating this report, place "Master data" and "Detail data" bands on the page, then place objects with appropriate data on these bands. Does not matter, in which order you place bands on the page - "Master data" band will be printed first. If appropriate detail list is empty, master record will be skipped. If you don't want this, turn on the option "Print if detail empty" of "Master data" band. You can print new master data on new page - just turn on "Start new page" option of the band. Master-Detail-Subdetail reportFor creating this report, place "Master data", "Detail data" and "Subdetail data" bands on the page, then place objects with appropriate data on these bands. All principles are like to the Master-Detail report. Cross-tab reportThis report is intended for printing table with variable number of columns. During report building, all off-bounds columns will be printed on new page (like in MS Excel). For creating this report, place "Master data" and "Cross data" bands on the page. Place object in the cross of these bands. This object will be printed as the cell of cross-table. That's all! If you want, place "Cross header" and "Cross footer" bands in your report. "Cross footer" band is usable if you want to print sum of data in the row. "Cross header" band can prints on each page, if it has "Print on all pages" option. Report with variable row heightHeight of data row may be variable in some reports. Example of this - bill, with long goods names. FR can print these reports. If band has variable height, you should turn on the "Stretched" option of the band. You also should turn on this option for all stretched objects in the band. If calculated height of band smaller than its initial height, nothing happens. Otherwise, objects with this option will be stretched - its bottoms will be stretched to band bottom. Report with multiple data rowsFR don't allow you to place two identical bands on the page. Except of this - you can place many data-bands (master data, detail data, subdetail data) and their headers & footers on the page. During report building, identical bands prints together. This allows you to create reports with data row consist of several identical data-bands (each of these bands can be of variable height). If entire data row exceeds the bottom of page, it prints at the next page. All written is right, if top data band has data source, and other don't have. Otherwise, we get case of Master-detail-detail report. Multicolumn reportJust set number of columns in "Page options" dialog in designer. Multipage reportFR can print reports consisting of several pages, e.g. title page and others. For adding and removing page, use toolbar buttons or menu of designer. If you want to print several multipage reports (each report for each data record in some dataset), set TfrReport.ReportType property to rtMultiple, and assign appropriate dataset (TfrxxxDataset) to TfrReport.Dataset property. SubreportNested report is report with "Subreport" object placed in it. "Subreport" object is reference to the other report, placed in other page. During report building, on the place of "Subreport" object appropriate report will be printed. Subreport objects can be placed side-by-side. If you want place subreport objects one-under-other, spread it on separate data-bands. There is some limitation of using subreports:
Master-Detail-Detail reportFor creating this report, place "Master data" and two "Detail data" bands on the page. Link all bands to the appropriate datasets. You can also create "Master-Detail-Detail-Detail", "Master-Master", "Master-Detail-SubDetail-SubDetail" reports etc. Composite reportComposite report is report included several other reports. For creating composite report, you should use TfrCompositeReport object. Place it on the form and fill its "Reports" property in run-time by references to the other reports. Reports will be printed sequentially. If page of report have "Print to previous page" option, it will be printed at remained space at the last page of previous report. Report with breaked bandsLet's create simple report. It will contain two fields: first, named "Program", and second, named "Description". If we take a look on the created report, we see that page surface used not fully - there is a lot of empty space at the bottom of page. In our case we want to carry long memos onto the next page. This will be done, if "Breaked" option of the band is set. Report without bandsIf you want print a free-form report, containing data from only one record, you can don't use bands. All the objects placed directly on page, will be printed at their places. Report with groupsGroups used for grouping data by some criteria. You can use any FR expression as group condition (usually used expression based on DB fields). When this expression changes, FR forms new group. For creating this report, place "Group header" and "Master data" bands on the page. Assign appropriate dataset to "Master data" band. In editor of "Group header" band type grouping expression. For example, to print customers list grouped on first letter of customer name, type the following expression: Copy([CustomerName], 1, 1), where [CustomerName] is reference to appropriate DB field. Note: dataset used for "Master data" band should be sorted on grouping condition. You can do this by using queries with ORDER BY statement. There is some limitations of using groups:
will be printed as Prev Next === Documentation is provided by Word2Help === |
||||||||