Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

ASP.net is not passing all my parameters to SSRS....Need Help!

$
0
0

I am using an ASP.net 4.5.50938 front end to allow me to display and pass multiple parameters to SSRS.  The problem is the below code is only passing 1 parameter but I have 24 optional parameters to pass based on the user clicking a checkbox on the asp web page.

How do I get all my parameters passed to SSRS?  The values are not being blanked out, the values are there, but it is not passing more than one value to SSRS.

ReportParameter[] param = new ReportParameter[24];

            if (CheckBox1.Checked)
            {
                param[0] = new ReportParameter("Plant1", PlantDrop1.SelectedValue);
                param[1] = new ReportParameter("WorkCenter1", WCDrop1.SelectedValue);
                param[2] = new ReportParameter("Metric1", MetricDrop1.SelectedValue);
            }
            else
            {
                param[0] = new ReportParameter("Plant1","");
                param[1] = new ReportParameter("WorkCenter1","");
                param[2] = new ReportParameter("Metric1","");
            }

            if (CheckBox2.Checked)
            {
                param[3] = new ReportParameter("Plant2", PlantDrop2.SelectedValue);
                param[4] = new ReportParameter("WorkCenter2", WCDrop2.SelectedValue);
                param[5] = new ReportParameter("Metric2", MetricDrop2.SelectedValue);
            }
            else
            {
                param[3] = new ReportParameter("Plant2", "");
                param[4] = new ReportParameter("WorkCenter2", "");
                param[5] = new ReportParameter("Metric2", "");
            }

            if (CheckBox3.Checked)
            {
                param[6] = new ReportParameter("Plant3", PlantDrop3.SelectedValue);
                param[7] = new ReportParameter("WorkCenter3", WCDrop3.SelectedValue);
                param[8] = new ReportParameter("Metric3", MetricDrop3.SelectedValue);
            }
            else
            {
                param[6] = new ReportParameter("Plant3", "");
                param[7] = new ReportParameter("WorkCenter3", "");
                param[8] = new ReportParameter("Metric3", "");
            }

            if (CheckBox4.Checked)
            {
                param[9] = new ReportParameter("Plant4", PlantDrop4.SelectedValue);
                param[10] = new ReportParameter("WorkCenter4", WCDrop4.SelectedValue);
                param[11] = new ReportParameter("Metric4", MetricDrop4.SelectedValue);
            }
            else
            {
                param[9] = new ReportParameter("Plant4", "");
                param[10] = new ReportParameter("WorkCenter4", "");
                param[11] = new ReportParameter("Metric4", "");
            }

            if (CheckBox5.Checked)
            {
                param[12] = new ReportParameter("Plant5", PlantDrop5.SelectedValue);
                param[13] = new ReportParameter("WorkCenter5", WCDrop5.SelectedValue);
                param[14] = new ReportParameter("Metric5", MetricDrop5.SelectedValue);
            }
            else
            {
                param[12] = new ReportParameter("Plant5", "");
                param[13] = new ReportParameter("WorkCenter5", "");
                param[14] = new ReportParameter("Metric5", "");
            }

            if (CheckBox6.Checked)
            {
                param[15] = new ReportParameter("Plant6", PlantDrop6.SelectedValue);
                param[16] = new ReportParameter("WorkCenter6", WCDrop6.SelectedValue);
                param[17] = new ReportParameter("Metric6", MetricDrop6.SelectedValue);
            }
            else
            {
                param[15] = new ReportParameter("Plant6", "");
                param[16] = new ReportParameter("WorkCenter6", "");
                param[17] = new ReportParameter("Metric6", "");
            }

            if (CheckBox7.Checked)
            {
                param[18] = new ReportParameter("Plant7", PlantDrop7.SelectedValue);
                param[19] = new ReportParameter("WorkCenter7", WCDrop7.SelectedValue);
                param[20] = new ReportParameter("Metric7", MetricDrop7.SelectedValue);
            }
            else
            {
                param[18] = new ReportParameter("Plant7", "");
                param[19] = new ReportParameter("WorkCenter7", "");
                param[20] = new ReportParameter("Metric7", "");
            }

            if (CheckBox8.Checked)
            {
                param[21] = new ReportParameter("Plant8", PlantDrop8.SelectedValue);
                param[22] = new ReportParameter("WorkCenter8", WCDrop8.SelectedValue);
                param[23] = new ReportParameter("Metric8", MetricDrop8.SelectedValue);
            }
            else
            {
                param[21] = new ReportParameter("Plant8", "");
                param[22] = new ReportParameter("WorkCenter8", "");
                param[23] = new ReportParameter("Metric8", "");
            }

            ReportViewer1.ServerReport.SetParameters(param);

            ReportViewer1.ServerReport.Refresh();


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>