instead of printing I want to create high definition graphics from a report output to save them on disk. This should then be printed via a shell command (in linux) to circumvent the need of displaying PageSetup Dialogs every time. But no matter what I do I only get files with the current screen resolution of 72 dpi and a size of w559x H783 points. Here’s the code I put together until now:
Dim ps As New PrinterSetup
If rpt.Run(rs, ps) Then
If rpt.Document <> Nil Then
Dim saveFolder As FolderItem
saveFolder = SpecialFolder.Temporary
If saveFolder <> Nil Then
Dim saveFile As FolderItem
For i As Integer = 1 To rpt.Document.PageCount
saveFile = saveFolder.Child("MyReport" + Str(i) + ".png")
// output the file to printer via shell command
Var s As Shell
s = New Shell
s.Execute("lp /" + saveFolder.Name + "/" + saveFile.Name)
If s.ErrorCode <> 0 Then
MessageBox("Error code: " + s.ErrorCode.ToString)
It saves and prints the file but the output is rather bad because of its low resolution.
this is a known bug for years. Sadly Xojo hasnt spent any love to their report engine for over a decade. Pray that we will get something better, wenn they refresh their UI next year. You probably can use BKeeney Shorts.
There is a feedback ticket for this bug. Since I’m on the road right now, I can’t look it up.
@Martin: this is rather discouraging (again). Thanks for the information. BKeeney Shorts seems to an alternative but we are a non-profit organization in health business and there is simply no (more) cash for things like this (which should be possible OOTB as far as I think).
Edit: BKeeney Shorts is not available for Linux @Emile: Thanks for your input (again)
Believe me, I already tried a lot in this direction. It is all about not displaying any printer dialogs to the user. And displaying the dialog and letting the user choose the printer (ever and ever again) seems to be the only way to get a graphics object with higher resolution
And I read the Docs more than once. There are faults in the online docs and the Printing and Reporting Examples don’t even run.
Yes, I know. But… the whole thread is about avoiding the printer setup dialogs on each and every print (see my very first posting). And printing to pdf does not make a difference here, it displays the same dialogs
Meanwhile I have tested to circumvent this by saving the printer setup and graphics files generated by PageSetupDialog() and OpenPrinterDialog() to global Vars for later reuse during runtime. But this holds the print until the app is closed - no idea why.
If I wouldn’t be bold I had lost my hair until now