Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Nov 17, 2017 12:15 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Printing Way this no works
PostPosted: Thu May 16, 2013 8:56 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
Dim ps As PrinterSetup

Settings ="DoNotAlterThis=SetupString.2"_
+EndOfLine+"ActualHorizontalResolution=203"_
+EndOfLine+"ActualVerticalResolution=203"_
+EndOfLine+"MaxHorizontalResolution=300"_
+EndOfLine+"MaxVerticalResolution=300"_
+EndOfLine+"MarginLeft=0"_
+EndOfLine+"MarginRight=14376"_
+EndOfLine+"MarginTop=0"_
+EndOfLine+"MarginBottom=0"_
+EndOfLine+"MinMarginLeft=0"_
+EndOfLine+"MinMarginRight=14376"_
+EndOfLine+"MinMarginTop=0"_
+EndOfLine+"MinMarginBottom=0"_
+EndOfLine+"PageSetupFlags=6"_
+EndOfLine+"DevModeStructureSizePS=1044"_
+EndOfLine+"DevModeStructurePS=Star TSP100 Tear Bar (TSP113)"

ps=New PrinterSetup
ps.SetupString = Settings

ps.MaxHorizontalResolution = 300
ps.MaxVerticalResolution = 300


g = OpenPrinter(ps) <<<< Crash Way

If g <> Nil then
if rpt.Run(DataReports,ps) then //if the report ran successfully, print it
rpt.Document.Print(g)
end if
end if

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: Printing Way this no works
PostPosted: Sun May 19, 2013 3:27 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
It is not possible to create a printersetup entirely in code. You have to show the setup dialog at least once. You can capture the setupstring from the dialog an save it for later use, but you can't create it outside the setup dialog.


Top
 Profile  
Reply with quote  
 Post subject: Re: Printing Way this no works
PostPosted: Mon May 20, 2013 4:05 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
thanks for the help but i found how to made it works

Dim tmpSetupString as MemoryBlock

Settings ="DoNotAlterThis=SetupString.2"_
+EndOfLine+"ActualHorizontalResolution=203"_
+EndOfLine+"ActualVerticalResolution=203"_
+EndOfLine+"MaxHorizontalResolution=300"_
+EndOfLine+"MaxVerticalResolution=300"_
+EndOfLine+"MarginLeft=0"_
+EndOfLine+"MarginRight=14376"_
+EndOfLine+"MarginTop=0"_
+EndOfLine+"MarginBottom=0"_
+EndOfLine+"MinMarginLeft=0"_
+EndOfLine+"MinMarginRight=14376"_
+EndOfLine+"MinMarginTop=0"_
+EndOfLine+"MinMarginBottom=0"_
+EndOfLine+"PageSetupFlags=6"_
+EndOfLine+"DevModeStructureSizePS=1044"_
+EndOfLine+"DevModeStructurePS=Star TSP100 Tear Bar (TSP113)"


tmpSetupString=new MemoryBlock(lenb(Settings)) <<<<<<<<<<<<<
ps.SetupString = tmpSetupString

''if ps.PageSetupDialog then
ps.MaxHorizontalResolution = 300
ps.MaxVerticalResolution = 300
''
'If ps.PageSetupDialog Then 'necessary to update the PageSetup object to 300 DPI
'Dug=ps.SetupString
'g = OpenPrinterDialog(ps, Nil)
'Dug=ps.SetupString
'End

g = OpenPrinter(ps)

If g <> Nil then
if rpt.Run(DataReports,ps) then //if the report ran successfully, print it
rpt.Document.Print(g)
end if
end if

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group