Parameter Pass To Report.rdlc in Temporary Values Using Asp.Net C#


Report Create & Particular Control  Pass Methods Already Use Below Links

http://dotnetdrizzles.blogspot.in/2014/10/how-to-pass-parameter-to-rdlc-report-or.html

http://dotnetdrizzles.blogspot.in/2014/10/how-to-pass-particularwhere-condition.html


Now Pass Without Database Values To Report.rdlc Report.

                             C# Coding


using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Microsoft.Reporting.WebForms;

public partial class reports : System.Web.UI.Page
{
   
    protected void Page_Load(object sender, EventArgs e)
    {
             if (!IsPostBack)
                {                                  
                      string  date1 = "22/10/2014";
                      string  name =  "Drizzles";
                
             ReportParameter rpt1 = new ReportParameter("id", "1");
    ReportParameter rpt2 = new ReportParameter("date", date1.ToString());
 ReportParameter rpt3 = new ReportParameter("name", name.ToString());


  this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rpt1, rpt2, rpt3 });


        this.ReportViewer1.LocalReport.Refresh();
                  
                } 
            }
        }
     

   

Above Link Use to Dataset connect method 

Select - Report Viewer - Add - Report.rdlc





Next - Add - Namespaces - Pass Parameter To Report.rdlc Report






Next - Add - Report.rdlc New -  File 






Next - Repot.rdlc - File - Parameter - Right Click - Add Parameter





Add - Passing - Same - Name - Add - Datatype




Add - Required Parameters




Next - Go to ToolBox - Select - Textbox or Toolbox  -  Right Click - Select Expression 





Next - Add - Required Parameter - Double Click - OK






Next - Set to the Parameter Name






Next - Set the Required Parameter Names

Next - Run The Form Get the Report







0 comments:

Post a Comment