Crystal Report with Error : A number range is required here.
        Posted  
        
            by 
                gofor.net
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by gofor.net
        
        
        
        Published on 2010-12-29T10:10:53Z
        Indexed on 
            2010/12/29
            10:54 UTC
        
        
        Read the original article
        Hit count: 361
        
Hi Everyone,
I am using the crystal report, in that i am using code like below to show the SQL data into the crystal report,
string req = "{View_EODPumpTest.ROId} IN " + str + " AND " + "({View_EODPumpTest.RecordCreatedDate}>=date(" + fromDate.Year + " , " + fromDate.Month + " , " + fromDate.Day + ")" + "AND" + "{View_EODPumpTest.RecordCreatedDate}<=date(" + toDate.Year + " , " + toDate.Month + " ," + toDate.Day + " ))";
ReportDocument rep = new ReportDocument();
rep.Load(Server.MapPath("PumpTestReport.rpt"));
DateTime fromDate = DateTime.Parse(Request.QueryString["fDate"].ToString());
                DateTime toDate = DateTime.Parse(Request.QueryString["tDate"].ToString());
                CrystalReportViewer_PumpTest.ReportSource = rep;
                //CrystalReportViewer1.SelectionFormula = str;
                rep.RecordSelectionFormula = str;
                CrystalDecisions.CrystalReports.Engine.TextObject from = ((CrystalDecisions.CrystalReports.Engine.TextObject)rep.ReportDefinition.ReportObjects["txtFrom"]);
                from.Text = fromDate.ToShortDateString();
                CrystalDecisions.CrystalReports.Engine.TextObject to = ((CrystalDecisions.CrystalReports.Engine.TextObject)rep.ReportDefinition.ReportObjects["txtTO"]);
                to.Text = toDate.ToShortDateString();
                //Session["Repo"] = rep;
                CrystalReportViewer_PumpTest.RefreshReport();
after running my application it executes fine with no exception but such error i am getting,
A number range is required here. Error in File C:\DOCUME~1\Delmon\LOCALS~1\Temp\PumpTestReport {14E557A7-51B3-4791-9C78-B6FBAFFBD87C}.rpt: Error in formula . '{View_EODPumpTest.ROId} IN ['15739410','13465410'] AND ({View_EODPumpTest.RecordCreatedDate}>=date(2010 , 12 , 1)AND{View_EODPumpTest.RecordCreatedDate}<=date(2010 , 12 ,25 ))' A number range is required here.
error.
what i will do for this?
Please help,
Thanks in advance
© Stack Overflow or respective owner