Assigning value to List Variable
Posted: Tue Jun 03, 2014 6:13 pm
Our report has multiple variables that the user can select: date, text, and a list variables. We allow the user to save their filter values so that they don’t have to set them every time they reload the data. We do this by saving their previous selections and then automatically setting the variables when the report is reloaded.
We are saving the variable settings so that users can reload the data and not lose their variable selections. It works with the text and date variable fields, but not the list variables:
THIS IS WORKING - This is what we do to set the value for the text and date variable fields.
Text Variable: report.dictionary.variables['value'] = 'Company'
Date/Time Variable: report.dictionary.variables['value'] = 'DateTime,_x0030_1_x002F_1_x002F_2013_x0020_00_x003A_00_x003A_00_x0020_AM,_x0030_1_x002F_1_x002F_2014_x0020_00_x003A_00_x003A_00_x0020_AM'
THIS IS NOT WORKING – We try a similar approach for the list field, but it doesn’t work. I suspect we aren’t using the correct syntax.
List Variable:
report.dictionary.variables[0]['value'] = "Test 1,Test 2";
report.dictionary.variables[0]['value'] = "1,2";
Thank you
We are saving the variable settings so that users can reload the data and not lose their variable selections. It works with the text and date variable fields, but not the list variables:
THIS IS WORKING - This is what we do to set the value for the text and date variable fields.
Text Variable: report.dictionary.variables['value'] = 'Company'
Date/Time Variable: report.dictionary.variables['value'] = 'DateTime,_x0030_1_x002F_1_x002F_2013_x0020_00_x003A_00_x003A_00_x0020_AM,_x0030_1_x002F_1_x002F_2014_x0020_00_x003A_00_x003A_00_x0020_AM'
THIS IS NOT WORKING – We try a similar approach for the list field, but it doesn’t work. I suspect we aren’t using the correct syntax.
List Variable:
report.dictionary.variables[0]['value'] = "Test 1,Test 2";
report.dictionary.variables[0]['value'] = "1,2";
Thank you