none
Load rdlc report in reportviewer on javascript Event RRS feed

  • Question

  • Can I Load RDLC report to ReportViewer  in Run Time on javascript event.

    protected void Page_Load(object sender, EventArgs e){
          if (Request.QueryString.Count == 0){
    //Request from Client-side (Javascript event)
                if (Request["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest"){
                   	ReportViewer1.ProcessingMode = ProcessingMode.Local;
                  	ReportViewer1.LocalReport.ReportPath = Server.MapPath("Reports\\Report2.rdlc");
                    ReportViewer1.Visible = true;
    
                    StreamReader str = new StreamReader(Request.InputStream);
                    String strbuf = str.ReadToEnd().Normalize();
                    QSerializer ser = new QSerializer();
                    QCriteria Cri = ser.DeSerialize<QCriteria>(strbuf);
                    if (!String.IsNullOrEmpty(Cri.Name))
                    {
                        SqlDataSource1.SelectCommand = "select * from ZClient.TItem where ClientNx = 3";
                    }
                    ReportViewer1.DataBind();
                    ReportViewer1.LocalReport.Refresh();
                }
            }
    }

    Monday, March 17, 2014 7:15 PM