Skip to Content
0
Jun 25, 2018 at 06:13 AM

How To Email External Crystal Report PDF In SAP Business One SDK. Add on connection timed out Error.

182 Views Last edit Jun 25, 2018 at 09:09 AM 5 rev

Hello All,

Greetings !!!

I am Developing Add-on Which Sends Email With Following Two Report Selection Options.

  1. Selection Of Reports Which are Imported in SAP Business One Through Report and Layout Manager. DocCode Will be Used as Selection Parameters. - Its Working Fine.
  2. I had issue In Passing Selection Of Crystal Reports Path Which are not Stored in SAP Business One Database.

Kindly Guide me How To Pass Crystal Reports Path Which are not stored in SAP Business One Database.

I am Using Following Code.In Code Its Working Fine.But When I Test Add-on.Add-on connection timed out. Error Message Showing

Public Sub ExportReport(ByVal ReportPath As String, SQLUserName As String, ByVal SQLPassword As String, ByVal ServerName As String, ByVal DBName As String)
        Dim crReportDocument As New ReportDocument()
        Dim Param As Object = 1
        crReportDocument.Load(ReportPath)
        crReportDocument.SetDatabaseLogon(SQLUserName, SQLPassword, ServerName, DBName)
        crReportDocument.SetParameterValue("DocKey@", Param.ToString)
        crReportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, Left(ReportPath, ReportPath.Length - 4) & ".pdf")
        System.Diagnostics.Process.Start(Left(ReportPath, ReportPath.Length - 4) & ".pdf")
        crReportDocument.Dispose()
    End Sub

DLL's Used in Add-on are email-dlls.jpg and Other Supporting Class is mainclass.txt

Thanks and Regards,

Mahendrakumar

Attachments

email-dlls.jpg (16.3 kB)
mainclass.txt (24.7 kB)