473,387 Members | 1,541 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,387 software developers and data experts.

Send Data to New Page for Printing ASP.NET

Hi Guys,
I have a Web Forms' 'Table' control in my default.aspx page, along
with other controls. I wanted to implement a functionality where a
user can click a button to open the table's contents in a new
page/window for printing. Is this possible. I was thinking about
using Server.Transfer, and passing data via Context.Items collection.
First, it doesn't send any data to the page, and second, it opens in
the same window.

I wanted to know if there was any way to pass contents to a new page,
and open a new window to print.

Any help is much appreciated. Thanks!
bhavin

Nov 18 '05 #1
2 1900
You can open a new window and pass it values using client side javascript
such as this:
a=window.open('MyPage.aspx?id=123','_new')
There are all kinds of options for setting window properties such as window
size and toolbar visibility.
Here's more info:
http://msdn.microsoft.com/workshop/a...ods/open_0.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"bhav" <bh******@hotmail.com> wrote in message
news:3f**************************@posting.google.c om...
Hi Guys,
I have a Web Forms' 'Table' control in my default.aspx page, along
with other controls. I wanted to implement a functionality where a
user can click a button to open the table's contents in a new
page/window for printing. Is this possible. I was thinking about
using Server.Transfer, and passing data via Context.Items collection.
First, it doesn't send any data to the page, and second, it opens in
the same window.

I wanted to know if there was any way to pass contents to a new page,
and open a new window to print.

Any help is much appreciated. Thanks!
bhavin

Nov 18 '05 #2
If your intent is to create a "printer friendly" version of your page you
may want to look at the @media CSS rule in addition to Mr. Orr's suggestion.
It may not be applicable in your application but it's worth a look. If you
have certain content on screen that you do not want to print (ie: a menu
bar) you can use the @media rule to select which content is displayed on
screen vs. what is displayed on a print out. If it is feasibile in your
application then you may be able to avoid having to open another window.

The W3C and Microsoft have documentation on the rule.

http://www.w3.org/TR/CSS21/media.html

http://msdn.microsoft.com/library/de...es/media_1.asp

Dave

"bhav" <bh******@hotmail.com> wrote in message
news:3f**************************@posting.google.c om...
Hi Guys,
I have a Web Forms' 'Table' control in my default.aspx page, along
with other controls. I wanted to implement a functionality where a
user can click a button to open the table's contents in a new
page/window for printing. Is this possible. I was thinking about
using Server.Transfer, and passing data via Context.Items collection.
First, it doesn't send any data to the page, and second, it opens in
the same window.

I wanted to know if there was any way to pass contents to a new page,
and open a new window to print.

Any help is much appreciated. Thanks!
bhavin

Nov 18 '05 #3

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

Similar topics

4
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...
0
by: Nick Garner | last post by:
Hello, I would think this would be pretty easy but have been searching for a while and trying all of the printpageeventhandler function things I can think of... I have an app that grabs a set...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
13
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access. It works just fine if I hard code the actual...
4
by: drec | last post by:
I currently have a script together that will display one record per page and allow the user to manually click through pages to view the next record. How can I translate this to printing the data? ...
1
by: agarwalsunitadhn | last post by:
helloo.. I want to send a part of the form as mail. for this i created a division <div> and give it a id so that i can call it for printing purpose... but when i send this then the message...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
13
by: sheldonlg | last post by:
I could use a little help here. I have goodled with not much luck. I have been at this for a bit and would appreciate suggestions. I have a form (A.php) that collects a lot of data. When I...
0
by: dtnam | last post by:
Hi, I want to do something like that: void doc_PrintPage(object sender, PrintPageEventArgs e) { // draw a rectangle e.Graphics.DrawRectangle(Pens.Black, new Rectangle(10, 10, 100,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.