By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

C# .NET web application - printing the forms

P: n/a
Hello,

I have an application written in C# on visual studio .NET. It is a web
aplication.
The application consists of many different forms, that users
occassionaly want to print out for filing.
When they log to application (through web browser) and choose the
print option, on the right margin few cm get cut off (so some fields
do not print out).
Is there any function that ensure that when user pritns he gets the
entire page which is displayed?

Thanks & Regards,

Suzann
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Suzann,

The only thing I can think of to help you is to decide how much data fits on
a page. For example, one way would be to create a blank html page and a
table (just in notepad), then keep increasing the size, trying to print the
table each time, until you think the you've reached the maximum px's you
think should be permitted on a deafult A4 (or letter, depending on where
your clients are), then ensure that any grids or data you display fits
within this bounds.

Not ideal, but it should work for cases where people printing the data are
using a standard. I.E. Portrait A4 [Europe/Africa/Asia/Aus] (or Letter[US]).

Dan.

"Suzanka" <su************@nbad.com> wrote in message
news:87**************************@posting.google.c om...
Hello,

I have an application written in C# on visual studio .NET. It is a web
aplication.
The application consists of many different forms, that users
occassionaly want to print out for filing.
When they log to application (through web browser) and choose the
print option, on the right margin few cm get cut off (so some fields
do not print out).
Is there any function that ensure that when user pritns he gets the
entire page which is displayed?

Thanks & Regards,

Suzann

Nov 16 '05 #2

P: n/a
???
I search from Internet, the result are:

(1)<script defer>
function SetPrintSettings() {
?// -- advanced features
?factory.printing.SetMarginMeasure(2) // measure margins in inches
?factory.SetPageRange(false, 1, 3) // need pages from 1 to 3
?factory.printing.printer = "HP DeskJet 870C"
?factory.printing.copies = 2
?factory.printing.collate = true
?factory.printing.paperSize = "A4"
?factory.printing.paperSource = "Manual feed"
?// -- basic features
?factory.printing.header = "This is MeadCo"
?factory.printing.footer = "Advanced Printing by ScriptX"
?factory.printing.portrait = false
?factory.printing.leftMargin = 1.0
?factory.printing.topMargin = 1.0
?factory.printing.rightMargin = 1.0
?factory.printing.bottomMargin = 1.0
}
</script>
(2)
<script language="javascript">
??function printsetup(){
??// setting
??wb.execwb(8,1);
??}
??function printpreview(){
??// preview
????
??wb.execwb(7,1);
?????
????
??}
??function printit()
??{
??if (confirm(''''Confirm?'''')) {
??wb.execwb(6,6)
??}
??}
??</script>
</head>
<body>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
height=0 id=wb name=wb width=0></OBJECT>
<input type=button name=button_print value="Print"
onclick="javascript:printit()">
<input type=button?name=button_setup value="Page Setting"
onclick="javascript:printsetup();">
<input type=button?name=button_show value="Preview"
onclick="javascript:printpreview();">
<input type=button name=button_fh value="close"
onclick="javascript:window.close();">
Good luck!
:)

"Suzanka" <su************@nbad.com>
??????:87**************************@posting.google .com...
Hello,

I have an application written in C# on visual studio .NET. It is a web
aplication.
The application consists of many different forms, that users
occassionaly want to print out for filing.
When they log to application (through web browser) and choose the
print option, on the right margin few cm get cut off (so some fields
do not print out).
Is there any function that ensure that when user pritns he gets the
entire page which is displayed?

Thanks & Regards,

Suzann

Nov 16 '05 #3

P: n/a
Suzann,

The only thing I can think of to help you is to decide how much data fits on
a page. For example, one way would be to create a blank html page and a
table (just in notepad), then keep increasing the size, trying to print the
table each time, until you think the you've reached the maximum px's you
think should be permitted on a deafult A4 (or letter, depending on where
your clients are), then ensure that any grids or data you display fits
within this bounds.

Not ideal, but it should work for cases where people printing the data are
using a standard. I.E. Portrait A4 [Europe/Africa/Asia/Aus] (or Letter[US]).

Dan.

"Suzanka" <su************@nbad.com> wrote in message
news:87**************************@posting.google.c om...
Hello,

I have an application written in C# on visual studio .NET. It is a web
aplication.
The application consists of many different forms, that users
occassionaly want to print out for filing.
When they log to application (through web browser) and choose the
print option, on the right margin few cm get cut off (so some fields
do not print out).
Is there any function that ensure that when user pritns he gets the
entire page which is displayed?

Thanks & Regards,

Suzann

Nov 16 '05 #4

P: n/a
???
I search from Internet, the result are:

(1)<script defer>
function SetPrintSettings() {
?// -- advanced features
?factory.printing.SetMarginMeasure(2) // measure margins in inches
?factory.SetPageRange(false, 1, 3) // need pages from 1 to 3
?factory.printing.printer = "HP DeskJet 870C"
?factory.printing.copies = 2
?factory.printing.collate = true
?factory.printing.paperSize = "A4"
?factory.printing.paperSource = "Manual feed"
?// -- basic features
?factory.printing.header = "This is MeadCo"
?factory.printing.footer = "Advanced Printing by ScriptX"
?factory.printing.portrait = false
?factory.printing.leftMargin = 1.0
?factory.printing.topMargin = 1.0
?factory.printing.rightMargin = 1.0
?factory.printing.bottomMargin = 1.0
}
</script>
(2)
<script language="javascript">
??function printsetup(){
??// setting
??wb.execwb(8,1);
??}
??function printpreview(){
??// preview
????
??wb.execwb(7,1);
?????
????
??}
??function printit()
??{
??if (confirm(''''Confirm?'''')) {
??wb.execwb(6,6)
??}
??}
??</script>
</head>
<body>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
height=0 id=wb name=wb width=0></OBJECT>
<input type=button name=button_print value="Print"
onclick="javascript:printit()">
<input type=button?name=button_setup value="Page Setting"
onclick="javascript:printsetup();">
<input type=button?name=button_show value="Preview"
onclick="javascript:printpreview();">
<input type=button name=button_fh value="close"
onclick="javascript:window.close();">
Good luck!
:)

"Suzanka" <su************@nbad.com>
??????:87**************************@posting.google .com...
Hello,

I have an application written in C# on visual studio .NET. It is a web
aplication.
The application consists of many different forms, that users
occassionaly want to print out for filing.
When they log to application (through web browser) and choose the
print option, on the right margin few cm get cut off (so some fields
do not print out).
Is there any function that ensure that when user pritns he gets the
entire page which is displayed?

Thanks & Regards,

Suzann

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.