Problem using ReportPro2 for X#

We encourage new members to introduce themselves here. Get to know one another and share your interests.
Post Reply
User avatar
vzeljko
Posts: 35
Joined: Wed Sep 28, 2016 8:02 pm

Problem using ReportPro2 for X#

Post 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
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Problem using ReportPro2 for X#

Post 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}
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
vzeljko
Posts: 35
Joined: Wed Sep 28, 2016 8:02 pm

Problem using ReportPro2 for X#

Post 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)
User avatar
Chris
Posts: 4923
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Problem using ReportPro2 for X#

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
vzeljko
Posts: 35
Joined: Wed Sep 28, 2016 8:02 pm

Problem using ReportPro2 for X#

Post by vzeljko »

ReportPro 2 for XSharp 2.35.0.4
date: 26.11.2019
User avatar
Chris
Posts: 4923
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Problem using ReportPro2 for X#

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
vzeljko
Posts: 35
Joined: Wed Sep 28, 2016 8:02 pm

Problem using ReportPro2 for X#

Post 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
User avatar
Chris
Posts: 4923
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Problem using ReportPro2 for X#

Post 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 :)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply