Crystal Report Error Message
-
I have a crystal report which was running fine but now gives me an error about logon failed and it highlights the following line: oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Here is the code I am using: Imports System.Web.Security Imports System.Data.SqlClient Imports System.DateTime Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Dim crpt28 As CrystalReport28 Dim crpt28 As CrystalReport28 Dim myTable As CrystalDecisions.CrystalReports.Engine.Table Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo Dim Param As SqlParameter Dim SqlCom As SqlCommand Dim sqlcon As New SqlConnection("Data Source=server;database=data;user id=user;password=pass") Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here crpt28 = New CrystalReport28 For Each myTable In crpt28.Database.Tables myLogin = myTable.LogOnInfo myLogin.ConnectionInfo.Password = "kris" myLogin.ConnectionInfo.UserID = "kris" myTable.ApplyLogOnInfo(myLogin) Next CrystalReportViewer1.ReportSource = crpt28 Dim oStream As New System.IO.MemoryStream oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(oStream.ToArray()) Response.End() Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString) End Try crpt28.Close() crpt28.Dispose() crpt28 = Nothing End Sub
-
I have a crystal report which was running fine but now gives me an error about logon failed and it highlights the following line: oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Here is the code I am using: Imports System.Web.Security Imports System.Data.SqlClient Imports System.DateTime Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Dim crpt28 As CrystalReport28 Dim crpt28 As CrystalReport28 Dim myTable As CrystalDecisions.CrystalReports.Engine.Table Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo Dim Param As SqlParameter Dim SqlCom As SqlCommand Dim sqlcon As New SqlConnection("Data Source=server;database=data;user id=user;password=pass") Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here crpt28 = New CrystalReport28 For Each myTable In crpt28.Database.Tables myLogin = myTable.LogOnInfo myLogin.ConnectionInfo.Password = "kris" myLogin.ConnectionInfo.UserID = "kris" myTable.ApplyLogOnInfo(myLogin) Next CrystalReportViewer1.ReportSource = crpt28 Dim oStream As New System.IO.MemoryStream oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(oStream.ToArray()) Response.End() Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString) End Try crpt28.Close() crpt28.Dispose() crpt28 = Nothing End Sub
macca24 wrote:
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Your db credentials that are being used are correct?
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
macca24 wrote:
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Your db credentials that are being used are correct?
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson