Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. SetParameterValue Not passing parameters to the SP

SetParameterValue Not passing parameters to the SP

Scheduled Pinned Locked Moved ASP.NET
helpquestionsharepointdatabasevisual-studio
3 Posts 2 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    allende
    wrote on last edited by
    #1

    HI friends, this question is regarding Crystal Reports in VS 2005 My report here is attached to a SP. I'm trying to pass parameters but it raises an error: Procedure or function 'sp_wfsAppByCounsReport' expects parameter '@StartingDate', which was not supplied. Here is my code, I'm passing the parameter. I can even trace it and the rdDocument variable has them attached after the SetParameteValue....why the report is not sending them to the SP??? Here is my code:

    protected void Page\_Load(object sender, EventArgs e)
    {
        DateTime dtStartingDate =  DateTime.Parse(DateTime.Today.Month.ToString() + "/" + "1" + "/" + DateTime.Today.Year.ToString());
    
        ConnectionInfo ciLogin = new ConnectionInfo();
        ciLogin.ServerName = "myserver.com";
        ciLogin.DatabaseName = "mydb";
        ciLogin.UserID = "dbuser";
        ciLogin.Password = "mypass";
        TableLogOnInfo tbLogonTable = new TableLogOnInfo();
        tbLogonTable.ConnectionInfo = ciLogin;
    
        ReportDocument rdMonthReport = new ReportDocument();
        rdMonthReport.Load(Server.MapPath("couns-month.rpt"));
        rdMonthReport.SetParameterValue("@StartingDate", dtStartingDate);
        rdMonthReport.SetParameterValue("@EndingDate", DateTime.Today);
    
        foreach (CrystalDecisions.CrystalReports.Engine.Table tbTable in rdMonthReport.Database.Tables)
        {
            tbTable.ApplyLogOnInfo(tbLogonTable);
        }
        CrystalReportViewer.ReportSource = rdMonthReport;
        CrystalReportViewer.RefreshReport();
    }
    

    Any help is appreciated!!

    C 1 Reply Last reply
    0
    • A allende

      HI friends, this question is regarding Crystal Reports in VS 2005 My report here is attached to a SP. I'm trying to pass parameters but it raises an error: Procedure or function 'sp_wfsAppByCounsReport' expects parameter '@StartingDate', which was not supplied. Here is my code, I'm passing the parameter. I can even trace it and the rdDocument variable has them attached after the SetParameteValue....why the report is not sending them to the SP??? Here is my code:

      protected void Page\_Load(object sender, EventArgs e)
      {
          DateTime dtStartingDate =  DateTime.Parse(DateTime.Today.Month.ToString() + "/" + "1" + "/" + DateTime.Today.Year.ToString());
      
          ConnectionInfo ciLogin = new ConnectionInfo();
          ciLogin.ServerName = "myserver.com";
          ciLogin.DatabaseName = "mydb";
          ciLogin.UserID = "dbuser";
          ciLogin.Password = "mypass";
          TableLogOnInfo tbLogonTable = new TableLogOnInfo();
          tbLogonTable.ConnectionInfo = ciLogin;
      
          ReportDocument rdMonthReport = new ReportDocument();
          rdMonthReport.Load(Server.MapPath("couns-month.rpt"));
          rdMonthReport.SetParameterValue("@StartingDate", dtStartingDate);
          rdMonthReport.SetParameterValue("@EndingDate", DateTime.Today);
      
          foreach (CrystalDecisions.CrystalReports.Engine.Table tbTable in rdMonthReport.Database.Tables)
          {
              tbTable.ApplyLogOnInfo(tbLogonTable);
          }
          CrystalReportViewer.ReportSource = rdMonthReport;
          CrystalReportViewer.RefreshReport();
      }
      

      Any help is appreciated!!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Is your date format correct ? Is MM/DD/YYYY what your server expects ? any need to write code that works out hte local format and uses it ?

      Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

      A 1 Reply Last reply
      0
      • C Christian Graus

        Is your date format correct ? Is MM/DD/YYYY what your server expects ? any need to write code that works out hte local format and uses it ?

        Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

        A Offline
        A Offline
        allende
        wrote on last edited by
        #3

        I think so. The parameters in the SP are DateTime..and I'm passing DateTime as parameters too.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups