I am generating a Crystal report in an asp.net application and keep getting the following error message when I try to export the report to pdf format.
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed
I have crawled everywhere on the web and have found a lot written about this problem but all info relates to binding your report to sql server. In my case I am binding to an xml file.
It is driving me insane !!!
If I just display the crystal report in a viewer on a webpage it works fine. Its only when I try to export it that I have the problem.![]()
Heres my code :
Code:Dim crReportDocument As ReportDocument Dim crExportOptions As exportoptions Dim crDiskFileDestinationOptions As diskfiledestinationoptions Dim Fname As String crReportDocument = New ReportDocument crReportDocument.Load("C:\inetpub\wwwroot\TTPresentation\reports\timesheetReport1.rpt") Fname = "C:\inetpub\wwwroot\TTPresentation\reports\" & "test" & ".pdf" crDiskFileDestinationOptions = New DiskFileDestinationOptions crDiskFileDestinationOptions.DiskFileName = Fname crExportOptions = crReportDocument.ExportOptions With crExportOptions .DestinationOptions = crDiskFileDestinationOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat End With crReportDocument.Export() Response.ClearContent() Response.ClearHeaders() Response.ContentType = "application/pdf" Response.WriteFile(Fname) Response.Flush() Response.Close() System.IO.File.Delete(Fname)
I beg of you. Help me or put me out of my misery.



Reply With Quote