I need to create a document consisting of some header text, then the output of two reports generated from Oracle ReportBuilder (RB) . I am currently using a Writer master document for this, but seeing the same behavior with simple document importing the same subdocuments. I can load the two subdocuments successfully with silent update to refresh content. My problem is the tables generated in RB have 'break before' textflow attribute, so there is a page break before each subdocument; cannot find anyway to change this in RB. I want to change the tables BreakType to NONE.
The code below tries to do this, but does not seem to be working as the final document still has the page breaks. I have tried a number of approaches without success. Using debugger, I have verified the list/order of tables to confirm the correct objects are used. In fact, if I assign breaktype value other than NONE, Writer does show change in textflow.
Note using Writer interactively, I can easily change the document to remove the page break in the Table properties textflow tab, but need this automated via macro. Any suggestions?
Code: Select all
'Routine to repair text flow post merge
Sub PostMergeRepair()
Dim odReport, oController, oTables, oTable
'Create objects of required type
Set odReport = createunoservice("com.sun.star.text.TextDocument")
Set oTables = createunoservice("com.sun.star.text.TextTables")
Set oTable = createunoservice("com.sun.star.text.TextTable")
'MASTER document with two subdocuments
Set odReport = ThisComponent
Set oTables = odReport.getTextTables()
'Set textflow on ingested subdocuments
Set oTable = odReport.getTextTables().getByIndex(0)
oTable.BreakType = com.sun.star.style.BreakType.NONE
Set oTable = odReport.getTextTables().getByIndex(1)
oTable.BreakType = com.sun.star.style.BreakType.NONE
End Sub