How to debug ConnectionInfo CrystalReportViewer

Posted by goo on 26-Jan-2018 08:08

11.7

I am trying to setup a CrystalReportViewer using info: https://knowledgebase.progress.com/articles/Article/P145747

I have created a procedure, and produced a CR that runs from withing CrystalReport. It uses ODBC.

When running the code, it gives me the input screen for parameters, but when I try to run it, it gives me a dialog-box with 

"Could not open the connection <reportname> .... <a guid>.rpt

I believe it has to do with the connection, but I am not sure.

The dialog-box comes after 

crystalReportViewer1:RefreshReport().

Before that I have done this:

DSN = "DRIVER=" + ODBC + ";HOST=" + Servernavn + ";PORT=" + Port + ";DB=" + Databasenavn + ";UID=" + Bruker + ";PWD=" + Passord.
tblLogonInfo = NEW CrystalDecisions.Shared.TableLogOnInfo().
DO i = 0 TO crwReport:Database:Tables:Count - 1:
  crRptTable = crwReport:Database:Tables[i].   
  tblLogonInfo = crRptTable:LogOnInfo.
  tblLogonInfo:ConnectionInfo:ServerName = DSN.
  tblLogonInfo:ConnectionInfo:UserID          = Bruker.
  tblLogonInfo:ConnectionInfo:Password     = Passord.
crRptTable:ApplyLogOnInfo(tblLogonInfo).

END.

The password is blank (it works from CrystalReport.. and from ODBC setup (x32).

DSN looks like this:

DRIVER=baaaf;HOST=10.nnn.nnn.123;PORT=2017;DB=rapport;UID=administrator;PWS=

How can I debug this?

//Geir Otto

Posted by goo on 29-Jan-2018 04:58

Time to close this...

All Replies

Posted by goo on 26-Jan-2018 09:24

If I do this:

 I will get the folllowing error: 

Kan ikke åpne forbindelsen (Can't open the connection)

 METHOD PUBLIC VOID ApplyLoginInfo(  ):

   def var i as int no-undo.

   /* Create an ODBC DSN */

   DSN = "DRIVER=" + ODBC + ";HOST=" + Servernavn + ";PORT=" + Port + ";DB=" + Databasenavn + ";UID=" + Bruker /*+ ";PWD=" + Passord*/.

   Info = NEW CrystalDecisions.Shared.TableLogOnInfo().

   DO i = 0 TO crwReport:Database:Tables:Count - 1:

     crRptTable = crwReport:Database:Tables[i].  

     Info = crRptTable:LogOnInfo.

     Info:ConnectionInfo:AllowCustomConnection = true.

     Info:ConnectionInfo:ServerName = DSN.

     Info:ConnectionInfo:DatabaseName = Databasenavn.

     Info:ConnectionInfo:UserID = Bruker.

     Info:ConnectionInfo:Password = Passord.

     crRptTable:ApplyLogOnInfo(Info).

     crRptTable:Location = crRptTable:Location.

   END.  

   MESSAGE 'Test:' crRptTable:TestConnectivity()

   VIEW-AS ALERT-BOX.

/*    crwReport:SetDatabaseLogon(Bruker, '', ServerNavn, DatabaseNavn, true).*/

   CATCH eAny AS Progress.Lang.Error :

       MESSAGE eAny:GetMessage(1)

       VIEW-AS ALERT-BOX.

   END CATCH.

 END METHOD.

Posted by goo on 29-Jan-2018 04:58

Time to close this...

This thread is closed