Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Javascript Print Function
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Hemant  
View profile  
 More options Nov 16 2009, 11:03 am
Newsgroups: microsoft.public.scripting.jscript
From: "Hemant" <Hem...@nomail.com>
Date: Mon, 16 Nov 2009 16:33:38 +0530
Local: Mon, Nov 16 2009 11:03 am
Subject: Javascript Print Function
Hi,
I want to print on more than one pages .
means in aspx page there are two section if user click on print button i
want print each section on different page on a single click.
Is it possible?
I call this function on button click
function myprint() {

window.parent.Frame1.focus();

window.print();

}

thanks ,

Hemant


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Sokalski  
View profile  
 More options Jan 2, 5:07 pm
Newsgroups: microsoft.public.scripting.jscript
From: "Nathan Sokalski" <njsokal...@hotmail.com>
Date: Sat, 2 Jan 2010 12:07:33 -0500
Local: Sat, Jan 2 2010 5:07 pm
Subject: Re: Javascript Print Function
I'm not sure if you can do it from the same page, but try doing something
like this:

Use an anchor with target="_blank" as follows:

<a href="firstpagetoprint.aspx" target="_blank">Print</a>

In firstpagetoprint.aspx, include the following in the onload event of the
body tag:

window.print();window.location.replace("secondpagetoprint.aspx");

Include this code in the onload event of the body tag for
thirdpagetoprint.aspx, fourthpagetoprint.aspx, fifthpagetoprint.aspx, etc.
Then, in the onload event of the body tag for lastpagetoprint.aspx, use the
following:

window.print();window.close();

Doing this will basically open a new page in a new window, print it, move to
the next page, print it, and after printing the last page, close the new
window. Unfortunately, because this requires you to have a different URL for
each section you want to print, you may need or want to make an aspx page
that takes a query string to generate the content you want printed for that
specific section. Hopefully this helps!
--
Nathan Sokalski
njsokal...@hotmail.com
http://www.nathansokalski.com/

"Hemant" <Hem...@nomail.com> wrote in message

news:uif$CwqZKHA.5108@TK2MSFTNGP06.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Evertjan.  
View profile  
 More options Jan 2, 5:25 pm
Newsgroups: microsoft.public.scripting.jscript
From: "Evertjan." <exjxw.hannivo...@interxnl.net>
Date: 02 Jan 2010 17:25:49 GMT
Local: Sat, Jan 2 2010 5:25 pm
Subject: Re: Javascript Print Function
Nathan Sokalski wrote on 02 jan 2010 in
microsoft.public.scripting.jscript:

Serverside code could supply different results with the same url,
using a counter stored in a session variable.

However you could get clientside cashing problems.

Classic ASP example:

<a href="pagenumbertoprint.asp?1" target="_blank">Print</a>

window.print();window.location.replace("pagenumbertoprint.asp?2");

window.print();window.location.replace("pagenumbertoprint.asp?3");

etc

will do nicely using serverside:

<% ' Jscript
var n = Request.querystring;
if (n=1) {
%>
-- first page ---
<%

} else if (n=2) {

%>
-- second page ---
<%
} else if (n=3) {

// etc etc

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google