Access stored procedure value within XtraReport












0















In my Form I have this code to open my report on a click of Button:



private void btnGroupOther_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
LayoutControl lc = new LayoutControl();
lc.Dock = DockStyle.Fill;
DateEdit FirstDate = new DateEdit();
DateEdit LastDate = new DateEdit();
lc.AddItem(Resources.firstdate, FirstDate).TextVisible = true;
lc.AddItem(Resources.seconddate, LastDate).TextVisible = true;
lc.Height = 70;
this.Controls.Add(lc);
this.Dock = DockStyle.Top;
if (DevExpress.XtraEditors.XtraDialog.Show(lc, " ", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
RepProductionGroupOther report = new RepProductionGroupOther();
report.DataSource = paint.RepProductionGroupOther(Convert.ToDateTime(FirstDate.EditValue).ToString("MM/dd/yyyy"),
Convert.ToDateTime(LastDate.EditValue).ToString("MM/dd/yyyy"));

report.ShowRibbonPreviewDialog();
}
}


In my header report I have two xrLabel; the first one txtFirstDate and the second one txtLastDate. I want to show the value of FirstDate DateEdit control in txtFirstDate and the value of LastDate DateEdit control in txtLastDate.



How can I do that, the DataSource of the report is sql stored procedure.

It has two Parameters: @FirstDate and @LastDate.



Thanks in advance










