Report Server Multiple Value multi-value selection

Source: Internet
Author: User

I. project requirements

During project creation today, there is a requirement as follows: there is a report in The Report Server, and the report has a parameter doctor_name, which allows multiple values, all by default. However, it is meaningless to select multiple options on the front-end page. Therefore, you need to select one option. However, you need to select multiple options on other pages. Therefore, set doctor_name to allow multiple values. Therefore, the specific requirement is that when a doctor is selected on the front-end page, the report information of the doctor is queried. If no doctor is selected, all doctors are selected by default (equivalent to multiple values ).

Ii. Solutions

Set the dataset query statement.

SELECT  ... FROM ...    WHERE   (yourcolumname IN (@doctor_name))

Set the dataset as a parameter expression

The parameter expression is:

=SPLIT(JOIN(Parameters!doctor_name.Value,","),",")

Now, in the background of the front-end ASPX page, we can upload an array.

 string[] doctorlist = new string[this.lbxListDoctor.Items.Count]; for (int i = 0; i < this.lbxListDoctor.Items.Count; i++) {     doctorlist[i] = this.lbxListDoctor.Items[i].Value; } var rpdoctor = new Microsoft.Reporting.WebForms.ReportParameter("doctor_name", doctorlist); serverReport.SetParameters(rpdoctor); 

 

Report Server Multiple Value multi-value selection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.