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

    Question

  • 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();

    Tuesday, February 25, 2014 6:50 PM

Answers

  • I fixed it myself

    Rec Column1
    Rec Column2
    Rec Column3
    Rec Column4
    Rec Column5
    Rec Column6
    Rec Column7
    Rec Column8
    32.2
    98.7
    100
    88
    43.3
    100
    0.5
    72.9
    25.9
    100
    100
    92.2
    55.2
    99.9
    0.43
    70.6
    30.5
    100
    80.1
    82
    57.4
    99.8
    0.31
    65.3
    31.8
    100
    99.9
    94.9
    49.6
    98.2
    0.14
    69.3
    32.3
    100
    99.8
    83.6
    43.5
    99.1
    0.17
    67.1
    39.5
    99.6
    99.9
    91.1
    31.7
    99.8
    0.35
    63.7
    29.1
    98.3
    99.8
    86.6
    61.8
    99.8
    0.34
    65.7
    28.9
    99
    99.9
    91.8
    48.6
    98
    0.36
    67.4
    27.7
    97.7
    99.8
    83.5
    47.6
    99.6
    0.47
    64.9
    31.4
    92.6
    99.8
    89
    48.4
    99.1
    0.44
    72.3
    29.2
    93.9
    99.7
    95.4
    51.9
    97.1
    0.49
    65.8
    33.1
    93.8
    93.1
    91.6
    47.6
    95.3
    0.51
    57.2
    28.6
    89.1
    98.6
    96.7
    48.2
    97.5
    0.6
    58.5
    36.1
    90.9
    98.5
    93.5
    50.5
    96.1
    0.43
    76.9
    30.8
    41
    96
    93.1
    46.7
    97.7
    0.53
    82.7
    31.3
    73.8
    99.7
    83.9
    36.6
    98.8
    0.6
    83.8
    30
    89.7
    99.6
    91.4
    31.2
    99.7
    0.81
    82.8
    29.2
    99
    99.8
    82.9
    25.5
    99.4
    0.42
    81
    30.5
    96.6
    99.9
    79.5
    47.7
    97.7
    0.4
    81.2
    29.4
    1.9
    99.7
    93.6
    11
    97.1
    0.3
    77.8
    28.7
    1.5
    99.9
    75
    38.4
    98.8
    0.26
    77.1
    28.7
    18.5
    99.9
    41.5
    53.4
    97.4
    0.45
    77.7
    29.3
    51.9
    99.8
    55.7
    49
    99.2
    0.25
    74.9
    29.9
    54.6
    99.8
    88.7
    52.4
    99.2
    0.27
    75.3
    30.5
    81.9
    99.9
    99.1
    51.1
    98.8
    0.17
    74.5
    30.2
    99.4
    100
     
    48.2
    99
    0.22
    72.4
    32.5
    93.2
    99.9
     
    46.8
    99.4
    0.26
    69.8
    36.6
    75.4
    100
     
    47.5
    99.4
    0.41
    70.9
    37.5
    89.7
    99.9
     
    44.7
    98.9
    0.41
    72.7
    37.7
    96.9
    100
     
    38.2
    97.2
    0.3
    71.9
    39.8
    45
    100
     
    47.1
    99.5
    0.32
    72.6
    41.3
    55
    99.9
     
    49.4
    99.4
    0.23
    72
    41.6
    77.9
    99.9
     
    51
    97.1
    0.25
    72.6
    42.2
    99.9
    100
     
    48.9
    98.7
    0.23
    70.4
    41.8
    100
    99.5
     
    45.8
    99.2
    0.32
    71.9
    45.2
    99.9
    99.8
     
    46.9
    99.3
    0.34
    75.8
    43.4
    99.9
    99.9
     
    50.9
    99.6
    0.35
    76.7

    • Marked as answer by JazLady Wednesday, February 26, 2014 10:20 PM
    Wednesday, February 26, 2014 10:20 PM

All replies

  • As I am select more parameters my data for the first parameter checked is in the first row and all the other rows are at the end of column.  Scroll o the bottom of Rec Column2 to see what I mean.   I tried =First() but that is not working.  How do I get my data for the parametered selected to show at the top?
    Wednesday, February 26, 2014 6:48 PM
  • I fixed it myself

    Rec Column1
    Rec Column2
    Rec Column3
    Rec Column4
    Rec Column5
    Rec Column6
    Rec Column7
    Rec Column8
    32.2
    98.7
    100
    88
    43.3
    100
    0.5
    72.9
    25.9
    100
    100
    92.2
    55.2
    99.9
    0.43
    70.6
    30.5
    100
    80.1
    82
    57.4
    99.8
    0.31
    65.3
    31.8
    100
    99.9
    94.9
    49.6
    98.2
    0.14
    69.3
    32.3
    100
    99.8
    83.6
    43.5
    99.1
    0.17
    67.1
    39.5
    99.6
    99.9
    91.1
    31.7
    99.8
    0.35
    63.7
    29.1
    98.3
    99.8
    86.6
    61.8
    99.8
    0.34
    65.7
    28.9
    99
    99.9
    91.8
    48.6
    98
    0.36
    67.4
    27.7
    97.7
    99.8
    83.5
    47.6
    99.6
    0.47
    64.9
    31.4
    92.6
    99.8
    89
    48.4
    99.1
    0.44
    72.3
    29.2
    93.9
    99.7
    95.4
    51.9
    97.1
    0.49
    65.8
    33.1
    93.8
    93.1
    91.6
    47.6
    95.3
    0.51
    57.2
    28.6
    89.1
    98.6
    96.7
    48.2
    97.5
    0.6
    58.5
    36.1
    90.9
    98.5
    93.5
    50.5
    96.1
    0.43
    76.9
    30.8
    41
    96
    93.1
    46.7
    97.7
    0.53
    82.7
    31.3
    73.8
    99.7
    83.9
    36.6
    98.8
    0.6
    83.8
    30
    89.7
    99.6
    91.4
    31.2
    99.7
    0.81
    82.8
    29.2
    99
    99.8
    82.9
    25.5
    99.4
    0.42
    81
    30.5
    96.6
    99.9
    79.5
    47.7
    97.7
    0.4
    81.2
    29.4
    1.9
    99.7
    93.6
    11
    97.1
    0.3
    77.8
    28.7
    1.5
    99.9
    75
    38.4
    98.8
    0.26
    77.1
    28.7
    18.5
    99.9
    41.5
    53.4
    97.4
    0.45
    77.7
    29.3
    51.9
    99.8
    55.7
    49
    99.2
    0.25
    74.9
    29.9
    54.6
    99.8
    88.7
    52.4
    99.2
    0.27
    75.3
    30.5
    81.9
    99.9
    99.1
    51.1
    98.8
    0.17
    74.5
    30.2
    99.4
    100
     
    48.2
    99
    0.22
    72.4
    32.5
    93.2
    99.9
     
    46.8
    99.4
    0.26
    69.8
    36.6
    75.4
    100
     
    47.5
    99.4
    0.41
    70.9
    37.5
    89.7
    99.9
     
    44.7
    98.9
    0.41
    72.7
    37.7
    96.9
    100
     
    38.2
    97.2
    0.3
    71.9
    39.8
    45
    100
     
    47.1
    99.5
    0.32
    72.6
    41.3
    55
    99.9
     
    49.4
    99.4
    0.23
    72
    41.6
    77.9
    99.9
     
    51
    97.1
    0.25
    72.6
    42.2
    99.9
    100
     
    48.9
    98.7
    0.23
    70.4
    41.8
    100
    99.5
     
    45.8
    99.2
    0.32
    71.9
    45.2
    99.9
    99.8
     
    46.9
    99.3
    0.34
    75.8
    43.4
    99.9
    99.9
     
    50.9
    99.6
    0.35
    76.7

    • Marked as answer by JazLady Wednesday, February 26, 2014 10:20 PM
    Wednesday, February 26, 2014 10:20 PM