Printing

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Printing

Postby cdid » Wed Jul 26, 2006 12:08 am

How to cancel the event I dont want the print dialog
THanks

----------------------------------
Code:
<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
if (nAction == PRINT_MSG_END)
{
alert("User has printed the document.\nMoving now to final web page.");
document.URL = "final.htm";
}
</SCRIPT>
cdid
 
Posts: 14
Joined: Wed Jan 18, 2006 9:19 pm

Postby IDEAL Software Support » Wed Jul 26, 2006 4:06 pm

PLEASE read the manuals.

Set bCancel = true

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Printing

Postby cdid » Wed Jul 26, 2006 6:10 pm

It doesn't work....


I try:


<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
bCancel = true;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
bCancel = false;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
bCancel = 1;
</SCRIPT>


<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
bCancel = 0;
</SCRIPT>


<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
return true;
</SCRIPT>


<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
return false;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
return 1;
</SCRIPT>




<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
return 0;
</SCRIPT>



<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
this.cancelBubble = true;
</SCRIPT>


Any ideas???
I found nothing in the manual about Javascript Programmation...
cdid
 
Posts: 14
Joined: Wed Jan 18, 2006 9:19 pm

Postby IDEAL Software Support » Thu Jul 27, 2006 7:33 am

Are you sure your event handler is called?

Regards
T. Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

printing

Postby cdid » Thu Jul 27, 2006 6:44 pm

yes..

This code works:

<SCRIPT LANGUAGE=JavaScript FOR=VpeControl EVENT="RequestPrint(nAction, bCancel)">
alert('test');
</SCRIPT>

But I can cancel de dialog window....
cdid
 
Posts: 14
Joined: Wed Jan 18, 2006 9:19 pm

Postby IDEAL Software Support » Fri Jul 28, 2006 12:52 pm

I read the following in the comments of our Internet Demo (VpeCtrl.htm):

"With JavaScript and VBScript and Internet Explorer, return values of VPE Events are not handled (other browsers not tested). So you can set ResultingAction in the Event RequestPrint(), but the value of ResultingAction is not returned to VPE. This is a problem of the JavaScript and VBScript implementation in Internet Explorer."

Please excuse me, but I didn't have that in mind.

But using the ActiveX technology in web-pages is a very old idea from about 1999, created by Microsoft. In our days, taking into consideration that there are many platforms (Windows, Mac OS, Linux) and many different browsers, it is not a recommended way to use the ActiveX in web-pages. We rather recommend to generate PDF files on the web server and to send these PDF files to the client browser. This guarantees platform independence and higher security on the client side (no need to allow the execution of ActiveX components in the browser).

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 63 guests

cron