Print Problems in Web Client

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Print Problems in Web Client

Postby nickbarnett » Thu Jul 16, 2009 5:42 pm

I thought I was an 'experienced newbie', but obviously not...

I have had a solution working on Safari and Firefox for a while now but IE is proving more of a challenge. My code below simply prints to PDF and opens in a separate window. However, in IE, a blank window appears then disappears. For the first execution, I get a message saying 'could not access the server'.

Code: Select all
function printOrderList()
{
   forms.order_list_print.controller.show();
   forms.order_list_print.controller.sort( 'company_id asc');
   forms.order_list_print.controller.print(false,false,plugins.pdf_output.getPDFPrinter());
   forms.company_form_main.controller.show();
}


There are definitely records to print and they reside in the current foundset. Pop-up blocker is switched off. I have tried controller.print and controller.printPreview without success. I am guessing there is a simple fix. Help !!!
nickbarnett
 
Posts: 58
Joined: Mon Aug 11, 2008 1:11 pm
Location: Bicester, Oxfordshire

Re: Print Problems in Web Client

Postby Jan Aleman » Mon Jul 20, 2009 8:11 pm

Less code is better:

Code: Select all
function printOrderList()
{
   forms.order_list_print.controller.sort( 'company_id asc');
   forms.order_list_print.controller.print();
}

note that in webclient you don't have to use plugins.pdf_output.getPDFPrinter() it does that automatically.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Re: Print Problems in Web Client

Postby nickbarnett » Tue Jul 21, 2009 11:47 am

I'm relieved in a way because that is the code I have been trying. It all seems to be fine in Firefox (Mac/PC) and Safari (Mac/PC), but any recent version of IE doesn't work.

When I execute the method, the web client shows 'loading' to say it is putting the document together,
Then it shows an empty pop-up window,
Then the pop-up window disappears within a second without rendering anything on it.

This has occurred on 5 different computers on 5 different networks, all on Windows using Internet Explorer v6+.
nickbarnett
 
Posts: 58
Joined: Mon Aug 11, 2008 1:11 pm
Location: Bicester, Oxfordshire

Re: Print Problems in Web Client

Postby nickbarnett » Tue Jul 21, 2009 12:35 pm

It seems that the Servoy web client is conflicting with Explorer...

I have turned the pop-up blocker off.
I have turned the pop-up blocker on but allowed it for my IP address.
I have turned the firewall off (temporarily!)
I have set my IP address as a trusted site.
I have turned the security level right down.
I have switched the Adobe PDF viewer add-on on and off.

Does anyone have any suggestions?
nickbarnett
 
Posts: 58
Joined: Mon Aug 11, 2008 1:11 pm
Location: Bicester, Oxfordshire

Re: Print Problems in Web Client

Postby Westy » Tue Jul 21, 2009 4:25 pm

nickbarnett wrote:...prints to PDF and opens in a separate window...

Why in a separate window?

We use the following with webclient. The "_self" opens the PDF in the same window, which avoids the problem you describe.

Code: Select all
var installdir = java.lang.System.getProperty("user.dir");
var rnd = Math.abs(Math.round(Math.random()* 99999));
var filename = rnd + '.pdf';
var filepath = installdir + '/server/webapps/ROOT/pdf/'+ filename;
forms.formname.controller.print( false,true,plugins.pdf_output.getPDFPrinter(filepath));
application.showURL('/pdf/' + filename, '_self');


Dean Westover
Choices Software, Inc.
Westy
 
Posts: 852
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA


Return to Web Development

Who is online

Users browsing this forum: No registered users and 11 guests

cron