473,569 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preventing date, page no, file path getting printed in web browser control

Hi All,
I am using web browser control in a VB 6.0 client server application
to print reports.

I am writing the report into a HTML file and displays the report to
the user using the code, webbrowsercontr ol.navigate2 "path of the html
file" method.

When the user clicks command button on the VB form to print the report
I am using the following code, webbrowsercontr ol.ExecWB
OLECMDID_PRINT, OLECMDEXECOPT_P ROMPTUSER to print the report

In addition to the report displayed printer prints the following which
the user dont want to be printed
a.Page x of y (at the top right corner)
b.path where the file is stored (at the bottom left corner)
c.date (at the bottom right corner)

Is anyboody knows how to prevent the above things from getting
printed?

Thanks
Mohan
Jul 17 '05 #1
1 5741
"Mohan" <mo*******@yaho o.com> wrote in message
news:95******** *************** ***@posting.goo gle.com...
Hi All,
I am using web browser control in a VB 6.0 client server application
to print reports.

I am writing the report into a HTML file and displays the report to
the user using the code, webbrowsercontr ol.navigate2 "path of the html
file" method.

When the user clicks command button on the VB form to print the report
I am using the following code, webbrowsercontr ol.ExecWB
OLECMDID_PRINT, OLECMDEXECOPT_P ROMPTUSER to print the report

In addition to the report displayed printer prints the following which
the user dont want to be printed
a.Page x of y (at the top right corner)
b.path where the file is stored (at the bottom left corner)
c.date (at the bottom right corner)

Is anyboody knows how to prevent the above things from getting
printed?

Thanks
Mohan


The headers and footers are determined by user settings in the page setup
dialog. You could have a page setup option in your application, displaying
the page setup dialog (OLECMDID_PAGES ETUP) and leave it up to the user. The
drawback is that this will also affect the settings in Internet Explorer and
any other applications based on the webbrowser control.

You could also use print templates to customize the headers and footers, but
there seems to be a security issue because print templates are trusted code,
and so depending on the IE version, this may or may not work. See the
following article:

PRB: Cannot Use ExecWB() to Print HTML Documents with Print Templates in
Visual Basic
http://support.microsoft.com/default...b;en-us;308649

It seems there may be a way to pass custom headers and footers in the pvaIn
parameter, but the only examples I can find are in C++, using a SafeArray
(whatever that means). But if you know C++, maybe you can port the code to
VB. See the following article:

HOWTO: Print Custom Headers and Footers for a WebBrowser Control
http://support.microsoft.com/default...b;en-us;267240

HTH

--
Björn Holmgren
Guide Konsult AB
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7175
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local time reaches the set expire-time. But if it is an expire time set on my server in California, and the cookie is put on a computer that is running...
8
2420
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it was the entire function failing, but I tested with alerts and found that it was only the 'window.open' that fails to execute. The function is being...
3
13299
by: Jennie | last post by:
I am looking for a way to make the web page have a formfeed so the info from that spot will go to the top of the next printed page when I file>print the web page. I want it not to break on the screen but when I print the page. Is there such a JavaScript? TY
6
19606
by: Biguana | last post by:
Hi, Just wondering if anyone can help here. We have a site where most of the site opens in a window with no toolbars or menubar: window.open('mypage.aspx','self','toolbar=0, menubar=0, etc, etc) This is because it's a data driven site where space is at a premium and we'd rather discourage use of back, stop and refresh. The problem...
7
5117
by: Nilesh | last post by:
I am using background-image attribute in a CSS file and linking the CSS file to aspx page. But strangly, background-image attribute is not working for relative URL. e.g. If I apply following css ..navbar-background { background-image: url(images/menubar.gif); } the image is not appearing on the page. It seems that IE is picking
2
6952
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the...
1
4844
by: capb | last post by:
Hello, This is my first post, and any help would be greatly appreciated. I create online memorials which contain guestbooks which have been the subject of computer generated spam. I have been able to modify the php script to eliminate posts containing www and http which solved the problem for a while, but the spammers are back in full force. ...
2
7501
by: archana | last post by:
Hi all, I am facing some wired problem while using above mention data type. What i am doing is i am writing DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString() + ":"+DateTime.Now.Millisecond.ToString() to the file.
1
7287
by: Susan Bricker | last post by:
Greetings. I have a report (actually all of my reports in an MDB) that I want to date/time stamp at the bottom. Previously, I had used the builtin function of Now(). I thought that would give me a date and time value in the format: "month day, year hour:minutes:seconds". However, I noticed that only the date was printing (e.g.; January...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.