ReportPro3 RpPrinter window class
Posted: Fri Oct 07, 2022 3:21 am
Hi All,
I have inherited a reasonably large VO codebase and have been converting it to X#. Things have been going well. and much of it is working as expected. I am now at the point of getting the reports working. We have got a license for RP3 from the XSharp site but it seems the code was designed to work with RP2. I am in the process of trying to get it working with RP3. I have created some extension methods that have got things to the state of building OK but running reports has a problem. The reports all seem to be generated from code, and not using any .RPT files.
Here is my current state. In setting up a report, I get to a line like this:
oPrinter := RpPrinter{SELF, oRpt}
where it is creating an RpPrinter object. A little further into this, I get this error
Unable to cast object of type 'ClientsReports' to type 'Classmate.cWindow'.
this is coming from that SELF parameter passed to the constructor. It is a window, but not the right type of window. SELF is of type ClientsReport which has an inheritance hierarchy like this:
ClientsReports
LabEditWindow
VO.DATAWINDOW
VO.ChildAppWindow
VO.AppWindow
VO.Window
VO.EventContext
XSharp.VObject
Digging through the documentation I find that the first parameter needs to be inherited from Classmate.cWindow, hence the problem with the cast. I suspect I will have this same issue with most of the other reports. My first thought is perhaps I need to create a cWindow wrapper around the VO.Window but perhaps there are other solutions. Perhaps we should have got RP2?
Any suggestions about how I should proceed from here?
Best Regards,
John
I have inherited a reasonably large VO codebase and have been converting it to X#. Things have been going well. and much of it is working as expected. I am now at the point of getting the reports working. We have got a license for RP3 from the XSharp site but it seems the code was designed to work with RP2. I am in the process of trying to get it working with RP3. I have created some extension methods that have got things to the state of building OK but running reports has a problem. The reports all seem to be generated from code, and not using any .RPT files.
Here is my current state. In setting up a report, I get to a line like this:
oPrinter := RpPrinter{SELF, oRpt}
where it is creating an RpPrinter object. A little further into this, I get this error
Unable to cast object of type 'ClientsReports' to type 'Classmate.cWindow'.
this is coming from that SELF parameter passed to the constructor. It is a window, but not the right type of window. SELF is of type ClientsReport which has an inheritance hierarchy like this:
ClientsReports
LabEditWindow
VO.DATAWINDOW
VO.ChildAppWindow
VO.AppWindow
VO.Window
VO.EventContext
XSharp.VObject
Digging through the documentation I find that the first parameter needs to be inherited from Classmate.cWindow, hence the problem with the cast. I suspect I will have this same issue with most of the other reports. My first thought is perhaps I need to create a cWindow wrapper around the VO.Window but perhaps there are other solutions. Perhaps we should have got RP2?
Any suggestions about how I should proceed from here?
Best Regards,
John