Using ReportPro2

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
UlrichT
Posts: 8
Joined: Fri Jun 03, 2016 2:34 pm
Location: Germany

Using ReportPro2

Post 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
User avatar
wriedmann
Posts: 3763
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Using ReportPro2

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
UlrichT
Posts: 8
Joined: Fri Jun 03, 2016 2:34 pm
Location: Germany

Using ReportPro2

Post 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
User avatar
wriedmann
Posts: 3763
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Using ReportPro2

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4537
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Using ReportPro2

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3763
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Using ReportPro2

Post by wriedmann »

Hi Robert,
thank you very much for confirming!
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
UlrichT
Posts: 8
Joined: Fri Jun 03, 2016 2:34 pm
Location: Germany

Using ReportPro2

Post 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
User avatar
wriedmann
Posts: 3763
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Using ReportPro2

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4931
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Using ReportPro2

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

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4537
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Using ReportPro2

Post by robert »

Ulrich,
What is the call stack ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply