Printing Certain Tab of Tabpanel without Dialog/Preview

Questions, tips and tricks and techniques for scripting in Servoy

Printing Certain Tab of Tabpanel without Dialog/Preview

Postby ellenmeserow » Tue Jun 27, 2006 7:06 pm

I have a complicated formindialog that I need to print. The formindialog contains two tabpanels that need to remain selected as they are when the user hits print. Printing it closes the formindialog if I use any preview at all, and any dialog box seems to clear the area of the window where the dialog was and never redraw it. That's not OK -- plus I need to have it print a print-formatted dup of the form itself. So I'm using the below code to switch forms and print without preview or dialog, merely informing the user that it worked by changing the button text:

Code: Select all
elements.ButtonPrint.text = "Printing..."
//forms.CalculatorPRINTABLE.controller.showPrintPreview(true)
application.updateUI()
var tab = elements.Milestones.tabIndex
forms.CalculatorPRINTABLE.elements.Milestones.tabIndex = tab
application.updateUI()
forms.CalculatorPRINTABLE.controller.print(true,false,false)
elements.ButtonPrint.text = "Print"


But it's not selecting the right tabpanel to print. It always goes to 1, though the variable above is being correctly set to 3 according to debugger. These are the correct element names, no typos or obvious errors. Help? i assume it's because the form is not being shown? But I can't for the above reasons...
ellenmeserow
 
Posts: 366
Joined: Sat Aug 07, 2004 10:18 pm
Location: Seattle, WA USA

OK, more info

Postby ellenmeserow » Thu Jun 29, 2006 11:56 pm

This apparently has zero to do with most of the detail i supplied above -- apparently you can't print a secondary tabpanel in Servoy without going to that form itself. This doesn't work for me, so I'm currently working on a way to remove the tabs that I don't want to print so that it has only one tab to choose from, and will therefore print it. However, as far as I can tell all I can do is add back relationsless tab panels -- which most of mine are, but not all, so I'm a bit stumped there. Any ideas?
ellenmeserow
 
Posts: 366
Joined: Sat Aug 07, 2004 10:18 pm
Location: Seattle, WA USA

Postby antonio » Sun Sep 24, 2006 7:10 am

Did you ever crack this one? I want to hide certain tabpanels in a footer before printing, can't get it to work. The code looks good, but the panels still show in preview.
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Postby tweetie » Fri Mar 02, 2007 3:05 pm

It seems that I have this problem too...has it been solved? Or are we doing sumthing wrong.

I have a form(recordview) with a tabpanel with 2 tabs(also recordviews). Depending on certain values I need tab1 or tab2 printed.
Code: Select all
if(mv_id==3){
   elements.tabs_70.tabIndex = 1;
} else {
   elements.tabs_70.tabIndex = 2;
}
But it always prints tab1 no matter what.

Servoy Developer
Version R2 2.2.7-build 339
Java version 1.5.0_11-b03 (Windows 2003)
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Re: Printing Certain Tab of Tabpanel without Dialog/Preview

Postby lhale » Thu May 14, 2009 2:31 pm

I have the same problem. I want to print the active tab within a tab panel. When I print it only prints the first tab. Is there a fix for this or what.
lhale
 
Posts: 108
Joined: Mon Mar 17, 2008 3:49 pm

Re: Printing Certain Tab of Tabpanel without Dialog/Preview

Postby robysimo09 » Mon Jun 13, 2011 3:03 pm

Hello

Is there a fix for this?
I use 5.2.7.

Thank you
Bye
Roberto
robysimo09
 
Posts: 108
Joined: Fri Sep 04, 2009 9:06 am

Re: Printing Certain Tab of Tabpanel without Dialog/Preview

Postby robysimo09 » Mon Jun 13, 2011 4:36 pm

Sorry. Work

Bye
Roberto
robysimo09
 
Posts: 108
Joined: Fri Sep 04, 2009 9:06 am


Return to Methods

Who is online

Users browsing this forum: No registered users and 7 guests