I am using this to remove page breaks from my DBRVE, but it does not remove them from tables. How can I modify this code to also remove page breaks in tables.
for I := 0 to DBRVE.ItemCount-1 do
begin
if DBRVE.PageBreaksBeforeItems[I] then
begin
DBRVE.SetSelectionBounds(I, DBRVE.GetOffsBeforeItem(I), I, DBRVE.GetOffsBeforeItem(I));
DBRVE.RemoveCurrentPageBreak;
end;
end;
All of my documents are created in Word and then imported using RVActions. I cannot tell you if the page breaks exist in the Word doc, I'll have to check, but they are there after the import process in the RVE.
I have to manually go to each cell that has a page break and manually delete them. I was hoping I could automate the process somehow.
procedure RemoveAllPageBreaks(RVData: TCustomRVData; RVE: TCustomRichViewEdit);
var i, r, c: Integer;
Table: TRVTableItemInfo;
begin
for i := 0 to RVData.ItemCount-1 do begin
if RVData.PageBreaksBeforeItems[I] then begin
RVData := RVData.Edit;
TCustomRVFormattedData(RVData).SetSelectionBounds(i, RVData.GetOffsBeforeItem(i), i, RVData.GetOffsBeforeItem(i));
RVE.TopLevelEditor.RemoveCurrentPageBreak;
end;
if RVData.GetItemStyle(i)=rvsTable then begin
Table := TRVTableItemInfo(RVData.GetItem(i));
for r := 0 to Table.RowCount-1 do
for c := 0 to Table.ColCount-1 do
if Table.Cells[r,c]<>nil then
RemoveAllPageBreaks(Table.Cells[r,c].GetRVData, RVE);
end;
end;
end;
// call
RemoveAllPageBreaks(DBRVE.RVData, DBRVE);