|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Printing...
I want to print a datareport... before that i need to set the default printers page setup , like papersize and margins (top,left,right, botton). Becuase the data report needs printers papersize to create the report.
I want to know how to set the default printers or specified printers page settings that i have mentioned... Please.... Arjun |
|
#2
|
|||
|
|||
|
Search for commondialog control
hi
Search msdn library help for commondialog control (right click on toolbar->components->Controls Tab-> ->tick the "Microsoft common dialog control"->ok). Add this control on a form. And in a "onclick_event" of a button : commondialogname.showprinter. This what u want? |
|
#3
|
|||
|
|||
|
thanx
but i need not to show the printer dialog box .... margin and papersettings has to be set programatically in coding
Arjun Quote:
|
|
#4
|
|||
|
|||
|
You can change the preferences of the printer dialog box without showing it
|
|
#5
|
|||
|
|||
|
thnx
thanx
can u show a smaple code for change the paper size.... Arjun Quote:
|
|
#6
|
|||
|
|||
|
Orientation
Printer.Orientation = 1 Else Printer.Orientation = 2 Printer.PaperSize = 1 ' set paper size to letter I don't know all type constants, but check 1 to .... I don't know how margins can be set, but to print at an specific position Sub printXY(x, y, TXT, Optional ByVal Font_Size As Integer = 8) Printer.CurrentX = x * 1377 Printer.CurrentY = y * 1377 FNTS = Printer.FontSize Printer.FontSize = Font_Size Printer.Print TXT Printer.FontSize = FNTS End Sub X and Y are in inches. ![]() |
|
#7
|
|||
|
|||
|
Thanx
actually i am printing a datareport.how to specify x y for that?
Arjun Quote:
|
|
#8
|
|||
|
|||
|
Remember that the printing is done in a virtual page before sending it to the printer, so the position of each text can be anywhere (because is a drawing). The X and Y are the coordinates of the beginning of each text.
if you want a margin of 1.5 inches of lenght the X=1.5, if the text begins on 1 inches from the top the first text will have Y=1.0 and the next will have an increase of Y aprox of 0.2 inches space down. ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Printing... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|