How to programmatically transfer multiple values ​​to a report parameter? I pass like this:

ReportParameter id_shift = new ReportParameter("id_sectionshift", string.Join(", ", GlobalVariable.arrIdShift)); reportViewer1.ServerReport.SetParameters(new ReportParameter[] { id_shift }); this.reportViewer1.ServerReport.Refresh(); this.reportViewer1.RefreshReport(); 

After that I see this in the report:

enter image description here

If I fix it manually like this, then everything works:
enter image description here
I tried "," on ";" Does not help. Tried to make a footnote "\ n", also does not help. I knocked on the wheel, slammed the hood - I didn’t drag the spear method, I ask for help.

  • and so string.Join("\r\n", GlobalVariable.arrIdShift) ? - Ruslan_K
  • @Ruslan_K is the same: ((( - Winteriscoming

1 answer 1

It turned out you need to use another ReportParametr constructor. Earned when did so:

 reportViewer1.ServerReport.SetParameters(new ReportParameter ( "id_sectionshift", GlobalVariable.arrIdShift)); 

Where GlobalVariable.arrIdShift array of strings.

The answer got here .