Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Crystal Report template failed to open an Oracle view to populate report.

$
0
0

Hi guys,  

   i have a weird issue with some crystal report templates created with Crystal Report 2011 which been called by asp.net 3.5 (VS 2008) coding as below:

           if (Session["rd"] == null)
            {
                rd = new ReportDocument();
                rpt = Request.QueryString["rpt"];
                switch (rpt)
                {
                   case "NR01":
                        rd.Load(Server.MapPath("~/Reports/" + "RejectMore_ivy_2011.rpt"));
                        rd.SetDatabaseLogon(Userid, Password);
                        rd.SetParameterValue("ScrapGrp", Request.QueryString["cat"]);
                        rd.SetParameterValue("Limit", Request.QueryString["qty"]);
                        rd.SetParameterValue("Package", Request.QueryString["package"]);
                        rd.SetParameterValue("StartDate", Request.QueryString["startdate"]);
                        rd.SetParameterValue("EndDate", Request.QueryString["enddate"]);
                        Session["rd"] = rd;
                        break;
                    case "NR02":
                        rd.Load(Server.MapPath("~/Reports/" + "RejectMorePerSO_i.rpt"));
                        //rd.Load(Server.MapPath("~/Reports/" + "PMTest1.rpt"));
                        rd.SetDatabaseLogon(Userid, Password);
                        rd.SetParameterValue("Shoporder", Request.QueryString["so"]);
                        rd.SetParameterValue("Scrap Category", Request.QueryString["cat"]);
                        Session["rd"] = rd;
                        break;
                    case "NR03":
                        rd.Load(Server.MapPath("~/Reports/" + "LowYieldStore.rpt"));
                        rd.SetDatabaseLogon(Userid, Password);
                        rd.SetParameterValue("Package", Request.QueryString["package"]);
                        Session["rd"] = rd;
                        break;
                    default:
                        break;
                }
            }
            else
            {
                rd = (ReportDocument)Session["rd"];
            }
            CrystalReportViewer.ReportSource = rd;
        }


I have few reports template which use Oracle view as datasource. All the template use ODBC to connect to Oracle database. Some of them works fine, but some unfortunately give me a lot of pain in figuring out the way to solve them.  when i try to run the report, CrystalReportViewer prompted by display the following error message:

"The table 'VW_IVY_SCRAPTOTALSFORSO_REPORT' could not be found. Error in File C:\DOCUME~1\SOSOON~1\LOCALS~1\Temp\RejectMorePerSO_i {D304CC97-802C-40F8-B282-F669682A3DBA}.rpt: The table could not be found."


When i try to run these reports in Crystal Report Designer 2011, it can actually populate data without error. When i run in VS 2008, it also prompted the same error message but still populating the data after i clicked "OK" on the prompt. Too bad, when i run in ASP.NET web appp, it simply can't work. I have verify many time that the view actually exist in the database and  i have access to the  right schema.

Please help...i am lost...


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>