xsharp.eu • Problem using ReportPro2 for X#
Page 1 of 1

Problem using ReportPro2 for X#

Posted: Sat Aug 08, 2020 5:10 pm
by vzeljko
I'm new user of X# and ReportPro2 for X#.

I put this statements first

USING VO
USING ReportPro2
USING ReportPro2_Base
USING ReportPro2_Runtime
USING VOGUIClasses
USING VOWin32APILibrary

after using this code
oReport := RpReport{SELF, cRptPath + cRpt, cDBFPath}
IF oReport:IsValid
oReport:PrintPreview (cJobName, cPrint2FileName, cCaption, cMessage, TRUE, SW_SHOWMAXIMIZED)

I get error:
error XS0144: Cannot create an instance of the abstract class or interface 'ReportPro2.RpReport'
error XS1061: 'ReportPro2.RpReport' does not contain a definition for 'IsValid' and no accessible extension method 'IsValid' accepting a first argument of type 'ReportPro2.RpReport' could be found (are you missing a using directive or an assembly reference?)
error XS1061: 'ReportPro2.RpReport' does not contain a definition for 'PrintPreview' and no accessible extension method 'PrintPreview' accepting a first argument of type 'ReportPro2.RpReport' could be found (are you missing a using directive or an assembly reference?)

does anybody know what problem is.

Zeljko

Problem using ReportPro2 for X#

Posted: Sat Aug 08, 2020 6:25 pm
by FFF
Hi!
I think you need:
RpReportRDD instead of RpReport.
My call is like
oReport :=RpReportRDD{ SELF, cReport +".rpt", "D:MiscTuKVN_VersionDATAChris", Null_Array}

Problem using ReportPro2 for X#

Posted: Sat Aug 08, 2020 7:26 pm
by vzeljko
Yes, you are right.
But, now there is another error:

Description : No exported variable 'HELPDISPLAY'
Subsystem : BASE
GenCode : EG_NOVARMETHOD No exported variable
FuncSym : XSHARP.RT.OOPHELPERS.IVARGET
Severity : ES_ERROR
Can Default : False
Can Retry : False
Can Substitute : False
Argument Number : 2
Argument : cIVar
Arguments : {MainWin, Text: DBF-XML Demo,HELPDISPLAY}
Stack Trace :
at XSharp.RT.OOPHelpers.IVarGet(Object oObject, String cIVar, Boolean lSelf)
at XSharp.RT.Functions.IVarGet(Object oObject, String symInstanceVar)
at VO.ChildAppWindow..ctor(__Usual[] Xs$Args)
at ReportPro2.ChildAppWindowEx..ctor(__Usual[] Xs$Args)
at ReportPro2.RpReport..ctor(Object oOwner, Boolean lManager)
at ReportPro2.RpReportRDD..ctor(Object oParent, String cFileName, String cDataPath, __Array aDbfSwap)

Problem using ReportPro2 for X#

Posted: Sat Aug 08, 2020 9:52 pm
by Chris
Hi Zeljko,

I think you have an old version of ReportPro, current versions have been refactored and allow you to use the class RpReport directly. Is it an X# or the old vlcan version of RP2 that you are using?

Problem using ReportPro2 for X#

Posted: Sat Aug 08, 2020 10:16 pm
by vzeljko
ReportPro 2 for XSharp 2.35.0.4
date: 26.11.2019

Problem using ReportPro2 for X#

Posted: Sun Aug 09, 2020 12:17 pm
by Chris
Hi Zeljko,

I can't see your email address, can you please send me an email at chris@ xsharp (dot) eu, so I will send you an updated RP version?

Problem using ReportPro2 for X#

Posted: Mon Aug 10, 2020 7:42 pm
by vzeljko
Problem is solved, thanks to Chris.
Because I call ReportPro from winform not VO window, I had to put this code

LOCAL oOwner AS USUAL

oOwner := __ForeignWindow{SELF:Handle}

and change this code:
oReport := RpReport{oOwner, cRptPath + cRpt, cDBFPath}

Chris, thanks again.

Zeljko

Problem using ReportPro2 for X#

Posted: Mon Aug 10, 2020 8:15 pm
by Chris
Glad it works for you now Zeljko and thanks for posting the solution here! Have to say I took that tip from Robert though :)