RP2SQL32Lib
Moderator: wriedmann
RP2SQL32Lib
When this happened in my own app, it was because I was using a report:Close() after the Preview. This worked in VO because apparently the preview window was being shown modally, but in the .Net version this is not modal anymore, so the report closes directly. Could it be you are doing something similar?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
RP2SQL32Lib
Hi Chris,
as the app was transported from VO the (modified) code is
To comment the oRpReport:Close() is not enough, you also have to comment the SELF:EndDIalog(), but then the window dlgReports is not closed, so you have to start the oRpReport:PrintPreview with SELF:Owner instead of SELF and leave the SELF:EndDialog() uncommented!
Is this the right way or is there a better way to do this, e.g. start Preview modeless?
as the app was transported from VO the (modified) code is
Code: Select all
CLASS dlgReports INHERIT ...
METHOD pshOk()
...
oRpReport := RpReportSQL{SELF, GetDefault()+cReport+".RPT", GetDefault(), {}, "user", "pass"}
IF oRpReport:IsValid
oRpReport:PrintPreview(cReport,cReport+".PRN",cCaption,"Bericht in Bearbeitung...")
ENDIF
oRpReport:Close()
SELF:EndDialog()
RETURN SELF
Is this the right way or is there a better way to do this, e.g. start Preview modeless?
-
- Posts: 60
- Joined: Tue Oct 11, 2016 8:56 pm
- Location: UK
RP2SQL32Lib
Are you using the RpReportEnded() callback method?
Code: Select all
METHOD RpReportEnded( oReport )
oReport:Close()
RETURN TRUE
RP2SQL32Lib
Guys, I am looking into various RP2 problems right now, will also look into making the Preview Dialog modal (optionally?) as well, so it has the same behavior as in VO. We should have a new improved version soon.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
RP2SQL32Lib
The RpReportEnded method is exactly what I wanted!
I never used this method cause in VO the reports were modal so it wasn't needed!
Thanks!
Chris: I'm waiting for your next version of ReportPro, take your time!
Meanwhile I'm testing one of my apps with X# and to do this I also have ReportPro calls (in Vulcan style) up and running.
I never used this method cause in VO the reports were modal so it wasn't needed!
Thanks!
Chris: I'm waiting for your next version of ReportPro, take your time!
Meanwhile I'm testing one of my apps with X# and to do this I also have ReportPro calls (in Vulcan style) up and running.
RP2SQL32Lib
Franz,
While looking at some other issues, I realized that there's a parameter (the 5th one) in PrintPreview() named "lModal". So if you pass the method TRUE as a fifth argument, the preview window should be modal as in VO. This is now also TRUE by default in our internal build.
While looking at some other issues, I realized that there's a parameter (the 5th one) in PrintPreview() named "lModal". So if you pass the method TRUE as a fifth argument, the preview window should be modal as in VO. This is now also TRUE by default in our internal build.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
RP2SQL32Lib
I got another problem with Report Pro, when I do a manual report with RpPrinter
3 params are missing, so I changed it to
Which values can I use for nZoom?
What means param symPPWindow? If I give NULL_SYMBOL report crashes?
Code: Select all
oPrinter := RpPrinter{oWindow, SELF}
oPrinter:PrintPreview("Job","File", "Caption", "Message", TRUE, FALSE, FALSE)
Code: Select all
oPrinter:PrintPreview("Job", "File", "Caption", "Message", TRUE, FALSE, FALSE, SW_NORMAL,1,NULL_SYMBOL)
What means param symPPWindow? If I give NULL_SYMBOL report crashes?
-
- Posts: 60
- Joined: Tue Oct 11, 2016 8:56 pm
- Location: UK
RP2SQL32Lib
From the RP2 help file:
For the window symbol we use #PreviewDlg with the following class:
Leigh
For zoom:nZoomed
Optional parameter which specifies the initial zoom level of the Print Preview window. Valid options are:ZOOM_WHOLE_PAGE, ZOOM_PAGE_WIDTH and ZOOM_100
symPPWindow
Optional parameter to specify a symbol representing a class to instantiate for use as the Print Preview window. The class specified must provide certain callback methods for ReportPro. The code for ReportPro's PrintPreview windows is provided as an example of what methods the window needs to provide.
There are two Print Preview window types provided with ReportPro:
#rpPrintPreviewMDI: this symbol will produce a Print Preview window that is built on an MDI child window. The owner must be an MDI shell type window.
#rpPrintPreviewDLG: this symbol will produce a Print Preview window that is built on a modal or modeless dialog window.
Code: Select all
DEFINE ZOOM_WHOLE_PAGE :=0
DEFINE ZOOM_PAGE_WIDTH :=1
DEFINE ZOOM_100 :=2
Code: Select all
CLASS PreviewDlg INHERIT ReportPro2.rpPrintPreviewDlg
METHOD Init(oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom)
SUPER:Init(oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom)
SELF:Caption := cCaption
// here you can delete the default buttons
// and add yours
RETURN SELF
END CLASS
RP2SQL32Lib
Guys,
With our latest changes in RP2, all the parameters in PrintPreview() are now optional, so you will not have to bother about it anymore. Regarding the symPPWindow parameter, NULL_SYMBOL should be fine, when this is passed (and is the default now), RP2 uses its standard preview dialog.
With our latest changes in RP2, all the parameters in PrintPreview() are now optional, so you will not have to bother about it anymore. Regarding the symPPWindow parameter, NULL_SYMBOL should be fine, when this is passed (and is the default now), RP2 uses its standard preview dialog.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu