on 11-25-2015 3:35 PM
Hi Experts,
I am trying to export the Crystal report using the following source code.
Try
Dim objRecSet As SAPbobsCOM.Recordset
Dim strSQL, strFolder As String
Dim objFSO
Dim CryRpt As ReportDocument
CryRpt = New ReportDocument
objRecSet = objSBOAPI.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
strSQL = "select * from [@ZAM_SRVPSWD]"
objRecSet.DoQuery(strSQL)
If objRecSet.RecordCount > 0 Then
strFolder = objRecSet.Fields.Item("U_Path").Value
objFSO = CreateObject("Scripting.FileSystemObject")
CryRpt.Load("Voucher.rpt")
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues
crParameterFieldDefinitions = CryRpt.DataDefinition.ParameterFields
crParameterFieldLocation = crParameterFieldDefinitions.Item("DocKey@")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = objform.Items.Item("Item_4_U_G").Specific.value
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crParameterValues)
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
With crConnectionInfo
.ServerName = objSBOAPI.oCompany.Server
.DatabaseName = objSBOAPI.oCompany.CompanyDB
.UserID = objRecSet.Fields.Item("U_username").Value
.Password = objRecSet.Fields.Item("U_password").Value
End With
CrTables = CryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New _
DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
Dim strNo As String = objform.Items.Item("Item_4_U_G").Specific.value
Dim strFolderPath As String
strFolderPath = strFolder & "\" '+"\" + objRecSet.Fields.Item("CardName").Value &"\"
If Not objFSO.FolderExists(strFolderPath) Then
objFSO.CreateFolder(strFolderPath)
End If
CrDiskFileDestinationOptions.DiskFileName = _
strFolderPath + strNo & ".pdf"
CrExportOptions = CryRpt.ExportOptions
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
CryRpt.Export()
Dim strPDFFileName As String
strPDFFileName = strFolderPath + strNo & ".pdf"
releaseObject(CryRpt)
GC.Collect()
End If
Catch ex As Exception
objSBOAPI.SBO_Appln.MessageBox(ex.ToString)
End Try
When I execute the addon on the client of the server the report successfully exported, but when is executed on a client I am getting the Error: "The database DLL 'crdb_b1.dll' could not be loaded" At the CryRpt.Export() command
We have already check the threat The database DLL 'crdb_b1.dll' could not be loaded | SCN
We are using
SAP Business One 9.0 PL: 13 and Crystal Report 2013
Please Advice
Kind regards
Vasilis Korolis
Moved to the B1 forum
Are you using the CR 2013 downloaded from B1 Site? If not that would be why. Standard CRD versions do not install that driver.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Don,
Thank you for your reply,
We are using Crystal Reports 2013 and we have already installed the (Support Pack 15 v.13.0.15.1840) .msi according to this link
Kind Regards
Vasilis Korolis
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.