Multi-Value Determination in reporting service using self-developed algorithms

Source: Internet
Author: User
Prerequisites : Reports are made using the reporting service. If you want to determine which options are selected in the multiple select drop-down box, you cannot determine the options. For example, the corresponding value is displayed according to the options.
Function implementation : UseAlgorithmImplement Multi-Value Determination in reporting service.
Algorithm Description : Set A = 1, B = 2, c = 4, D = 8, E = 16, F = 32. What can we see from this set of numbers? It is easy to get that their values are 2's n-1 power. What else? It is easy to ignore that B = a + 1, C = a + B + 1, D = A + B + C + 1, E = A + B + C + D + 1, F = A + B + C + D + E + 1. This rule determines one thing. If each number can only be used once, given a value, it is the only number that determines the value generation. In the multi-choice drop-down box, each number can be used only once. Therefore, if a value is assigned to each option, their value can be used to determine whether the option is selected. After a period of verification, I got the determination method as follows: divide the value by the value of the option to be determined, take the integer part and divide it by 2, and then take the remainder. If the remainder is 1, it will be selected, use pseudoCodeIndicates:
If (sum \ value mod 2 = 1) return true, whether the algorithm has been defined by the predecessors I do not know, I am relatively poor in mathematics, if you already have it, then laugh.
Implementation : Add an internal parameter to save the value. The value can be obtained through the SQL statement as follows:
Select sum (VAL) as sum from
(Select 1 as Val, 'A' as SEL
Union
Select 2, 'B'
Union
Select 4, 'C'
Union
Select 8, 'D'
Union
Select 16, 'E'
Union
Select 32, 'F') as t
Where T. Sel in (@ mulsel)
A \ B \ c \ D \ e \ f are the values of multiple parameters.
With this value, you can determine which values should be displayed and which should be hidden, and write the expression in "visibility.

Summary: This is just a method I have figured out. I think it is too difficult to build a car by closed doors. If there is a better way or I am in a dead end, I hope you will not give me any further advice. Here I will only give you some advice.

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.