473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Crystal Reports

I have come across lots of information regarding this, but nothing seems to
work. I have created a Crystal Report that access's a SQL server backend for
the data, and I want to display the report via a webform and the
CrystalViewer Web Component. First of all, I have been using Trusted
Connections so far (for data access) and really do not want to have some
static login information in my web app. but most of the documents so far
have indicated this has to be the case (for use with a SQL Server Backend).

http://support.microsoft.com/default...319264&sd=msdn

even with that information from Microsoft, I still cannot get the stupid
thing to work. still get the error Exception Details:
CrystalDecisions.CrystalReports.Engine.LogOnExcept ion: Logon failed

If I setup my crystal report to access certain info from a table called
mytable, can I use the same SQL String in a dataset and bind the dataset to
the report. Would this work? or is binding a dataset to a report for
dynamically creating a report (I would like to format the report visually).
Can anyone point me in the right direction here. Thank you
Nov 19 '05 #1
3 2827
Hi Shawn,

In my experience, a CR report in .NET doesn't have to have
log on info for get data from database. You can fill the
datatable first then use datatable as CR report's data
source, e.g.

crReport.Database.Tables(0).SetDataSource(datatabl e);

But some people reported that this approach has poor
performance when loading large amount data.
HTH

Elton Wang
el********@hotmail.com
-----Original Message-----
I have come across lots of information regarding this, but nothing seems towork. I have created a Crystal Report that access's a SQL server backend forthe data, and I want to display the report via a webform and theCrystalViewer Web Component. First of all, I have been using TrustedConnections so far (for data access) and really do not want to have somestatic login information in my web app. but most of the documents so farhave indicated this has to be the case (for use with a SQL Server Backend).
http://support.microsoft.com/default.aspx? scid=kb;en;319264&sd=msdn
even with that information from Microsoft, I still cannot get the stupidthing to work. still get the error Exception Details:
CrystalDecisions.CrystalReports.Engine.LogOnExcep tion: Logon failed
If I setup my crystal report to access certain info from a table calledmytable, can I use the same SQL String in a dataset and bind the dataset tothe report. Would this work? or is binding a dataset to a report fordynamically creating a report (I would like to format the report visually).Can anyone point me in the right direction here. Thank you

.

Nov 19 '05 #2
No Luck. I coded to open a dataset, I got the info from the database without
problems, and set the datasource for the report to my dataset. It didn't
work until I supplied Logon info again.

This didn't work:
ReportDocument crReportDocument = new ReportDocument();
string strPath;

