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
712 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 168 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 166 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 166 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JavaScript waiting 14 69
window.setInterval not firing 7 30
Google Sheets Script 21 57
Removing HTML elements using javascript 4 11
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now