Class TWPSuperMerge
Hierarchy
System.TObject | System.Classes.TPersistent | System.Classes.TComponent | WPRTEEdit.TWPAbstractSuperMerge | TWPSuperMerge
Description
It controls the creation of a new text using a report template and information aquired through different events. Please see the PDF manual for more information.
To work with it you need in Form.OnCreate SuperMerge.SetSourceDest(EditorIn.RTFData, EditorOut.RTFData);
If you need to copy section breaks use the flag wpAllowSectionStartInHeaderFooterBands in Options.
To preserve number- and paragraph styles the input and output should use the same RTFProps object.
You need a global variable FAllProps: TWPRTFProps
which is assigned in the event used by both TWPRichText. In Form.OnDestroy the FAllProps has to be freed.
procedure TForm1.EditorInitializeRTFDataObject(Sender: TObject;
var RTFDataObject: TWPRTFDataCollection; var FAllProps: TWPRTFProps);
begin
if FAllProps=nil then
FAllProps := TWPRTFProps.Create;
RTFPropsObject := FAllProps;
end;
Properties
Methods
Function AddBand(style:TWPMrgStyle; PlusParagraph:Boolean; InsideGroup:TThreeState) : TParagraph
Function AddGroup(mode:TWPMrgGroupCreate; CreateEmptyPar:Boolean) : TParagraph
Function AddGroupTest(mode:TWPMrgGroupCreate) : Boolean
Procedure AddMissingHeaderFooter(RTFData:TWPRTFDataCollection)
Function AddReportGroup(AliasName:string; Mode:TWPAddReportGroupMode; FieldList:TStrings; CallBack:TWPTableAddCellEvent; RowCount:Integer) : TParagraph
Function ConvertLetterIntoTemplate : TParagraph
Function ConvertTableIntoGroup(tablepar:TParagraph) : TParagraph
Function DeleteActive : Boolean
Procedure DoCALCObjectPaintEvent(Params:TWPExTextObjectPaintCalcEventParams)
Function Execute(InitPage:Boolean) : Boolean
Procedure ExportChildPars(ParentPar:TParagraph)
Procedure ExportParagraph(StartPar:TParagraph; Mode:TWPExportParagraphModes)
Function ExportText(Text:string; Mode:TWPRepExportTextModes; CharAttrIndex:Cardinal) : TParagraph
Function FindBand(Style:TWPMrgStyle; ShowOpt:TWPMergeShowOptions; stargrouppar:TParagraph) : TParagraph
Function FindGroup(GroupAliasName:string) : TParagraph
Function FindGroupFromPath(GroupAliasPath:string) : TParagraph
Function GetDestination : TWPRTFDataCollectionBase
Function GetEditor : TWPCustomRTFControl
Function GetPathStr(par:TParagraph) : string
Function GetSource : TWPRTFDataCollectionBase
Function InsertParAtrEndOfGroup : TParagraph
Function InsideGroup(GroupAliasName:string) : Boolean
Procedure PagebreakAfterThisGroup
Function Pop : TWPTextCombineStack
Function Push(clean_new_group:Boolean) : TWPTextCombineStack
Function ReadVariable(fname:string) : WideString
Procedure SetDestination(x:TWPRTFDataCollectionBase)
Procedure SetSource(x:TWPRTFDataCollectionBase)
Procedure SetSourceDest(aSource:TWPRTFDataCollectionBase; aDest:TWPRTFDataCollectionBase)
Events
AfterCopyParagraph : TWPAfterCopyParagraph= TWPAfterCopyParagraph
AfterProcessGroup : TWPAfterProcessGroupDataEvent= TWPAfterProcessGroupDataEvent
AfterProcessGroupData : TWPAfterProcessGroupDataEvent= TWPAfterProcessGroupDataEvent
BeforeProcessGroup : TWPBeforeProcessGroupEvent= TWPBeforeProcessGroupEvent
OnEnterBand : TNotifyEvent= procedure (Sender : TObject) of Object
Example:
procedure TWPRepForm.WPSuperMerge1EnterBand(Sender: TObject);
var band : TWPBand;
begin
band := WPGetBandForPar(SourceText.ActiveParagraph);
Caption := 'Enter Band ' + band.Alias;
end;
procedure TWPRepForm.WPSuperMerge1LeaveBand(Sender: TObject);
var band : TWPBand;
begin
band := WPGetBandForPar(SourceText.ActiveParagraph);
Caption := 'Leave Band ' + band.Alias;
end;