Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing from the webbrowser control
Message
From
25/11/2010 13:01:37
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
25/11/2010 12:24:26
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01489859
Message ID:
01490498
Views:
54
>>I'm trying to print from the webbrowser control that is hosted in a VFP9 form. I'd found that I can issue the following command to print the content that is rendered in the control:
>>
>>THISFORM.oWb.execWB(7, 0)
>>
>>where oWb is the webbrowser control.
>>
>>Well it *almost* works. Here's my issue - if I generate all my content into a local html file and I navigate to it then print it using the command above, all is ok. If, however, I first navigate to a "shell" html file that contains several empty divs into which I then "inject" content, it does not print anything although the content looks fine on my screen!
>>
>>My question is, does the webbrowser control need to have all content in the physical html file before it can print it? As I said, the page looks fine on my computer screen (with content injected into the divs that are the only "real" items in the html file). It just doesn't print the content. If I were to write out the body's innerhtml to a local html file prior to calling the print command, it's seem to work ok. I was hoping to avoid this last step though.
>Hi
>
>
>#DEFINE OLECMDID_PRINT 6
>#DEFINE OLECMDEXECOPT_PROMPTUSER 1
>#DEFINE OLECMDEXECOPT_DONTPROMPTUSER 2
>ThisForm.webbrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)
>
>
>HTH

Hi Claudio,

I'm not sure what you've suggested is enough of a difference from what I'm already doing to produce the outcome I need. Seems that the only thing different is that I'm previewing (which is what I want) vs sending it to the printer. I'll give it a try anyway.

Thanks,
Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform