473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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, webbrowsercontrol.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, webbrowsercontrol.ExecWB
OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER 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 5729
"Mohan" <mo*******@yahoo.com> wrote in message
news:95**************************@posting.google.c om...
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, webbrowsercontrol.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, webbrowsercontrol.ExecWB
OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER 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_PAGESETUP) 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
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...
8
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...
3
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...
6
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,...
7
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...
2
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...
1
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...
2
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() + ":" +...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.