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
757 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: 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!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reactjs with .NET 3 70
How can I validate an input field using Javascript that checks for number of characters? 4 28
Put POST values into cookies. 14 30
Read text on Table 7 25
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…

740 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