PDA

View Full Version : Logon Error in Crystal Reports .NET


Shajee_.net
04-18-04, 02:12 AM
Hi!

I am using crystal reports 9.1 in my asp . net application. Now when i am adding data to the report file(say CrystalReport1.rpt) by push method i.e through the crystal report designer and then exporting the file into pdf format it's working fine, the report is being saved as a pdf file into the specied location.

The other method i am using for generating the report is giving data to the report (crystalreport1.rpt) dynamically ,pull method i.e based upon certain conditions a sql query fetches data and feeds it into the report. so far so good ev'thing's working fine and CrystalReportViewer flawlesly generatess the report.

The problem arises when i am exporting this report into a pdf file. Upon hitting the Export Button an error is reported

The folowing error is shown


Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnExcept ion: Logon failed.

Source Error:

Line 126: report.ExportOptions.DestinationOptions = DiskOpts
Line 127: report.Refresh()
Line 128: report.Export()
Line 129:
Line 130: 'Catch ex As CrystalDecisions.CrystalReports.Engine.EngineExcep tion



Stack Trace:

[LogOnException: Logon failed.]
.F(String , EngineExceptionErrorID
) +506
.A(Int16 , Int32 ) +537
CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export(ExportRequestContext reqContext) +469
CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export() +107
CrystalDecisions.CrystalReports.Engine.ReportDocum ent.Export() +67
HSSTimeSheet.ReportTimeSheet.Button1_Click(Object sender, EventArgs e) in C:\Hanu Software Solutions\HSSTimeSheet\ReportTimeSheet.aspx.vb:128
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

curiouschris
05-11-04, 01:09 AM
I have just the same here, all works a treat on my development machines but run it on the target machines (it's a VB.NET desktop app) I get a 'logon failed' message when exporting either to PDF or to email - same error, same stack as above. Have checked all the privs etc., no joy though, have been bashing my head against this one for a few weeks now !

Any help much appreciated,

Chris

jonemma
05-20-04, 03:01 AM
Me to - only with asp.net. On my local machine it works fine but on our Dev server I get:

CrystalDecisions.CrystalReports.Engine.LogOnExcept ion: Logon failed.

I am also head banging here!



I have just the same here, all works a treat on my development machines but run it on the target machines (it's a VB.NET desktop app) I get a 'logon failed' message when exporting either to PDF or to email - same error, same stack as above. Have checked all the privs etc., no joy though, have been bashing my head against this one for a few weeks now !

Any help much appreciated,

Chris

lamar
09-06-04, 07:44 AM
We encountered the same error on .NET 1.1 using Crystal Reports runtime for .NET 1.0 (DevEnv 2002).
We fixed it by installing Crystal Reports runtime for .NET 1.1 (DevEnv 2003).

jobo
03-15-05, 04:24 PM
I looked under add/remove programs for Crystal and DevEnv to see what my version was. I didn't see it listed. I'm using Visual Studio .NET 2003 with the Crystal Reports designer included with VS. How can I tell if I have this issue?

We encountered the same error on .NET 1.1 using Crystal Reports runtime for .NET 1.0 (DevEnv 2002).
We fixed it by installing Crystal Reports runtime for .NET 1.1 (DevEnv 2003).

Thanks,
Joe

Explorer
04-08-05, 09:08 AM
When I first started using Crystal Reports .NET, I encountered the same issue. I could create the report, and run it, pointing to a SQL Server on my local machine, it worked fine. When I pointed it to a different server, or, migrated my web application to a different server, I received the login failure.

In my case, this had to do with the account that Crystal reports used to access the SQL Server. It was a local machine account that has administrative rights on my local SQL Server, but not on the dev server.

What I was trying to do was to take a report that was created from a stored procedure, and pass a dataset to it. Basically, we were trying to print from an ADO.net dataset.

My workaround was to use the dataset to create an XML file. I would then use the XML file to create the Crystal Report (in CR.NET, you can use XML as a database). Because I didn't need to access a SQL Server to create the report originally, it wouldn't try to use any credentials later. I could pass it the dataset with no problems (I didn't even need the XML file).

I hope this works.

Paul Hammond
Covenant Web Design
http://www.covenantwebdesign.com

suzett
07-20-08, 07:00 AM
you can pass logon information dynamicall y and trace it out.


http://vb.net-informations.com/crystal-report/vb.net_crystal_report_load_dynamically.htm


Dim cryRpt As New ReportDocument
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table

cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")

With crConnectionInfo
.ServerName = "YOUR SERVER NAME"
.DatabaseName = "YOUR DATABASE NAME"
.UserID = "YOUR DATABASE USERNAME"
.Password = "YOUR DATABASE PASSWORD"
End With

CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next

http://vb.net-informations.com/crystal-report/vb.net_crystal_report_load_dynamically.htm

suzet

vedrajan
07-24-08, 01:34 AM
<CR:CrystalReportViewer ID="CrystalReportViewer1" EnableDatabaseLogonPrompt="false" runat="server" AutoDataBind="true" Width ="95%" DisplayGroupTree="False" />

modify ur Crystal report viewer as above code.Reply if works.