0
votes

Why I am still getting user and password prompt on second page in below procedure when executing crystal reports in VS2010 asp.net. There is no prompt on first page when I click next in viewer it then ask for user id and password.

public void connectCrystal(ReportDocument repdoc)
{
    ReportDocument rptDoc = new ReportDocument();
    ConnectionInfo conInfo = new ConnectionInfo();
    rptDoc.Load(Server.MapPath("") + "\\Crystal_Reports\\ABC.rpt");

    ConnectionInfo conInfo = new ConnectionInfo();
    conInfo.ServerName = "S1";
    conInfo.DatabaseName = "CR";
    conInfo.UserID = "USER1";
    conInfo.Password = "1234";

    Tables tables = rptDoc.Database.Tables;
    foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
    {
        TableLogOnInfo tableLogonInfo = table.LogOnInfo;
        tableLogonInfo.ConnectionInfo = conInfo;
        table.ApplyLogOnInfo(tableLogonInfo);
    }
    crv.ReportSource = rptDoc;
}        

Please help

1

1 Answers

0
votes

My guess is that you need to set also the table location.