share|improve this question





























    0















    In my Form I have this code to open my report on a click of Button:



    private void btnGroupOther_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
    {
    LayoutControl lc = new LayoutControl();
    lc.Dock = DockStyle.Fill;
    DateEdit FirstDate = new DateEdit();
    DateEdit LastDate = new DateEdit();
    lc.AddItem(Resources.firstdate, FirstDate).TextVisible = true;
    lc.AddItem(Resources.seconddate, LastDate).TextVisible = true;
    lc.Height = 70;
    this.Controls.Add(lc);
    this.Dock = DockStyle.Top;
    if (DevExpress.XtraEditors.XtraDialog.Show(lc, " ", MessageBoxButtons.OKCancel) == DialogResult.OK)
    {
    RepProductionGroupOther report = new RepProductionGroupOther();
    report.DataSource = paint.RepProductionGroupOther(Convert.ToDateTime(FirstDate.EditValue).ToString("MM/dd/yyyy"),
    Convert.ToDateTime(LastDate.EditValue).ToString("MM/dd/yyyy"));

    report.ShowRibbonPreviewDialog();
    }
    }


    In my header report I have two xrLabel; the first one txtFirstDate and the second one txtLastDate. I want to show the value of FirstDate DateEdit control in txtFirstDate and the value of LastDate DateEdit control in txtLastDate.



    How can I do that, the DataSource of the report is sql stored procedure.

    It has two Parameters: @FirstDate and @LastDate.



    Thanks in advance










    share|improve this question



























      0












      0








      0








      In my Form I have this code to open my report on a click of Button:



      private void btnGroupOther_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
      {
      LayoutControl lc = new LayoutControl();
      lc.Dock = DockStyle.Fill;
      DateEdit FirstDate = new DateEdit();
      DateEdit LastDate = new DateEdit();
      lc.AddItem(Resources.firstdate, FirstDate).TextVisible = true;
      lc.AddItem(Resources.seconddate, LastDate).TextVisible = true;
      lc.Height = 70;
      this.Controls.Add(lc);
      this.Dock = DockStyle.Top;
      if (DevExpress.XtraEditors.XtraDialog.Show(lc, " ", MessageBoxButtons.OKCancel) == DialogResult.OK)
      {
      RepProductionGroupOther report = new RepProductionGroupOther();
      report.DataSource = paint.RepProductionGroupOther(Convert.ToDateTime(FirstDate.EditValue).ToString("MM/dd/yyyy"),
      Convert.ToDateTime(LastDate.EditValue).ToString("MM/dd/yyyy"));

      report.ShowRibbonPreviewDialog();
      }
      }


      In my header report I have two xrLabel; the first one txtFirstDate and the second one txtLastDate. I want to show the value of FirstDate DateEdit control in txtFirstDate and the value of LastDate DateEdit control in txtLastDate.



      How can I do that, the DataSource of the report is sql stored procedure.

      It has two Parameters: @FirstDate and @LastDate.



      Thanks in advance










      share|improve this question
















      In my Form I have this code to open my report on a click of Button:



      private void btnGroupOther_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
      {
      LayoutControl lc = new LayoutControl();
      lc.Dock = DockStyle.Fill;
      DateEdit FirstDate = new DateEdit();
      DateEdit LastDate = new DateEdit();
      lc.AddItem(Resources.firstdate, FirstDate).TextVisible = true;
      lc.AddItem(Resources.seconddate, LastDate).TextVisible = true;
      lc.Height = 70;
      this.Controls.Add(lc);
      this.Dock = DockStyle.Top;
      if (DevExpress.XtraEditors.XtraDialog.Show(lc, " ", MessageBoxButtons.OKCancel) == DialogResult.OK)
      {
      RepProductionGroupOther report = new RepProductionGroupOther();
      report.DataSource = paint.RepProductionGroupOther(Convert.ToDateTime(FirstDate.EditValue).ToString("MM/dd/yyyy"),
      Convert.ToDateTime(LastDate.EditValue).ToString("MM/dd/yyyy"));

      report.ShowRibbonPreviewDialog();
      }
      }


      In my header report I have two xrLabel; the first one txtFirstDate and the second one txtLastDate. I want to show the value of FirstDate DateEdit control in txtFirstDate and the value of LastDate DateEdit control in txtLastDate.



      How can I do that, the DataSource of the report is sql stored procedure.

      It has two Parameters: @FirstDate and @LastDate.



      Thanks in advance







      c# winforms devexpress






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 '18 at 0:44









      Jimi

      9,47742035




      9,47742035










      asked Nov 25 '18 at 18:54









      M.BouabdallahM.Bouabdallah

      4616




      4616
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I suggest you to go through XtraReport documentation:
          Request and Pass Report Parameter Values



          private void button1_Click(object sender, EventArgs e) {
          // Create a report instance.
          XtraReport1 report = new XtraReport1();

          // Obtain a parameter and set its value.
          report.Parameters["parameter1"].Value = 30;

          // Hide the Parameters' UI from end-users (if you did not hide it at design time).
          report.Parameters["parameter1"].Visible = false;

          // Show the report's print preview depending on your target platform.
          // ...
          }


          Check the "Custom Parameter Editors" section in above documentation
          Custom editor implementation for parameters varies depending on your application's platform:





          • Windows Forms



            In Windows Forms applications, you can provide custom parameter editors in the XtraReport.ParametersRequestBeforeShow event handler.



            For a code sample, see Provide Custom Editors for Report Parameters.




          Below are similar implementation as you are trying to do.. Check these, hope this will help you resolve the issue.
          How to pass parameters to devexpress XtraReport from combobox
          DevExpress XtraReport Setting a DateTime Parameter to Today



          Passing parameters to Xtrareports repx file






          share|improve this answer


























          • thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

            – M.Bouabdallah
            Nov 26 '18 at 18:05











          • thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

            – M.Bouabdallah
            Nov 27 '18 at 18:51













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53470792%2faccess-stored-procedure-value-within-xtrareport%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I suggest you to go through XtraReport documentation:
          Request and Pass Report Parameter Values



          private void button1_Click(object sender, EventArgs e) {
          // Create a report instance.
          XtraReport1 report = new XtraReport1();

          // Obtain a parameter and set its value.
          report.Parameters["parameter1"].Value = 30;

          // Hide the Parameters' UI from end-users (if you did not hide it at design time).
          report.Parameters["parameter1"].Visible = false;

          // Show the report's print preview depending on your target platform.
          // ...
          }


          Check the "Custom Parameter Editors" section in above documentation
          Custom editor implementation for parameters varies depending on your application's platform:





          • Windows Forms



            In Windows Forms applications, you can provide custom parameter editors in the XtraReport.ParametersRequestBeforeShow event handler.



            For a code sample, see Provide Custom Editors for Report Parameters.




          Below are similar implementation as you are trying to do.. Check these, hope this will help you resolve the issue.
          How to pass parameters to devexpress XtraReport from combobox
          DevExpress XtraReport Setting a DateTime Parameter to Today



          Passing parameters to Xtrareports repx file






          share|improve this answer


























          • thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

            – M.Bouabdallah
            Nov 26 '18 at 18:05











          • thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

            – M.Bouabdallah
            Nov 27 '18 at 18:51


















          0














          I suggest you to go through XtraReport documentation:
          Request and Pass Report Parameter Values



          private void button1_Click(object sender, EventArgs e) {
          // Create a report instance.
          XtraReport1 report = new XtraReport1();

          // Obtain a parameter and set its value.
          report.Parameters["parameter1"].Value = 30;

          // Hide the Parameters' UI from end-users (if you did not hide it at design time).
          report.Parameters["parameter1"].Visible = false;

          // Show the report's print preview depending on your target platform.
          // ...
          }


          Check the "Custom Parameter Editors" section in above documentation
          Custom editor implementation for parameters varies depending on your application's platform:





          • Windows Forms



            In Windows Forms applications, you can provide custom parameter editors in the XtraReport.ParametersRequestBeforeShow event handler.



            For a code sample, see Provide Custom Editors for Report Parameters.




          Below are similar implementation as you are trying to do.. Check these, hope this will help you resolve the issue.
          How to pass parameters to devexpress XtraReport from combobox
          DevExpress XtraReport Setting a DateTime Parameter to Today



          Passing parameters to Xtrareports repx file






          share|improve this answer


























          • thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

            – M.Bouabdallah
            Nov 26 '18 at 18:05











          • thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

            – M.Bouabdallah
            Nov 27 '18 at 18:51
















          0












          0








          0







          I suggest you to go through XtraReport documentation:
          Request and Pass Report Parameter Values



          private void button1_Click(object sender, EventArgs e) {
          // Create a report instance.
          XtraReport1 report = new XtraReport1();

          // Obtain a parameter and set its value.
          report.Parameters["parameter1"].Value = 30;

          // Hide the Parameters' UI from end-users (if you did not hide it at design time).
          report.Parameters["parameter1"].Visible = false;

          // Show the report's print preview depending on your target platform.
          // ...
          }


          Check the "Custom Parameter Editors" section in above documentation
          Custom editor implementation for parameters varies depending on your application's platform:





          • Windows Forms



            In Windows Forms applications, you can provide custom parameter editors in the XtraReport.ParametersRequestBeforeShow event handler.



            For a code sample, see Provide Custom Editors for Report Parameters.




          Below are similar implementation as you are trying to do.. Check these, hope this will help you resolve the issue.
          How to pass parameters to devexpress XtraReport from combobox
          DevExpress XtraReport Setting a DateTime Parameter to Today



          Passing parameters to Xtrareports repx file






          share|improve this answer















          I suggest you to go through XtraReport documentation:
          Request and Pass Report Parameter Values



          private void button1_Click(object sender, EventArgs e) {
          // Create a report instance.
          XtraReport1 report = new XtraReport1();

          // Obtain a parameter and set its value.
          report.Parameters["parameter1"].Value = 30;

          // Hide the Parameters' UI from end-users (if you did not hide it at design time).
          report.Parameters["parameter1"].Visible = false;

          // Show the report's print preview depending on your target platform.
          // ...
          }


          Check the "Custom Parameter Editors" section in above documentation
          Custom editor implementation for parameters varies depending on your application's platform:





          • Windows Forms



            In Windows Forms applications, you can provide custom parameter editors in the XtraReport.ParametersRequestBeforeShow event handler.



            For a code sample, see Provide Custom Editors for Report Parameters.




          Below are similar implementation as you are trying to do.. Check these, hope this will help you resolve the issue.
          How to pass parameters to devexpress XtraReport from combobox
          DevExpress XtraReport Setting a DateTime Parameter to Today



          Passing parameters to Xtrareports repx file







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 '18 at 4:58

























          answered Nov 26 '18 at 4:52









          Niranjan SinghNiranjan Singh

          15.9k23267




          15.9k23267













          • thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

            – M.Bouabdallah
            Nov 26 '18 at 18:05











          • thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

            – M.Bouabdallah
            Nov 27 '18 at 18:51





















          • thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

            – M.Bouabdallah
            Nov 26 '18 at 18:05











          • thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

            – M.Bouabdallah
            Nov 27 '18 at 18:51



















          thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

          – M.Bouabdallah
          Nov 26 '18 at 18:05





          thanks for your help,but my report run without any problem,I only need a way to show query parameters on xrLabel report,i found this article on devexpress but i cannot find a way to implement it in my code: docs.devexpress.com/XtraReports/17387/…

          – M.Bouabdallah
          Nov 26 '18 at 18:05













          thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

          – M.Bouabdallah
          Nov 27 '18 at 18:51







          thank you very much Mr Niranjan Singh the first link documentation.devexpress.com/XtraReports/10000/… helped me a lot you are the best

          – M.Bouabdallah
          Nov 27 '18 at 18:51






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53470792%2faccess-stored-procedure-value-within-xtrareport%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen