OL Learn

Detail Table positioning

Hello everyone,

I am wondering if someone could help me with details table. I want to put on a portrait oriented page details table that is aligned vertically. And if I want it on certain position and if I set it as absolute then the whole table goes to the second page and exceeds the sheet and it does not overflow. When I set it as static, it overflows but it also exceeds the sheet. I added pics so you can see the issue. How can I
make it work as I want - to be vertical, to overflow on other pages and fit within margins!

It looks like you’re just rotating the table. Bear in mind that the table would first be generated down the page with pagination being set based on the physical dimensions of the page. Your rotation would take effect after that, leading to what you’re seeing.

You’ll have to set the section’s properties to be landscape on this one. If this is destined for PDF output and all of the pages must be in portrait orientation, it would be possible to rotate them in Workflow after Connect completes.

'Rotate only Landscape pages of PDF
option Explicit
'File System Object
dim objPDF, objPage, objPages, objPageSize, iCount, iDegrees, pageHeight, pageWidth

'Valid values: 0, 90, 180, 270
iDegrees  = 90

'Load current datafile
set objPDF = Watch.GetPDFEditObject()
objPDF.Open Watch.GetJobFilename(), false
set objPages = objPDF.Pages()

'loop through each page
for iCount = 0 to (objPages.Count()-1)
  'Determine if Page Dimensions
  set objPageSize = objPDF.Pages(iCount).Size()
  pageWidth = objPageSize.right - objPageSize.left
  pageHeight = objPageSize.top - objPageSize.Bottom

if pageWidth > pageHeight then
  'Change Orientation if Landscape 
  set objPage = objPDF.Pages().Item(iCount)
  objPage.Orientation = iDegrees
  watch.log "Page " & iCount+1 & " - Landscape Detected. Rotating...", 2
  else
   watch.log "Page " & iCount+1 & " - Portrait Detected. Continuing...", 2
end if
  set objPage = nothing
next

'close the PDF and save, replacing the current datafile
objPDF.Save(true)

Thank you for your reply. It was very helpful.

best regards
Ivan