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
697 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ssdanu
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

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 …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

743 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

14 Experts available now in Live!

Get 1:1 Help Now