strPath = Server.MapPath("Reports\\CrystalReport1.rpt");
string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
conPubs.Open();
SqlCommand cmd = new SqlCommand(select,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteReader();

strPath = Server.MapPath("Reports\\CrystalReport1.rpt");
crReportDocument.Load(strPath);
crReportDocument.SetDataSource(dtrUsers);

BUT THIS WORKED:

ReportDocument crReportDocument = new ReportDocument();
string strPath;

strPath = Server.MapPath("Reports\\CrystalReport1.rpt");
string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
conPubs.Open();
SqlCommand cmd = new SqlCommand(select,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteReader();

strPath = Server.MapPath("Reports\\CrystalReport1.rpt");
crReportDocument.Load(strPath);
crReportDocument.SetDataSource(dtrUsers);

crConnectionInfo.ServerName = "Roma";
crConnectionInfo.DatabaseName = "ProjectManagement";
crConnectionInfo.
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "Pioneer#cake";
crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;

foreach(CrystalDecisions.CrystalReports.Engine.Tab le crTable in crTables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}

It seems to only work when supplied with a username and password. Like I
said before, I have found many docs saying you cannot use trusted
connections with Microsoft SQL Server. I am just looking for code to
actually accomplish this. I have gotten code to work no problem with MS
Access, etc.. Thanks for your help

"Elton Wang" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
Hi Shawn,

In my experience, a CR report in .NET doesn't have to have
log on info for get data from database. You can fill the
datatable first then use datatable as CR report's data
source, e.g.

crReport.Database.Tables(0).SetDataSource(datatabl e);

But some people reported that this approach has poor
performance when loading large amount data.
HTH

Elton Wang
el********@hotmail.com
-----Original Message-----
I have come across lots of information regarding this,

but nothing seems to
work. I have created a Crystal Report that access's a SQL

server backend for
the data, and I want to display the report via a webform

and the
CrystalViewer Web Component. First of all, I have been

using Trusted
Connections so far (for data access) and really do not

want to have some
static login information in my web app. but most of the

documents so far
have indicated this has to be the case (for use with a

SQL Server Backend).

http://support.microsoft.com/default.aspx?

scid=kb;en;319264&sd=msdn

even with that information from Microsoft, I still cannot

get the stupid
thing to work. still get the error Exception Details:
CrystalDecisions.CrystalReports.Engine.LogOnExce ption:

Logon failed

If I setup my crystal report to access certain info from

a table called
mytable, can I use the same SQL String in a dataset and

bind the dataset to
the report. Would this work? or is binding a dataset to a

report for
dynamically creating a report (I would like to format the

report visually).
Can anyone point me in the right direction here. Thank

you


.

Nov 19 '05 #3
That's true. Logon info definitely works. And I think if
you already provide logon info, it's not necessary to use
datareader any more.

Sometimes dataset works, but mostly it only works by using
individual datatables.

Elton Wang

-----Original Message-----
No Luck. I coded to open a dataset, I got the info from the database withoutproblems, and set the datasource for the report to my dataset. It didn'twork until I supplied Logon info again.

This didn't work:
ReportDocument crReportDocument = new ReportDocument();
string strPath;

strPath = Server.MapPath ("Reports\\CrystalReport1.rpt"); string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection(ConfigurationSettings.AppSettings ["ConnectionString"]); conPubs.Open();
SqlCommand cmd = new SqlCommand(select,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteReader();

strPath = Server.MapPath ("Reports\\CrystalReport1.rpt"); crReportDocument.Load(strPath);
crReportDocument.SetDataSource(dtrUsers);

BUT THIS WORKED:

ReportDocument crReportDocument = new ReportDocument();
string strPath;

strPath = Server.MapPath ("Reports\\CrystalReport1.rpt"); string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection(ConfigurationSettings.AppSettings ["ConnectionString"]); conPubs.Open();
SqlCommand cmd = new SqlCommand(select,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteReader();

strPath = Server.MapPath ("Reports\\CrystalReport1.rpt"); crReportDocument.Load(strPath);
crReportDocument.SetDataSource(dtrUsers);

crConnectionInfo.ServerName = "Roma";
crConnectionInfo.DatabaseName = "ProjectManagement";
crConnectionInfo.
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "Pioneer#cake";
crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;

foreach(CrystalDecisions.CrystalReports.Engine.Tab le crTable in crTables) {
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}

It seems to only work when supplied with a username and password. Like Isaid before, I have found many docs saying you cannot use trustedconnections with Microsoft SQL Server. I am just looking for code toactually accomplish this. I have gotten code to work no problem with MSAccess, etc.. Thanks for your help

"Elton Wang" <an*******@discussions.microsoft.com> wrote in messagenews:01****************************@phx.gbl...
Hi Shawn,

In my experience, a CR report in .NET doesn't have to have log on info for get data from database. You can fill the
datatable first then use datatable as CR report's data
source, e.g.

crReport.Database.Tables(0).SetDataSource(datatabl e);

But some people reported that this approach has poor
performance when loading large amount data.
HTH

Elton Wang
el********@hotmail.com
-----Original Message-----
I have come across lots of information regarding this,

but nothing seems to
work. I have created a Crystal Report that access's a
SQL server backend for
the data, and I want to display the report via a webform

and the
CrystalViewer Web Component. First of all, I have been

using Trusted
Connections so far (for data access) and really do not

want to have some
static login information in my web app. but most of the

documents so far
have indicated this has to be the case (for use with a

SQL Server Backend).

http://support.microsoft.com/default.aspx?

scid=kb;en;319264&sd=msdn

even with that information from Microsoft, I still
cannot get the stupid
thing to work. still get the error Exception Details:
CrystalDecisions.CrystalReports.Engine.LogOnExc eption:

Logon failed

If I setup my crystal report to access certain info from

a table called
mytable, can I use the same SQL String in a dataset and

bind the dataset to
the report. Would this work? or is binding a dataset to
a report for
dynamically creating a report (I would like to format
the report visually).
Can anyone point me in the right direction here. Thank

you


.

.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
0
by: Robert Warnestam | last post by:
Hello, I have some problems deploying Crystal Reports. I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports (9.7.3500.0) is included. I created a small test application...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
1
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is...
2
by: =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post by:
Hi I am interested in using crystal reports for the first time but have a few questions that someone maybe able to help with before I get started. The background to my query is that a client is...
3
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.