473,542 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:
CrystalDecision s.CrystalReport s.Engine.LogOnE xception: 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 2849
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.Databa se.Tables(0).Se tDataSource(dat atable);

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

Elton Wang
el********@hotm ail.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 theCrystalViewe r 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;3192 64&sd=msdn
even with that information from Microsoft, I still cannot get the stupidthing to work. still get the error Exception Details:
CrystalDecisio ns.CrystalRepor ts.Engine.LogOn Exception: 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 crReportDocumen t = new ReportDocument( );
string strPath;

strPath = Server.MapPath( "Reports\\Cryst alReport1.rpt") ;
string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection(C onfigurationSet tings.AppSettin gs["ConnectionStri ng"]);
conPubs.Open();
SqlCommand cmd = new SqlCommand(sele ct,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteRead er();

strPath = Server.MapPath( "Reports\\Cryst alReport1.rpt") ;
crReportDocumen t.Load(strPath) ;
crReportDocumen t.SetDataSource (dtrUsers);

BUT THIS WORKED:

ReportDocument crReportDocumen t = new ReportDocument( );
string strPath;

strPath = Server.MapPath( "Reports\\Cryst alReport1.rpt") ;
string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection(C onfigurationSet tings.AppSettin gs["ConnectionStri ng"]);
conPubs.Open();
SqlCommand cmd = new SqlCommand(sele ct,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteRead er();

strPath = Server.MapPath( "Reports\\Cryst alReport1.rpt") ;
crReportDocumen t.Load(strPath) ;
crReportDocumen t.SetDataSource (dtrUsers);

crConnectionInf o.ServerName = "Roma";
crConnectionInf o.DatabaseName = "ProjectManagem ent";
crConnectionInf o.
crConnectionInf o.UserID = "sa";
crConnectionInf o.Password = "Pioneer#ca ke";
crDatabase = crReportDocumen t.Database;
crTables = crDatabase.Tabl es;

foreach(Crystal Decisions.Cryst alReports.Engin e.Table crTable in crTables)
{
crTableLogOnInf o = crTable.LogOnIn fo;
crTableLogOnInf o.ConnectionInf o = crConnectionInf o;
crTable.ApplyLo gOnInfo(crTable LogOnInfo);
}

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*******@disc ussions.microso ft.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.Databa se.Tables(0).Se tDataSource(dat atable);

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

Elton Wang
el********@hotm ail.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
CrystalView er 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;3192 64&sd=msdn

even with that information from Microsoft, I still cannot

get the stupid
thing to work. still get the error Exception Details:
CrystalDecisi ons.CrystalRepo rts.Engine.LogO nException:

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 crReportDocumen t = new ReportDocument( );
string strPath;

strPath = Server.MapPath ("Reports\\Crys talReport1.rpt" ); string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection( ConfigurationSe ttings.AppSetti ngs ["ConnectionStri ng"]); conPubs.Open();
SqlCommand cmd = new SqlCommand(sele ct,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteRead er();

strPath = Server.MapPath ("Reports\\Crys talReport1.rpt" ); crReportDocumen t.Load(strPath) ;
crReportDocumen t.SetDataSource (dtrUsers);

BUT THIS WORKED:

ReportDocument crReportDocumen t = new ReportDocument( );
string strPath;

strPath = Server.MapPath ("Reports\\Crys talReport1.rpt" ); string select = "SELECT * FROM Security";
SqlConnection conPubs = new
SqlConnection( ConfigurationSe ttings.AppSetti ngs ["ConnectionStri ng"]); conPubs.Open();
SqlCommand cmd = new SqlCommand(sele ct,conPubs);
SqlDataReader dtrUsers = cmd.ExecuteRead er();

strPath = Server.MapPath ("Reports\\Crys talReport1.rpt" ); crReportDocumen t.Load(strPath) ;
crReportDocumen t.SetDataSource (dtrUsers);

crConnectionInf o.ServerName = "Roma";
crConnectionInf o.DatabaseName = "ProjectManagem ent";
crConnectionInf o.
crConnectionInf o.UserID = "sa";
crConnectionInf o.Password = "Pioneer#ca ke";
crDatabase = crReportDocumen t.Database;
crTables = crDatabase.Tabl es;

foreach(Crystal Decisions.Cryst alReports.Engin e.Table crTable in crTables) {
crTableLogOnInf o = crTable.LogOnIn fo;
crTableLogOnInf o.ConnectionInf o = crConnectionInf o;
crTable.ApplyLo gOnInfo(crTable LogOnInfo);
}

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*******@disc ussions.microso ft.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.Databa se.Tables(0).Se tDataSource(dat atable);

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

Elton Wang
el********@hotm ail.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
CrystalViewe r Web Component. First of all, I have been

using Trusted
Connection s 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;3192 64&sd=msdn

even with that information from Microsoft, I still
cannot get the stupid
thing to work. still get the error Exception Details:
CrystalDecis ions.CrystalRep orts.Engine.Log OnException:

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
dynamicall y 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
19136
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 Report at runtime? Example: private void button1_Click(object sender,
5
3003
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 for reporting purposes and am wondering if anyone knows if this is easily accomplished using the .NET version of Crystal Reports? For example, the...
3
6888
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
4982
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. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version,...
0
2320
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 (ASP.NET) that shows a simple report. It work fine with on my local computer. Now I'm trying to deploy this sample application on our web server but I...
3
8911
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 from sql server) and I was wondering whish of these is the better tool .. We're still not sure if they'll be loaded from an existing VB6 application...
1
4300
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 ExcelUseConstantColumnWidth = False. On my PC when exporting a report, it works - columns are varible width to fit the field, from the server it does not - I get constant...
2
446
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 interested in using crystal reports as a web based reporting tool to get data out of a sql server database and we have always created our own...
3
3802
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 dataset and link it to a reportviewer than any Crystal Report book will do. I use vb.net but im assuming most books would show you vb and c
1
8119
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 file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but...
0
7392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5246
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1798
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.