| Learner 2006-01-19, 7:10 pm |
| 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 =3D
rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.WordForWindows)
Response.Clear()
Response.Buffer =3D True
'Response.ContentType =3D "application/pdf"
Response.ContentType =3D "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 =3D
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(ExportRe=
=ADquestContext
reqContext)
at
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(Export=
=ADFormatType
formatType)
at Invoicing_GMAC_US.InspectPayReport.CRExport_Click(Object sender,
EventArgs e) in
C:\Inetpub\wwwroot\INVOICING_GMAC_US\Ins
pectPayReport.aspx.vb:line 126"
TargetSite: {System.Reflection.RuntimeMethodInfo}
Any help is greatly appriciated.=20
Thanks=20
-L
|