Click to See Complete Forum and Search --> : Asp
esther Princy
November 9th, 2005, 11:45 PM
can we set printer properties to landscape through ASP code?? If so how?? can you please give me the code?
I'm having a button on a HTML page which on click opens the print dialog. But this button should not be pronted while printing the page. please give suggesstions.
HanneSThEGreaT
November 10th, 2005, 04:27 AM
This may do the trick!
<html>
<head>
<title>Landscape Printing</title>
<style type="text/css" media="print">
<!--
div.page {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
-->
</style>
</head>
<body>
<div class="page">
This is a test<br>
This is a test
</div>
</body>
</html>
Just one more thing:
Please use descriptive titles, for your threads, otherwise people may look over it!
esther Princy
November 10th, 2005, 04:59 AM
Thanks for ur reply. I tried this. But it does not work. Is there any settings in explorer?
HanneSThEGreaT
November 10th, 2005, 05:15 AM
:confused:
Try including this then:
<style type="text/css">
<!--
@page { size: landscape; }
-->
</style>
esther Princy
November 10th, 2005, 05:38 AM
Hi. The code which you sent first works. But it prints the text within DIV tags alone. But if i have a TABLE within DIV then the table doesnt print in landscape. Even I tried to set class as page to Table tag also. It prints each line in TD tag in landscape instead of the table to print in landscape.
Help me pls. Thanks
esther Princy
November 10th, 2005, 05:48 AM
Hi I got a sample from experts-exchange site in the following url.
http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20882755.html
This works fine. Do you have any idea to remove the Header and Footer during printing. Thanks
HanneSThEGreaT
November 10th, 2005, 05:54 AM
Hello again!
I'm glad that my first code I sent worked, I was a bit amazed when you said it didn't.. :thumb:
Anyhow, could perhaps send the code you got from Experts Exchange (Belive it or not I'm not subscribed there - so I can't see anything)
I will always try my best to help! :)
esther Princy
November 10th, 2005, 06:07 AM
hi the below code works but it doesnt stretch to the paper size. It is the same size as it is in Portrait.
I'm having a button on a HTML page which on click opens the print dialog. But this button should not be printed while printing the page. please give suggesstions.
<html>
<head>
<title>Landscape Printing</title>
<style>
TD.NormalText {
FONT-FAMILY: Verdana; FONT-SIZE: 14px
}
TD {
FONT-FAMILY: Verdana; FONT-SIZE: 12px
}
</style>
<style>
@media print { .rotator {filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=3)} }
</style>
</head>
<body>
<table border=1 class="rotator">
<tr><td class="page">This is a test</td></tr>
<tr><td class="page">This is a test</td></tr>
</table>
</div>
</body>
</html>
esther Princy
November 10th, 2005, 06:17 AM
hi the below code works but it doesnt stretch to the paper size. It is the same size as it is in Portrait.
I'm having a button on a HTML page which on click opens the print dialog. But this button should not be printed while printing the page. please give suggesstions.
<html>
<head>
<title>Landscape Printing</title>
<style>
TD.NormalText {
FONT-FAMILY: Verdana; FONT-SIZE: 14px
}
TD {
FONT-FAMILY: Verdana; FONT-SIZE: 12px
}
</style>
<style>
@media print { .rotator {filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=3)} }
</style>
</head>
<body>
<table border=1 class="rotator">
<tr><td class="page">This is a test</td></tr>
<tr><td class="page">This is a test</td></tr>
</table>
</div>
</body>
</html>
HanneSThEGreaT
November 10th, 2005, 06:37 AM
Hello again!
This will not print the print button
<html>
<head>
<title>Landscape Printing</title>
<style>
TD.NormalText {
FONT-FAMILY: Verdana; FONT-SIZE: 14px
}
TD {
FONT-FAMILY: Verdana; FONT-SIZE: 12px
}
</style>
<style>
@media print { .rotator {filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=3)} }
</style>
<SCRIPT>
<!--
// Hide tags with id="noprint"
//when printing
function printSetup()
{
var a = document.all.item("noprint");
if (a!=null) {
if (a.length!=null) {
//multiple tags found
for (i=0; i< a.length; i++) {
a(i).style.display = window.event.type == "beforeprint" ? "none" :"inline";
}
} else
//only one tag
a.style.display = window.event.type == "beforeprint" ? "none" :"inline";
}
}
//-->
</SCRIPT></head>
<body onbeforeprint="printSetup()" onafterprint="printSetup()">
<div class="rotator">
<table border=1>
<tr><td class="page">This is a test</td></tr>
<tr><td class="page">This is a test</td></tr></table>
<!-- set the tag id to "noprint" for elements you want displayed, but not printed -->
<SPAN id="noprint">
<BR><Input type = "button" name = "noprintBut" id="noprint" Value = "Print" onClick="window.print()">
</SPAN></table>
</div>
</body>
</html>
Have a look at the bolded lines, that causes the printer to ignore any element with the id of "noprint"
esther Princy
November 10th, 2005, 06:47 AM
hii thanks a lot. It works fine.
HanneSThEGreaT
November 10th, 2005, 06:57 AM
It's always a pleasure! :wave:
esther Princy
November 10th, 2005, 06:58 AM
hi, my problem is over thanks a lot once again
esther Princy
November 11th, 2005, 12:45 AM
can we have dates in a for loop in asp?? Can anyone help
HanneSThEGreaT
November 11th, 2005, 01:42 AM
Hello Esther!
Me again!
Not sure what you mean :confused:
Here are some examples..
1) <select size="1" name="u_day">
<% ' Start a loop to create the days of the month
for counter = 1 to 31 %>
<option <% ' Select the current day to display
if counter = day(date()) then %> selected <%
end if %> value="<%= counter %>"><%= counter %></option>
<% next %>
</select>
2) <select size="1" name="u_year">
<% ' Start a loop to create the years prior and previous
for counter = 1998 to 2005 %>
<option <% ' Select the current year to display
if counter =year(date()) then %> selected <%
end if %> value="<%= counter %>"><%= counter %></option>
<% next %>
</select>
<input type="submit">
<% end if %>
3) <form action="<%= request.servervariables("script_name") %>" method="post">
<select size="1" name="u_month">
<% ' Start a loop to create the twelve months of the year
for counter = 1 to 12 %>
<option <% ' Select the current month to display
if counter = month(date()) then %> selected <%
end if %> value="<%= counter %>"><%= counter %></option>
<% next %>
</select>
Note:
If you are asking a complete different question, rather start a new thread ;)
esther Princy
November 11th, 2005, 02:23 AM
hi hanna
h r u?Thnks for the codes.. I just now found it. I just wanted to know whether a for loop can can have dates
eg: for i = "11/1/2005" to "11/10/2005"
i tried it and go it......
HanneSThEGreaT
November 11th, 2005, 03:35 AM
hi hanna
h r u?Thnks for the codes.. I just now found it. I just wanted to know whether a for loop can can have dates
eg: for i = "11/1/2005" to "11/10/2005"
i tried it and go it......
No problem..
Try:
<% ' Start a loop to create the days of the month
for counter = day(date()) To day(date()) + 10 %>
<% ' Select the current day to display
Response.Write "11/" & CStr(counter) & "/2005" %>
<% next %>
esther Princy
November 11th, 2005, 04:18 AM
ya its working thanks
esther Princy
November 11th, 2005, 08:53 AM
hi hanne can i know about urself. which place do u b'long to?
HanneSThEGreaT
November 12th, 2005, 01:58 AM
hi hanne can i know about urself. which place do u b'long to?
Hi Esther!
Send me a private Message! (Just click on my name, and select the option)
esther Princy
November 24th, 2005, 06:50 AM
If there is a Combo near a Menu then Menu gets hided that is the combo comes in front of the Menu. Is there any option to keep the Combo back while a the Menu is listed
HanneSThEGreaT
November 24th, 2005, 07:25 AM
Hello again Esther! Hope you are fine..
Where is this menu, is it on the web page itself or the normal menu bar at the top ¿
esther Princy
November 24th, 2005, 07:42 AM
hi hanne im fine and hope the same frm u....
The menu bar is in the webpage. whenever it is listed if there is any combo then the Combo comes in front an the menu is not seen properly.
HanneSThEGreaT
November 24th, 2005, 08:00 AM
Ok, this one is a bit tough for me :blush:
The only way I can think of is to have the menu and the combobox in different layers, then you could set the layer's z-index properties when needed, have a look here (http://www.oreillynet.com/pub/a/javascript/2001/05/25/layers_partone.html), hopefully it's useful!
PS. sorry I didn't PM you back the other time, I've gone through a bad time
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.