473,420 Members | 2,907 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,420 software developers and data experts.

Crystal report help please

Hi,

am using crystal report in my c#.net

The report was initially designed with the RDO Connection and uses the
stroed proc,This sp requires 4 parameters.In my c# web app , i simply
included the report(.rpt) file and made an object for that and am
passing the parameters.Finally it gives the error message as,

LOGON FAILED.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

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

--------------------My code----------------
rpt_proc_auditlog rpt=new rpt_proc_auditlog();
TableLogOnInfo loginfo=new TableLogOnInfo();
ConnectionInfo coninfo=new ConnectionInfo();
Database crDatabase;
Tables crTables;
//Table crTable;
crDatabase=rpt.Database;
coninfo.ServerName="TCMS";
coninfo.UserID="TCMS_DATA";
coninfo.Password="SOCOOL";
coninfo.DatabaseName ="TCMS_DATA";
crDatabase=rpt.Database;
crTables=crDatabase.Tables;
foreach(CrystalDecisions.CrystalReports.Engine.Tab le crTable in
crTables)
{
loginfo = crTable.LogOnInfo;
loginfo.ConnectionInfo = coninfo;
crTable.ApplyLogOnInfo(loginfo);
}
//rpt.SetDatabaseLogon("TCMS_DATA","SOCOOL","TCMS"," TCMS_DATA");
rpt.SetParameterValue("sDisplayLabel","Header");
rpt.SetParameterValue("STABLENAME","MASTERPHYS");
rpt.SetParameterValue("NPKID",Convert.ToInt16("366 4"));
CREP.ReportSource=rpt;
--------------
cOULD YOU PLEASE TELL ME THE MISTAKE I MADE.
With thanks
Raghu


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
1 1453
Hi Raghu,

Although I'm not sure what reason causes the problem, you
may solve it in another way:

Directly use SqlDataAdapter and SqlCommand to fill data to
DataTable (or DataTables, if the report requires multi-
tables), Then set data source of report:
rpt.Database.Tables[0].SetDataSource(table0);
..
rpt.Database.Tables[i].SetDataSource(tableI);

In this way, you don't need worry about Logon info any
more.

Hope it's helpful.

Elton Wang

el********@hotmail.com
-----Original Message-----
Hi,

am using crystal report in my c#.net

The report was initially designed with the RDO Connection and uses thestroed proc,This sp requires 4 parameters.In my c# web app , i simplyincluded the report(.rpt) file and made an object for that and ampassing the parameters.Finally it gives the error message as,
LOGON FAILED.

Description: An unhandled exception occurred during the execution of thecurrent web request. Please review the stack trace for more informationabout the error and where it originated in the code.

Exception Details:
CrystalDecisions.CrystalReports.Engine.LogOnExcep tion: Logon failed.
--------------------My code----------------
rpt_proc_auditlog rpt=new rpt_proc_auditlog();
TableLogOnInfo loginfo=new TableLogOnInfo();
ConnectionInfo coninfo=new ConnectionInfo();
Database crDatabase;
Tables crTables;
//Table crTable;
crDatabase=rpt.Database;
coninfo.ServerName="TCMS";
coninfo.UserID="TCMS_DATA";
coninfo.Password="SOCOOL";
coninfo.DatabaseName ="TCMS_DATA";
crDatabase=rpt.Database;
crTables=crDatabase.Tables;
foreach(CrystalDecisions.CrystalReports.Engine.Ta ble crTable incrTables)
{
loginfo = crTable.LogOnInfo;
loginfo.ConnectionInfo = coninfo;
crTable.ApplyLogOnInfo(loginfo);
}
//rpt.SetDatabaseLogon ("TCMS_DATA","SOCOOL","TCMS","TCMS_DATA");rpt.SetParameterValue("sDisplayLabel","Header") ;
rpt.SetParameterValue("STABLENAME","MASTERPHYS" );
rpt.SetParameterValue("NPKID",Convert.ToInt16("36 64"));
CREP.ReportSource=rpt;
--------------
cOULD YOU PLEASE TELL ME THE MISTAKE I MADE.
With thanks
Raghu


*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Nov 19 '05 #2

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: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When...
1
by: Sachin | last post by:
Hi, I am working on ASP.Net 2.0 Beta 2 I am having problems creating crystal report using dataset I created a new dataset (DS_ExpCode) and a datatable (DT_ExpCode) under App_Code folder....
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...
2
by: microsoft . public . sqlserver | last post by:
I am a Web developer. I am new to VB 6.0 and Crystal Report. I have joined an organisation where there is an application running(developed in VB6 and crystal report 7). I have to modify one report....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
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...

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.