Currently below piece of code is working fine if we call stored procedure from the CR 2008 report using RAS-SDK
but when I update it to command(PLSQL in report itself) its throwing me this error
error occured System.Runtime.InteropServices.COMException (0x80004005): Invalid pointer
Please suggest me how to update the below code so that it supports both kind of reports using command and
procedure
Working Code
Dim connInfo As CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo Dim crDatabase As Database Dim crTable As CrystalDecisions.ReportAppServer.DataDefModel.Table Dim crTables As CrystalDecisions.ReportAppServer.DataDefModel.Tables Try connInfo = _ReportDocument.DatabaseController.GetConnectionInfos(Nothing)(0).Clone(True) With connInfo .UserName = DbUserID .Password = DbPassword End With Dim li As PropertyBag = connInfo.Attributes("QE_LogonProperties") li("Server") = DbServerName li("Initial Catalog") = DatabaseName crDatabase = _ReportDocument.Database crTables = crDatabase.Tables For Each crTable In crTables Dim newTable As New CrystalDecisions.ReportAppServer.DataDefModel.Table Dim tablename As String = crTable.Name newTable = crTable.Clone(True) newTable.ConnectionInfo = connInfo Dim qualified_name As String = crTable.QualifiedName qualified_name = CType(connInfo.Attributes("QE_LogonProperties"), PropertyBag)("Initial Catalog").ToString() + qualified_name _ReportDocument.DatabaseController.SetTableLocation(crTable, newTable) Next
I used ReportClientDocument and passed values for ReportAppServer and .open(reportpath) and continued with
above piece of code
↧
Crystal reports 2008 changing from procedure to command using RAS SDk
↧