Before report generate, I want to add a group in the report depend on user's preference. But the help file for TppCustomReport.AddGroup states "Do not call this method." . So how can I to do so??
There is no need to call this method. Once you have created your group in code, you will need to assign the TppGroup.Report property to the current report. Once you do this, the group will be added to the defined report without the need to call AddGroup.
Comments
There is no need to call this method. Once you have created your group in
code, you will need to assign the TppGroup.Report property to the current
report. Once you do this, the group will be added to the defined report
without the need to call AddGroup.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Would you mind giving me how to create group in code rather than in
designer??
Hope this helps.
----------------------------------------------------
Tech Tip: Creating a Group in Code
----------------------------------------------------
How can I dynamically create a report group at run-time?
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