| View previous topic :: View next topic |
| Author |
Message |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Feb 27, 2006 1:11 pm Post subject: Printing in Landscape format |
|
|
I'm running around in circles and don't seem to be getting nearer the solution, so I guess it's time to put my question to the VDS thinktank
In a program I have a print preview window which in fact shows html formatted list data. I want to print this output so I made a button on the vdssurfx window which uses SHELL PRINT to output the file to the printer.
What I really want is to force this output to be printed in landscape format.
Anyone any idea how I can get the print operation to default to landscape format?
Jan
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Mon Feb 27, 2006 8:47 pm Post subject: |
|
|
Sorry I just thought of this: Since your data is HTML formatted you might try Cascading Sylesheets to print in landscape format from a CSS aware browser.
Link:
http://www.w3.org/TR/css-print/
Example HTML:
| Description: |
|
 Download |
| Filename: |
csslandscape.zip |
| Filesize: |
423 Bytes |
| Downloaded: |
1152 Time(s) |
|
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Feb 27, 2006 10:49 pm Post subject: |
|
|
That sure sounds like a possible solution.
I use HTML to be able to print formatted output but never thought of CSS.
I'll dig into that tomorrow.
Thanks!
Jan
|
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Tue Feb 28, 2006 7:13 pm Post subject: |
|
|
Alas !
I have mixed results with this sample stylesheet.
In my html page there is a table with a number of columns and packing everything between a DIV and /DIV results in the header being printed in landscape, then the table is printed on a second page in portrait and finally the footer is on page 3 in landscape format again.
So there is progress but now my problem is how to get everything
printed landscape on a single page?
This is a summary of the html i used:
| Quote: |
<html>
<head>
<style type="text/css" media="print">
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
.noprint {display:none;}
</style>
</head>
<body>
<div class="page">
<font size="+2"><b>%%DatabaseDescription</b></font>
<hr align="left">
<table width="1000" border="0" summary="">
<tr>
<td>
.....
.....
</td>
</tr>
</table>
<br><br>
<hr align="left">
Number of records in this database: @DATABASE(COUNT,1)
</div>
</body>
</html>
|
Jan
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Tue Feb 28, 2006 8:05 pm Post subject: |
|
|
It would appear that your Table width "1000" is beyond the printable bounds of the page. Try using a smaller width value or better yet a percentage value.
| Code: | | <table width="100%" border="1" summary=""> |
|
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Mar 03, 2006 11:28 am Post subject: |
|
|
| yea, I allways used 99%, but maybe I'm too old fashion.
|
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Fri Mar 03, 2006 8:21 pm Post subject: |
|
|
I tried the 100% solution but the effect is not what I hoped for.
The header is not printed at all, the table is printed on one page in portrait and the footer is printed on a second page in landscape.
I hope someone has any more bright ideas to get this landscape printing going, because I can't find a solution at the moment.
Jan
|
|
| Back to top |
|
 |
WidgetCoder Contributor


Joined: 28 May 2002 Posts: 126 Location: CO, USA
|
Posted: Sat Mar 04, 2006 10:50 pm Post subject: |
|
|
Sorry I guess that doesn't work on tables
This link shows an example with tables:
http://web.tampabay.rr.com/bmerkey/examples/landscape-test.html
Uses: filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=1);
I haven't tried it myself but the example page printed correctly.
|
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Mon Mar 06, 2006 5:29 pm Post subject: |
|
|
It's amazing ..... I downloaded that Landscape demo webpage and saved the source. Now one time it shows the pages correctly in the print preview but another time the same (i=unchanged) source shows the table in portrait again.
I also changed my own html source accordingly but that still won't print tables in landscape.
First I suspected that using bold in the table caused a problem but with or with bold makes no difference my html table never prints in landscape.
I'm baffled that something this simple can be so hard to achieve.
Still going to experiment further with stylesheets but if anyone has more ideas they are most welcome.
Jan
|
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Tue Mar 07, 2006 11:52 am Post subject: |
|
|
I tried it here with 100% printed same as the preview, but maybe it needs the rest of the stuff to see what you mean.
| Code: | <html>
<head>
<style type="text/css" media="print">
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
.noprint {display:none;}
</style>
<!--
.noprint {display:block;}
-->
</head>
<body>
<div class="page">
<font size="+2"><b>%%DatabaseDescription</b></font>
<hr align="left">
<table width="100%" border="0" summary="">
<tr>
<td>
.....
.....
</td>
</tr>
</table>
<br><br>
<hr align="left">
Number of records in this database: @DATABASE(COUNT,1)
</div>
</body>
</html> |
|
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Mar 08, 2006 9:29 am Post subject: |
|
|
Perhaps the landscape style isn't inherited to your table cells - try to make a new style
TD.land { writing-mode: tb-rl; }
and set your table cells to that one: <TD class="land">
Greetz
Dread
_________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Mar 08, 2006 9:42 am Post subject: |
|
|
.. and due to the reversal made with the style sheet (you'll print right-to-left) you may have to structure
your table differently:
| Code: | <html>
<head>
<style type="text/css" media="print">
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
TD.land { writing-mode: tb-rl; }
</style>
</head>
<body>
<div class="page">
<font size="+2"><b>DatabaseDescription</b></font>
<hr align="left">
<table width="100%" border="1" summary="">
<tr><td class=land> Rec2 1st cell </td><td class=land> Rec1 1st cell </td></tr>
<tr><td class=land> Rec2 2nd cell </td><td class=land> Rec1 2nd cell </td></tr>
<tr><td class=land> Rec2 3rd cell </td><td class=land> Rec1 3rd cell </td></tr>
</tr>
</table>
<br><br>
<hr align="left">
Number of records in this database: @DATABASE(COUNT,1)
</div>
</body>
</html> |
Greetz
Dread
_________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Mar 10, 2006 10:28 am Post subject: |
|
|
I tried the TD class when it was 1000px with no difference, but I bet thats what he needs while at 100% with the reversal(which I didn't try), your prolly right Dread
I'm still learning CSS and xhtml, so I'm bailing outta here now
|
|
| Back to top |
|
 |
JRoza Contributor


Joined: 17 Aug 2003 Posts: 182 Location: Netherlands
|
Posted: Sun Mar 12, 2006 12:21 am Post subject: |
|
|
Thanks Dread!
Now I indeed have a table printed landscape blended in with the rest of the landscape lines.
But now - as you already said - a new problem arises because the HTML preview and the printed version are totally different.
In preview you see rec1.column1, rec1.column2, rec1.column3 on one line (as intended) but printed you see all columns of rec1 displayed below each other in tabel.column1, all items of rec2 in column2, etc.
So this CSS can be useful now it's figured out but it means that between preview and printing all data has to be reread in a different HTML file to get the row and columns right. Data from one record will have to divided over different HTML table rows to get it right. Which means that reading in the second record will mean lines will have to be inserted in the HTML file at the proper locations instead of just being added at the end of the HTML file.
Well ....... you can't win em all
Jan
|
|
| Back to top |
|
 |
|