L
Learner
Hi there,
I am trying to export a Crystal Report from my ASP.NET webform. I
have no problem in rendering the report and that part went pretty
smooth. But When i click on the button( i provided a button next to the
viewer control on the .aspx page to handle the export functionality)
its complaining about the logon error!
Here is how i am trying to accomplish the export to rtf/pdf
****************************************
Private Sub CRExport_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CRExport.Click
Dim Stream As New MemoryStream
Dim rpt As New InspectorPayReport
rpt.SetDatabaseLogon("sa", "fishing", "(local)", "aisinspect")
Try
Stream =
rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
'Response.ContentType = "application/pdf"
Response.ContentType = "application/rtf"
Response.BinaryWrite(Stream.ToArray())
Response.End()
Catch ex As Exception
End Try
End Sub
********************************
Below is the exception its throwing at the line
Stream =
rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.WordForWindows)
in the CRExport_click event.
?ex
{CrystalDecisions.CrystalReports.Engine.LogOnException}
[CrystalDecisions.CrystalReports.Engine.LogOnException]:
{CrystalDecisions.CrystalReports.Engine.LogOnException}
HelpLink: Nothing
InnerException: Nothing
Message: "Logon failed."
Source: "CrystalDecisions.CrystalReports.Engine"
StackTrace: " at .I(String , EngineExceptionErrorID )
at .D(Int16 , Int32 )
at .C(Int16 )
at
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext
reqContext)
at
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType
formatType)
at Invoicing_GMAC_US.InspectPayReport.CRExport_Click(Object sender,
EventArgs e) in
C:\Inetpub\wwwroot\INVOICING_GMAC_US\InspectPayReport.aspx.vb:line 126"
TargetSite: {System.Reflection.RuntimeMethodInfo}
Any help is greatly appriciated.
Thanks
-L
I am trying to export a Crystal Report from my ASP.NET webform. I
have no problem in rendering the report and that part went pretty
smooth. But When i click on the button( i provided a button next to the
viewer control on the .aspx page to handle the export functionality)
its complaining about the logon error!
Here is how i am trying to accomplish the export to rtf/pdf
****************************************
Private Sub CRExport_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CRExport.Click
Dim Stream As New MemoryStream
Dim rpt As New InspectorPayReport
rpt.SetDatabaseLogon("sa", "fishing", "(local)", "aisinspect")
Try
Stream =
rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer = True
'Response.ContentType = "application/pdf"
Response.ContentType = "application/rtf"
Response.BinaryWrite(Stream.ToArray())
Response.End()
Catch ex As Exception
End Try
End Sub
********************************
Below is the exception its throwing at the line
Stream =
rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.WordForWindows)
in the CRExport_click event.
?ex
{CrystalDecisions.CrystalReports.Engine.LogOnException}
[CrystalDecisions.CrystalReports.Engine.LogOnException]:
{CrystalDecisions.CrystalReports.Engine.LogOnException}
HelpLink: Nothing
InnerException: Nothing
Message: "Logon failed."
Source: "CrystalDecisions.CrystalReports.Engine"
StackTrace: " at .I(String , EngineExceptionErrorID )
at .D(Int16 , Int32 )
at .C(Int16 )
at
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext
reqContext)
at
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType
formatType)
at Invoicing_GMAC_US.InspectPayReport.CRExport_Click(Object sender,
EventArgs e) in
C:\Inetpub\wwwroot\INVOICING_GMAC_US\InspectPayReport.aspx.vb:line 126"
TargetSite: {System.Reflection.RuntimeMethodInfo}
Any help is greatly appriciated.
Thanks
-L