cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert a array of a memberinfo to a singlevariablevalue

Wolf_P_aus_L
Explorer
0 Kudos
252

Hi there,

I'm not that familiar with SAC yet. My goal is to get selected values (customer numbers) from different InputControls (different hierarchies) into a dynamic text via a script variable. There should only be one text passage in the report where the selected customer number appears.

In the first attempt I used this coding, which does not work due to this error message.

var KH1 = InputControl_1.getInputControlDataSource().getActiveSelectedMembers();

var KH1_T = cast(Type.SingleVariableValue, KH1); // --> this error message appears here: Invalid argument at Index 2: Cannot convert from "Array of Memberinfo" to SingleVariableValue

vCustomerNumber1 = KH1_T; // vCustomerNumber1 --> Script Variable

Does anyone have an idea how I could solve this problem?

Many thanks in advance!

VG
Wolf

View Entire Topic
jain10
Discoverer

Hi ,

How do u want to display the text of the input control? Will it be only parent node or Parent node along with child?

I have written this code assuming u require to display the Parent node and its children selected in input control

var list=InputControl_1.getInputControlDataSource().getActiveSelectedMembers();
for(var i=0;i<list.length;i++)
{
vCustomerNumber1.push(list[i].description);
}
 
for(i=0;i<vCustomerNumber1.length;i++){
vCustomerNumber3=vCustomerNumber3.concat(vCustomerNumber1[i]).concat(",");
}

vCustomerNumber1 defined as Array of strings

vCustomerNumber3 defined as string

Wolf_P_aus_L
Explorer
0 Kudos
Hi jain10, Thanks for your solution! It works fine! I've got one more question. Can I integrate other InputControls in this Coding? BR Wolf
jain10
Discoverer
0 Kudos
Yes,you can.You can write the same code for another Script variable(with diff input control)