C# .NET web application - printing the forms

S

Suzanka

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
 
?

???

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!
:)
 
D

Daniel Bass

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top