New topic: 

Strange behaviour of reports with OpenPrinter.

<http://forums.realsoftware.com/viewtopic.php?t=43957>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        arturoli          Post subject: Strange behaviour of reports 
with OpenPrinter.Posted: Fri May 11, 2012 8:09 am                         
Joined: Mon Dec 20, 2010 3:27 am
Posts: 1                Hello,

I am working with Real Studio 2010 R5 and I have run into something I do not 
know whether it is a bug or something I am missing.

In the GasReport example included with Real Studio there is a section of code 
about printing, like this:

if ps.PageSetupDialog then 'necessary to update the PageSetup object to 300 DPI
  g = OpenPrinterDialog(ps)
  if g <> nil then
  If rpt.Run( ds, ps ) Then 'if the report runs successfully
  rpt.Document.Print(g)
  End If
  end if
end if


The problem with a code like that in real life is that it requires de user to 
go through the printer dialog every time he needs to print, what is likely to 
be quite annoying once the users has choosen a printer. So I tried changing 
OpenPrinterDialog for just OpenPrinter ...

if ps.PageSetupDialog then 'necessary to update the PageSetup object to 300 DPI
  g = OpenPrinter(ps)
  if g <> nil then
  If rpt.Run( ds, ps ) Then 'if the report runs successfully
  rpt.Document.Print(g)
  End If
  end if
end if


.. but then, only an empty (blank) page is printed.  

It looks like behaviour of rpt.Document.Print is different depending on whether 
"g" receives data from OpenPrinter or OpenPrinterDialog.

¿Is it a bug? ¿Is there a workaround to print several times from the program, 
without having to go everytime throug the OpenPrinterDialog box?

Thanks   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to