Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

Using ReportPro2 14 Oct 2019 10:20 #11158

  • UlrichT
  • UlrichT's Avatar
  • Topic Author


  • Posts: 8
  • 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

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 14 Oct 2019 13:33 #11160

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3366
  • 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:
    www.xsharp.eu/forum/public-product/1510-...rated-vo-application
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 11:42 #11183

    • UlrichT
    • UlrichT's Avatar
    • Topic Author


  • Posts: 8
  • 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:\test\Test.dbf"}
    oDB:Commit()
    cReportName :="c:\test\Liste1.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

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 11:58 #11185

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3366
  • 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:
    www.xsharp.eu/forum/public-product/1510-...vo-application#11073

    Currently, RpReportRDD has the following constructors:
    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
    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

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 12:08 #11187

    • robert
    • robert's Avatar


  • Posts: 3595
  • 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

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 12:24 #11188

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3366
  • Hi Robert,
    thank you very much for confirming!
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 13:26 #11190

    • UlrichT
    • UlrichT's Avatar
    • Topic Author


  • Posts: 8
  • 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:
    cReportName		:="c:\test\Liste1.rpt"
    aDBFs:={{"ReportDruck", cDatPfad+"BESTAND.DBF", cDatPfad+"BESTAND.CDX"}}
    oReport := RpReportRDD{ SELF, cReportName,"c:\test\", aDBFs }

    Here is what I get as Details:
    ************** 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

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 13:39 #11191

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3366
  • 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

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 14:43 #11193

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • 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?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 15:42 #11194

    • robert
    • robert's Avatar


  • Posts: 3595
  • Ulrich,
    What is the call stack ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 15:57 #11195

    • UlrichT
    • UlrichT's Avatar
    • Topic Author


  • Posts: 8
  • Hi,
    I have just sent a sample to Chris.
    Ulrich

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 17:07 #11197

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • Hi Ulrich,

    Thanks, I am seeing several issues, some are just typos, others we/you need to take care of:

    1. There's a typo in the code in Start():

    RddSetDefault( "DBFCDXX" ) // remove the double X

    2. PrintPreview() is called with

    oReport:PrintPreview(cJobName, cPrint2Filename, cCaption, cMessage, TRUE, SW_SHOWMAXIMIZED, 0, #test)

    the last param whould be #NULL_SYMBOL

    3. RP fails to open the dbf, because it is already opened by the code in exclusive mode, in
    oDB := dbSErver{"c:\test\Sales.dbf"}

    You must remove this line or change it to dbSErver{"c:\test\Sales.dbf" , TRUE}

    4. This is a version of RP2 which has not been compiled with the latest runtime, and it uses functions with different casing than the current one, such as Pow() which is used as POW()

    So I'd say please wait a few days, until we release a new X# build and also a newer version of RP2. Also indeed we need to make the RP2 method calls more compatible to that of VO, because the way they are now, it is difficult to know what to change, causing problems like (2). I am very surprised this was not brought up very often in the vulcan days as well, maybe very few people used RP with vulcan...
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Using ReportPro2 15 Oct 2019 17:56 #11198

    • UlrichT
    • UlrichT's Avatar
    • Topic Author


  • Posts: 8
  • Hi Chris,

    thanks for your answer.
    So I will wait.

    Ulrich

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1