473,480 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem with the printing of alternative pages

meenakshia
33 New Member
hi forum
i m trying to print two different pages as soon as the form is saved.

i tried to use this command
<A HREF="javascript:window.print()">Print 1st Page</A>
<A HREF="javascript:window.print()">Print 2nd Page</A>

but i was unable to use the link command to force the printer to print the two other pages

print 1st page should print cust1.htm
and print 2nd page should print cust2.htm

any ideas how to go ahead for the same?
smile always
anand
Aug 16 '08 #1
5 1290
acoder
16,027 Recognized Expert Moderator MVP
window.print() prints the current page. Which page is this code in?
Aug 17 '08 #2
meenakshia
33 New Member
hi
thanks for ur reply
well yes i have used the window.print() but it prints a current page
what i want is that if i have page 1.html open
in this page i have 2 links
1st link when clicked will print 2.html page
and 2nd link when clicked will print 3.html page
can you suggest me a way to do so?
i came across an idea that maybe i open both the pages as popup and in those pages use onload to print
is this the right way?
thanks
anand
Aug 24 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Yes, that could work but then you'd have a window open that will need to be closed by the user. An alternative is to use print stylesheets to print only what is required - a kind of "Print-friendly page" using CSS. The way this could work is if you load the stylesheet for the corresponding linked page when the link is clicked.
Aug 25 '08 #4
meenakshia
33 New Member
hi thanks for reply
i cud not understand what u meant to say.
can u suggest me with some example
thanks
anand
Sep 2 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
It was a suggestion, but it may not work depending on the files to be printed and could actually be quite complex. You load a print stylesheet initially for link 1. This could be achieved by having the linked page loaded in the main page but hidden and the print stylesheet shows it and hides the rest of the content. If link 2 is clicked, it changes the stylesheet to the link 2 stylesheet (which shows the link 2 content and hides the rest) and then prints with window.print().

See Going to Print and Working with Alternate Stylesheets.

As I said, this could be more complex than what you're looking for, so an easy solution would be what you suggested earlier about opening a new window and printing.
Sep 3 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4821
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
4
5916
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
4
380
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
6
4059
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
0
7060
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
7106
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...
1
6760
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...
0
7022
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...
0
5365
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,...
0
4501
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...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.