Page 1 of 2
Using ReportPro2
Posted: Mon Oct 14, 2019 8:20 am
by UlrichT
I am trying to use ReportPro2 and get the following error:
errorXS0144: Cannot create an instance of the abstract class or interface 'ReportPro2.RpReport'
I have referenced:
ReportPro2.Base.dll
ReportPro2.English.dll
Report.Pro2.Export.dll
ReportPro2.Runtime.dll
ReportPro2.UDF.dll
System
System.Drawing
System.Windows.Forms
VOGUIClasses
VORDDClasses
VOSystemClasses
XSharp.RT
XSharp.VO
A #using ReportPro2 also does not help.
What am I missing?
Ulrich
Using ReportPro2
Posted: Mon Oct 14, 2019 11:33 am
by wriedmann
Hi Ulrich,
unfortunately RpReport is an abstract class and cannot be instanciated.
You need to use the class RpReportRDD if using the RDD version.
Please see also this thread here:
https://www.xsharp.eu/forum/public-prod ... pplication
Wolfgang
Using ReportPro2
Posted: Tue Oct 15, 2019 9:42 am
by UlrichT
Hi Wolfgang,
class RpReportRDD helped me to move on.
But I get 2 more open questions. Here is the code:
LOCAL oDB AS DBServer
LOCAL cPrint2Filename, cCaption, cMessage, cJobName, cReportName AS STRING
LOCAL oReport AS RpReportRDD
oDB := dbSErver{"c:testTest.dbf"}
oDB:Commit()
cReportName :="c:testListe1.rpt"
cJobName := "Liste1"
cPrint2Filename := "Liste1 "
cCaption := " - Report Preview"
cMessage := "Printing in progress..."
oReport := RpReportRDD{ SELF, cReportName}
IF oReport:IsValid
oReport:PrintPreview(cJobName, cPrint2Filename, cCaption, cMessage, TRUE, SW_SHOWMAXIMIZED)
ENDIF
oDB:Close()
oReport:Close()
In the line oReport := RpReportRDD{ SELF, cReportName} I get the error XS1503: Argument 2: cannot convert from 'string' to 'logic'.
And in the line oReport:PrintPreview(cJobName, cPrint2Filename, cCaption, cMessage, TRUE, SW_SHOWMAXIMIZED) I get the error XS0103: The name 'SW_SHOWMAXIMIZED' does not exist in the current context.
As you might suppose the code is taken from VO.
So what must I change in XSharp?
Ulrich
Using ReportPro2
Posted: Tue Oct 15, 2019 9:58 am
by wriedmann
Hi Ulrich,
unfortunately in the current ReportPro version for X# the parameter lists are not the same as in the VO version.
This is not a choice of the current development team, but by the people that moved ReportPro from VO to Vulcan.NET.
For the next version Robert has added default parameters to enhance the compatbility, see here:
https://www.xsharp.eu/forum/public-prod ... tion#11073
Currently, RpReportRDD has the following constructors:
Code: Select all
public constructor(oParent as Object , cFileName as string , cDataPath as string , aDbfSwap as __Array )
public constructor(oOwner as Object , lManager as Logic )
and the PrintPreview this parameter list
Code: Select all
public virtual method PrintPreview(cJobName as string , cPrint2FileName as string , cCaption as string , cMessage as string , lModal as Logic , nShowState as Long , nZoom as DWord , symPPWindow as __Symbol ) as void
To solve such problems yourself, you should install ILSpy and look in the library source code or use the intellisense of your IDE.
Wolfgang
Using ReportPro2
Posted: Tue Oct 15, 2019 10:08 am
by robert
Ulrich, Wolfgang,
We will update the parameters in the next build. We will add default values for all parameters where that is possible.
We will also look at Wolfgangs suggestion to rename the base class and create 2 assemblies (RDD, SQL, DESIGNER) with a RpReport class that inherits from RpReportRDD, RpReportSQL and RpReportDesigner.
We will also include the header files in the assemblies so you don't need the headers anymore for constants such as PRINT_OK and PRINT_NOMORE
SW_SHOWMAXIMIZED is a define inside the VOWin32ApiLibrary. So you have to include that library.
(Unfortunately) VO allowed you to use defines from this library without even adding the library to your application. I found this very confusing, but could not change that in VO.
Robert
Using ReportPro2
Posted: Tue Oct 15, 2019 10:24 am
by wriedmann
Hi Robert,
thank you very much for confirming!
Wolfgang
Using ReportPro2
Posted: Tue Oct 15, 2019 11:26 am
by UlrichT
Hi all together,
referencing VOWin32APILIbrary helped me to get rid of the second error.
But now I get an exception error in the last of the following lines during runtime:
Code: Select all
cReportName :="c:testListe1.rpt"
aDBFs:={{"ReportDruck", cDatPfad+"BESTAND.DBF", cDatPfad+"BESTAND.CDX"}}
oReport := RpReportRDD{ SELF, cReportName,"c:test", aDBFs }
Here is what I get as Details:
Code: Select all
************** Ausnahmetext **************
Description : No exported variable 'HelpDisplay'
Subsystem : BASE
GenCode : EG_NOVARMETHOD No exported variable
FuncSym : XSHARP.RT.OOPHELPERS.IVARGET
Severity : ES_ERROR
Any ideas?
Ulrich
Using ReportPro2
Posted: Tue Oct 15, 2019 11:39 am
by wriedmann
Hi Ulrich,
since I don't use ReportPro myself, I don't have personal experiences.
The error message lets me understand that maybe your owner window needs an instance variable "HelpDisplay" - but please don't ask me why.
Normally, every window shoud have this as inherited from the base window class....
Wolfgang
Using ReportPro2
Posted: Tue Oct 15, 2019 12:43 pm
by Chris
Hi Ulrich,
I can not find anything in the RP2 code that could be producing this. Can you please create and post a full compilable (and self contained) sample that we can use to reproduce the problem?
Using ReportPro2
Posted: Tue Oct 15, 2019 1:42 pm
by robert
Ulrich,
What is the call stack ?
Robert