Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Printer can not print large html table having large no of columns, some data is not getting printed

Posted on 2003-10-21
10
Medium Priority
?
900 Views
Last Modified: 2008-01-16
HI


I am having a  page in which I am showing large data  as an HTML table
That table has almost 13 to 14 columns, so while printing,
 that page spans  to more than one page.
All data can not fit into one page and  remaining data is lost
and is not getting printed.
Is there any silution to make this remaining data printed on another page or  to get all this data get printed...
THis is very urgent requirement...


Can you please help me as soon as possible


Thanks  in anticipation

Regards
ssdanu
0
Comment
Question by:ssdanu
10 Comments
 
LVL 14

Accepted Solution

by:
p_partha earned 672 total points
ID: 9594322
Hi
It shd print , there shd not be any issues... but anyways you can try this method given by ZVONKO
<html>
<head>
<script>
function printContenet(){
pw=window.open();
pw.document.write('<body>'+
document.getElementById('Content').innerHTML+
'<sc'+'ript>window.setTimeout("window.close()",3000)</scr'+'ipt>'+
'</body>');
pw.document.close();
pw.focus();
pw.print()
}
</script>
</head>
<body>
<form>
<table width="760">
 <tr colspan="2">
    <td>!--TOP BANNER--
<input type=button value=Print onClick="printContenet()">
    <td>
 </tr>
 <tr>
    <td>!--LEFT MENU--</td>
    <td><div id=Content>!--CONTENT--</div></td>
 </tr>
</table>
</form>
</body>
</html>

Hope this helps

Partha
0
 
LVL 3

Expert Comment

by:makc
ID: 9596227
Did ya tried album layout ?
That one
+--------------+
+                 +
+--------------+
instead of portrait
+-----+
+      +
+      +
+      +
+-----+ ??

if seriously, try something like

<style>
  @media print { .MyTBODY {zoom:0.5;} }
</style>
0
 

Author Comment

by:ssdanu
ID: 9596327
Hi,
I tried landscape too but stilll 3-4 columns are l;ost as they do not fit in the page
Is there any way so thaat those columns not fitting in page size get printed on next page??

I desperately want a solution for this problem...

Can you please give the solution


Thanks & Best Regards
ssdanu
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:ssdanu
ID: 9596391
HI,

 I tried this
@media print { .MyTBODY {zoom:0.5;} }

  solution but it is not working Ca you please explain that in detail


Thanks  & Regards
ssdanu
0
 

Author Comment

by:ssdanu
ID: 9597123
HI,

Is there any way so that we can specify and tell the printer to print forst 4 columns then on next page print next 4 columns etc.. programmatically??


Thanks
ssdanu
0
 
LVL 3

Expert Comment

by:makc
ID: 9608017
you should identify your table to style sheet first.

@media print { .MyTBODY {zoom:0.5;} } assumes you have <TABLE CLASS=MyTBODY ... declaration.

style above would force IE to shrink table with CLASS=MyTBODY when printing, so it might be printed just fine on single page...
0
 
LVL 3

Assisted Solution

by:makc
makc earned 664 total points
ID: 9608067
Try, for example, to print-preview HTML below:

<style>
 @media print { .MyTBODY {zoom:0.5;} }
</style>

<table class=MyTBODY border=1>
<tr>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>last</td>
</tr>
</table>

<table border=1>
<tr>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>tooooo_wide</td>
 <td>last</td>
</tr>
</table>

0
 
LVL 23

Assisted Solution

by:sciwriter
sciwriter earned 664 total points
ID: 9638047
Printing is handled by the browser based on user printer and page settings.  Javascript cannot change this, since it is a local hard drive issue, and Javascript, via web pages, has no access to those settings.

The best you can do is break your table into two separate columns, or tell the user to set his printer to landscape mode and hope it will fit.  Whatever you can set on your own computer to get the columns to print, the user will be able to do the same, so use that as a guide.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10345711
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: p_partha {http:#9594322} & makc {http:#9608067} & sciwriter {http:#9638047}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question