Insert a page break at runtime
Posted: Mon Jun 01, 2009 11:04 am
Hello,
I have to merge some rtf for a report. On the first page i want the name of the report a page break and on the following pages : file1.rtf, file2. rft....
I test this code with a TSRichViewEdit
myRtf.RichViewEdit.Clear;
myRtf.RichViewEdit.AddNL('My reportName', 0, 0);
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file1.rtf');
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file2.rtf');
myRTF.Format
And i have an error on the first myRtf.RichViewEdit.InsertBreakPage (EListError : indice out of bound (-1)
If i change the code like that :
myRTF.RichViewEdit.InsertText(chr(13));
myRtf.RichViewEdit.AddNL('My reportName', 0, 0);
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file1.rtf');
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file2.rtf');
myRTF.Format
I have a blank page, a page break and on the second page 'My reportname' and then file1.rtf etc
I test the trial version of TSRichviewEdit 2.0.3
Where is my error ?
Thank's in advance
I have to merge some rtf for a report. On the first page i want the name of the report a page break and on the following pages : file1.rtf, file2. rft....
I test this code with a TSRichViewEdit
myRtf.RichViewEdit.Clear;
myRtf.RichViewEdit.AddNL('My reportName', 0, 0);
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file1.rtf');
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file2.rtf');
myRTF.Format
And i have an error on the first myRtf.RichViewEdit.InsertBreakPage (EListError : indice out of bound (-1)
If i change the code like that :
myRTF.RichViewEdit.InsertText(chr(13));
myRtf.RichViewEdit.AddNL('My reportName', 0, 0);
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file1.rtf');
myRtf.RichViewEdit.InsertBreakPage;
myRTF.RichViewEdit.LoadRTF('file2.rtf');
myRTF.Format
I have a blank page, a page break and on the second page 'My reportname' and then file1.rtf etc
I test the trial version of TSRichviewEdit 2.0.3
Where is my error ?
Thank's in advance