Crystal Reports 9 (SOLVED)

Post Reply
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Crystal Reports 9 (SOLVED)

Post by ryugarai27 »

Hi Fivewin Experts,

I am using CR9 to display reports on my application, but now it is giving me an error:

Error occurred at: 09/16/18, 14:06:17
Error description: Error CrystalRuntime.Application.9/3 DISP_E_MEMBERNOTFOUND: OPENREPORT
Args:
[ 1] = C Test.rpt

Stack Calls
===========
Called from: => TOLEAUTO:OPENREPORT( 0 )
Called from: testcr9a.prg => MAIN( 10 )

The Crystal Report Application object was created but unable to find the function OpenReport, is there any other libraries I need to link or register? I have already registered the following dll:

regsvr32 craxdrt9.dll /s
regsvr32 crviewer9.dll /s
regsvr32 crqe.dll /s
regsvr32 crtslv.dll /s
regsvr32 ExportModeller.dll /s

Here is my test code:
#include "Fivewin.ch"

FUNCTION MAIN()

LOCAL oCrystal := CreateObject( "CrystalRuntime.Application.9" )
LOCAL oReport
LOCAL oWnd, oCRViewer

Msginfo( oCrystal )
oReport := oCrystal:OpenReport( "Test.rpt" )

DEFINE WINDOW oWnd

oCRViewer = TActiveX():New( oWnd, "CRViewer9.CRViewer" )
oCRViewer:SetProp( "ReportSource", oReport )
oCRViewer:Do( "ViewReport" )

oWnd:oClient = oCRViewer

ACTIVATE WINDOW oWnd;
MAXIMIZED

RETURN NIL

Thanks and best regards,
ryu
Last edited by ryugarai27 on Mon Sep 17, 2018 6:36 am, edited 1 time in total.
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Crystal Reports 9

Post by dutch »

Dear Ryu,

Do you try to enter full path of your report file? I use full path without problem.

I hope it may help.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Crystal Reports 9

Post by ryugarai27 »

Hi Dutch,

Thanks, I've also tried using absolute path like:

oReport := oCrystal:OpenReport( "D:\projects\fwh1706\testCR9\Test.Rpt" )

but still getting the same result. The program created the TOLEAUTO object because I can confirm using Msginfo( oCrystal:Classname()), I am just confused why it can't find the OpenReport method of the oCrystal object.

Best regards,
ryu
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Crystal Reports 9

Post by dutch »

Have you ever print CR9 successful?
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Crystal Reports 9

Post by ryugarai27 »

Hi Dutch,

Yes, I have used it in the past using Windows 7 32 bit. Now, I am using 64 bit OS, I am not sure if the change of OS might be the problem. I hope it is not.

Best regards,
ryu
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Crystal Reports 9

Post by dutch »

Dear Ryu,

I used CR XI R2 with W10 32bits but when I change OS to W10 64bits, it doesn't work. I have to change viewer to CR XI R2 SP6 to support 64bits. I recommend to use CR XI R2 SP6 viewer.
ryugarai27 wrote:Hi Dutch,

Yes, I have used it in the past using Windows 7 32 bit. Now, I am using 64 bit OS, I am not sure if the change of OS might be the problem. I hope it is not.

Best regards,
ryu

Code: Select all

   TRY
    oCrystal:= CreateObject("CrystalRuntime.Application.11")    // Declare CreateObject
   CATCH oError
    lStart := .F.
    MsgAlert( oError:Description )
   END
   
   if lStart
    
       TRY
           oRpt    := oCrystal:OpenReport(cReport)          // Open Report
       CATCH oError
        lStart := .F.
        MsgAlert( oError:Description )
       END
    end 
        if lStart   
                   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 TITLE "Print and Preview"

                        oCRViewer := TActiveX():New( oWnd, "CrystalReports.ActiveXReportViewer" )  
                        oWnd:oClient := oCRViewer
                    
                        oCRViewer:ViewReport()
                   ACTIVATE WINDOW oWnd MAXIMIZED
        end
 
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Crystal Reports 9 (SOLVED)

Post by ryugarai27 »

Hi Dutch,

Reinstalling CR9 solved the problem, thanks for your help anyway. Will try CRXI in the future.

Best regards,
ryu
Post Reply