469,898 Members | 1,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Crystal Report Failed to Logon

Hello all,

I'm developing a web application using ASP.NET/VB.
I have problem in viewing my CR reports. It returns following exception when
I tried to view any CR report.

CrystalDecisions.CrystalReports.Engine.LogOnExcept ion: Logon failed

I found many similar problem in several .NET forums, and no working
solution.

Anyone can help?

Many thanks in advance,
andy
Nov 18 '05 #1
1 1863
It appears that the only way around this MAJOR BUG (I know, they call it a
security feature) is to pre-load the data into a dataset and set it as the
reports datasource. The big problem with this is that you need a typed
Dataset in your project & a bit of extra code to connect & fill the dataset.

For example, you add a new dataset item to your project.
Then you drag the table(s) you want to have in the report from the server
explorer onto your dataset design screen. Save when finished.
Now you can create your new report based on the dataset, (or change the
location on an old one). Just look for you dataset under the Project
Data->ADO.NET Datasets entry in the connection list. Make your report as
normal.
When you have the report ready, you will need to fill an in-memory dataset
variable with the actual data from the database and assign it as the
datasource for the report. (ie, YOU handle the database, NOT Crystal Reports)
Now you just set the reportsource of the viewer as normal.
Something like the following:

SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Data
Source=<mydbserver>;Initial Catalog=<mydatabase>");
SqlDataAdapter adap = new SqlDataAdapter("SELECT * FROM <sometable>", conn);
MyTypedDataSet data = new MyTypedDataSet();
adap.Fill(data);

MyReport rpt = new MyReport();
rpt.SetDataSource(data);
ReportViewer.ReportSource = rpt;

All Done!

I know the forgetting of database connection details is supposed to be a
security feature, but I find it weird that it 'forgets' the information even
when there is no information to forget. I have tried this with a few
databases (Access file, SQL Server, text file) in secure & unsecure formats
(ie, with & without passwords) on window & web forms.
My discovery is that the web forms version of the reports WILL NOT connect
to ANY database of ANY type/status/location AT ALL. Hence I call this a MAJOR
BUG.

If anyone has managed to get the Crystal Reports components working (as
intended by the documentation) in a web application (we'll try web services
later) please tell us how you did it!!!

"andy lim" wrote:
Hello all,

I'm developing a web application using ASP.NET/VB.
I have problem in viewing my CR reports. It returns following exception when
I tried to view any CR report.

CrystalDecisions.CrystalReports.Engine.LogOnExcept ion: Logon failed

I found many similar problem in several .NET forums, and no working
solution.

Anyone can help?

Many thanks in advance,
andy

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ambika Srinivasan | last post: by
1 post views Thread by Bob Skutnick | last post: by
2 posts views Thread by Tim Burda | last post: by
reply views Thread by Bonj | last post: by
2 posts views Thread by Karun Karunakaran | last post: by
3 posts views Thread by Milan Todorovic | last post: by
19 posts views Thread by Michael O'Donnell | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.