Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old November 9th, 2004, 11:11 PM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
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

Reply With Quote
  #2  
Old November 12th, 2004, 03:30 AM
dimd80 dimd80 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Greece, Athens
Posts: 29 dimd80 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 41 sec
Reputation Power: 0
Send a message via Yahoo to dimd80
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?

Reply With Quote
  #3  
Old November 15th, 2004, 11:35 PM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
thanx

but i need not to show the printer dialog box .... margin and papersettings has to be set programatically in coding

Arjun



Quote:
Originally Posted by dimd80
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?

Reply With Quote
  #4  
Old November 15th, 2004, 11:53 PM
SoberButCrazy SoberButCrazy is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 15 SoberButCrazy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You can change the preferences of the printer dialog box without showing it

Reply With Quote
  #5  
Old November 16th, 2004, 01:48 AM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
thnx

thanx

can u show a smaple code for change the paper size....

Arjun



Quote:
Originally Posted by SoberButCrazy
You can change the preferences of the printer dialog box without showing it

Reply With Quote
  #6  
Old November 19th, 2004, 09:25 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 4
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.

Reply With Quote
  #7  
Old November 22nd, 2004, 08:35 PM
Arjun Arjun is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 43 Arjun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 18 sec
Reputation Power: 4
Thanx

actually i am printing a datareport.how to specify x y for that?

Arjun





Quote:
Originally Posted by Darius
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.

Reply With Quote
  #8  
Old November 23rd, 2004, 09:33 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Printing...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway