Try to search your question here, if you can't find : Ask Any Question Now ?

Crystal Report Viewer Prompt Database Logon Failed While Navigating Next Page

HomeCategory: stackoverflowCrystal Report Viewer Prompt Database Logon Failed While Navigating Next Page
rupesh asked 3 weeks ago

I tried to preview the crystal report by selecting values in dropdown list. It able to show 1st page without any problem. But when I tried to press Next Page button / typing in number of page, it will prompt out Database Logon Failed error.

I tried to google around about this issue and still unable to resolve the issue. Few threads similar to this issue I already go through but still no avail.

I inserted this logOnInfo function

        public void setLogonInfo()
        {
            TableLogOnInfo logOnInfo = new TableLogOnInfo();
            logOnInfo.ConnectionInfo.ServerName = "servername";
            logOnInfo.ConnectionInfo.DatabaseName = "databasename";
            logOnInfo.ConnectionInfo.UserID = "user";
            logOnInfo.ConnectionInfo.Password = "pwd";

            TableLogOnInfos infos = new TableLogOnInfos();
            infos.Add(logOnInfo);
            crystalReportViewer.LogOnInfo = infos;
        }

I have Init() function too

        private void Page_Init(object sender, EventArgs e)
        {
            reportDocument = (ReportDocument)Session["reportDocument"];
            crystalReportViewer.ReportSource = reportDocument;
        }

Lastly, this is the display report function when I clicked Search button

        protected void DisplayReport() // display all value selected
        {
            string customerID = this.ddwn_cust.SelectedValue;
            ReportDocument reportdocument = new ReportDocument();
            reportdocument.Load(Server.MapPath("rptSalesRep.rpt"));
            reportdocument.SetParameterValue("RepID", lblSalesRep.Text);
            reportdocument.SetParameterValue("CustomerID", lblcustomer.Text);
            reportdocument.SetParameterValue("ItemTypeID", txtItemType.Text);
            reportdocument.SetParameterValue("startdate", Convert.ToDateTime(txtStartDate.Text));
            reportdocument.SetParameterValue("enddate", Convert.ToDateTime(txtEndDate.Text));
            crystalReportViewer.ReportSource = reportdocument;
            setLogonInfo();
        }

Yet, I still unable to get to the next page of the crystal report viewer.

Any solutions to this issue?

Thank you in advance!

1 Answers
Best Answer
naveen answered 3 weeks ago
Your Answer

11 + 2 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com