On forms with tabless tab panels, is it possible to specify the tab which will appear in Print Preview/Print? In Servoy 2.2.5 I’ve tried selecting the tab with a method
elements.tabs_headers.tabIndex = x
but the first tab always displays regardless.
I’ve also tried this code to remove all the tabs apart from the one named in arg 1
i = 1
while (elements.tabs_headers.getMaxTabIndex() > 1)
{
if(elements.tabs_headers.getTabNameAt(i) != arguments[1])
{
elements.tabs_headers.removeTabAt(i)
}
else
{
i = 2
}
}
The tabs all return in Preview and tab 1 is the one that prints.
What I am trying to achieve is a single form with a different coversheet depending on the company, which prints in the Title Header part of the report. There’s an image and related data on the coversheet, and the layout is different for each. The subsequent pages have the same layout for all companies, so I’d prefer not to create a whole new form for each company.
Hi Antonio,
Create a table of companies if you don’t already have one. Create a form based on this table as a header and show this as a single related form in your tab panel…
Thanks Christian. I need a different form for each Company. The position of the displayed fields and logo are different on each form. How to display this, from the Companies table as you’ve suggested?
You can place the logo in the correct place by padding with whitespace.
You can move fields around suing scripts, but, they will not print in the correct location until Servoy 3.0 is relased… so you’re stuck for now.
Any idea with Servoy 3.0 will be live?
I found a tip in another thread which answers my question (thanks to HJK!)
I have a form ‘Headers’ with a tabless tab panel, and several tabs, one for each form I want to be able to display. I have a second form ‘InvoicesForPrintRun’ which has a tabless tabpanel in the Title Header. It has a single tab displaying the ‘Headers’ form.
I go to Headers and with a method to select the tab I want to display with
elements.tabs_70.tabIndex = x
then call
forms.InvoicesForPrintRun.controller.showPrintPreview()
and the correct form displays!
Is the printing of the front-most tab addressed in Servoy 3?