Print each records on a new page
Hi !
My report has a TppDetailBand and a TppFooterBand only. On the
TppDetailBand, I have some elements and 3 TppSubReports.
Usually, when I will print this report, it will only have 1 record in the
database. Sometimes, there will be more records. With 1 record, everything
is fine, but what I want to do is when I print with many records, I want
each records to start on a new page.
Thanks !
My report has a TppDetailBand and a TppFooterBand only. On the
TppDetailBand, I have some elements and 3 TppSubReports.
Usually, when I will print this report, it will only have 1 record in the
database. Sometimes, there will be more records. With 1 record, everything
is fine, but what I want to do is when I print with many records, I want
each records to start on a new page.
Thanks !
This discussion has been closed.
Comments
Try creating a group around the datafield you want to start a new page on.
Then in the group dialog, be sure to check the "Start New Page" option or
set the TppGroup.NewPage property to True.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
For future reference, we prefer that our customers use their real name when
posting to a digital-metaphors newsgroup.
Groups can be created manually or dynamically in code. To manually create a
group, select the Report | Groups menu option in the Report Designer. The
group dialog will pop up and you can create a group from there around any
data or static field you want. For more information on manually creating
groups, please see the ReportBuilder Developer's Guide.
Groups can also be created in code...
----------------------------------------------------
Tech Tip: Creating a Group in Code
----------------------------------------------------
example code:
-------------
uses
ppClass, ppGroup, ppClasUt;
function AddGroupToReport(aBreakName: String; aDataPipeline:
TppDataPipeline; aReport: TppCustomReport);
var
lGroup: TppGroup;
lGroupBand: TppGroupBand;
begin
{add group to report}
lGroup := TppGroup(ppComponentCreate(aReport, TppGroup));
lGroup.Report := aReport;
lGroup.BreakName := aBreakName;
lGroup.DataPipeline := aDataPipeline;
{add group header and footer bands }
lGroupBand := TppGroupBand(ppComponentCreate(aReport,
TppGroupHeaderBand));
lGroupBand.Group := lGroup;
lGroupBand := TppGroupBand(ppComponentCreate(aReport,
TppGroupFooterBand));
lGroupBand.Group := lGroup;
end; {procedure, AddGroupToReport}
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I must be dumb but it dosen't work. I got my group. I put objects on it and
set the "start new page" option ON. Why it dosen't start a new page when the
group start each time !?
Thanks for your patience !
Take a look at Demo 16 in the \RBuilder\Demos\Reports\... directory.
(dm0016.pas). This demo gives a good example of how a group is supposed to
work. Also if you go into the groups dialog and set the Start New Page
option, you will see that each group starts a new page. If you still have
problems after seeing this, please send an example of your project to
support@digital-metaphors.com in .zip format and I'll take a look at it for
you.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com