on 08-21-2008 4:56 AM
I am developing reports on Crystal Reports XI R2, VS.NET 2005 , SQL Server 2000, C#.
I am getting Database Logon Failed when I click on a drill down link in the report. It works if I click on the drill down link with in a minute. But if I wait for a minute and click on drill down, I am getting Database Logon Failed
Error in Crystal report viewer14
Object reference not set to an instance of an object
Any help would be greatly appreciated.
Thanks,
Sailu
Hi,
Please try setting database logon following way
reportDocObj.setdatabaselogon("Username","password")
and also try to add this code in post back event.
Thanks,
Prasad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above code should be written after the loading of report.
For example-
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if (!IsPostBack)
{
crReport.Load(Server.MapPath("CrystalReport1.rpt"));
ConnectionInfo crConn= new ConnectionInfo();
crConn.ServerName="D-3271-SQL";
crConn.DatabaseName="Northwind";
crConn.UserID="sa";
crConn.Password="sa";
Tables crTables=crReport.Database.Tables;
foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{
TableLogOnInfo crLogoninfo=crTable.LogOnInfo;
crLogoninfo.ConnectionInfo =crConn;
crTable.ApplyLogOnInfo(crLogoninfo);
}
}
CrystalReportViewer1.ReportSource =crReport;
}
I hope this help
Regards
Amit
Edited by: Amit Singh on Aug 21, 2008 4:48 PM
User | Count |
---|---|
76 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.