|
-
Feb 9th, 2007, 05:05 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] How to get rid of the login box
Hello everybody,
I am using CR 10 with ASP.NET 1.1/MSSQL. Whenever I run the report from application, it first shows a page where it asks SQL Server username/password and then it shows the report. My report is directly connected to a View in the SQL Server database.
How can I get rid of this login box when the report is presented from the application?
Thanks.
-
Feb 9th, 2007, 06:22 AM
#2
Re: How to get rid of the login box
see my post http://www.vbforums.com/showthread.php?t=451212, you need to apply logon information to each table of the report.
"The dark side clouds everything. Impossible to see the future is."
-
Feb 12th, 2007, 04:58 AM
#3
Thread Starter
Frenzied Member
Re: How to get rid of the login box
Thanks a lot. I will try your code and will let you know.
-
Feb 19th, 2007, 07:00 AM
#4
Thread Starter
Frenzied Member
Re: How to get rid of the login box
I converted your code in C# and tried but getting logon failed exception. Here's the code.
Code:
Database crDatabase;
Tables crTables;
//CrystalDecisions.CrystalReports.Engine.Table crTable = new CrystalDecisions.CrystalReports.Engine.Table();
TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo;
ReportDocument crReportDocument = new ReportDocument();
crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "LOCALHOST";
crConnectionInfo.DatabaseName = "PCSNSurvey";
crConnectionInfo.UserID = "sa";
crConnectionInfo.Password = "sa";
crReportDocument.FileName = Server.MapPath("Reports/CustomerList.rpt");
crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;
foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
rptCustomerList.ReportSource = crReportDocument;
I am getting exception on the following line, however I am providing simple login credentials of my local pc.
crTable.ApplyLogOnInfo(crTableLogOnInfo);
Would you please help me out with this?
Thanks.
-
Feb 19th, 2007, 08:35 AM
#5
Thread Starter
Frenzied Member
Re: How to get rid of the login box
I am trying this code as well. It doesn't throw exception when report is loaded but shows report with old data. When I click Refresh, application blows up and says "Login failed.".
Code:
CrystalDecisions.CrystalReports.Engine.ReportDocument reportDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
reportDoc.FileName = Server.MapPath("Reports/CustomerList.rpt");
string serverName = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetServerName();
string databaseName = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetDatabaseName();
string userName = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetUserName();
string password = PCSN.SurveyApplication.BusinessLogicLayer.DatabaseInfo.GetPassword();
reportDoc.SetDatabaseLogon(userName,password,serverName,databaseName,true);
rptCustomerList.ReportSource = reportDoc;
Thanks.
-
Feb 20th, 2007, 01:35 AM
#6
Re: How to get rid of the login box
Basically login problem in the CR will occur when the report can not find the data table. I make a different code for this but it is VB.NET, Just read CR in VB.NET at my signature.
-
Feb 20th, 2007, 02:12 AM
#7
Thread Starter
Frenzied Member
Re: How to get rid of the login box
The problem was on my side. Basically I need to provide login information and survey name for DSN.
Thanks.
-
Feb 20th, 2007, 02:16 AM
#8
Re: How to get rid of the login box
 Originally Posted by usamaalam
The problem was on my side. Basically I need to provide login information and survey name for DSN.
Thanks.
Ok that is other matter, no idea about that.
-
Feb 20th, 2007, 02:23 AM
#9
Thread Starter
Frenzied Member
Re: [RESOLVED] How to get rid of the login box
Yes, basically reports were designed by some other developer and I didn't notice it is going to connect via DSN. Now I can use it from application without a login box.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|