Page 1 of 1

Access String List of variable

Posted: Tue Jul 23, 2019 1:42 pm
by ga6riel
Hello,

I have this variable in my report:

Image

How can I access the items list by JavaScript code?

Code: Select all

this.report.dictionary.variables.getByName("breedList").????
Thank you.

Re: Access String List of variable

Posted: Thu Jul 25, 2019 8:17 am
by Lech Kulikowski
Hello,

Please check the following code:

Code: Select all

var newVariable = new Stimulsoft.Report.Dictionary.StiVariable();
newVariable.name = "Variable";
newVariable.alias = "Variable";
newVariable.type = Stimulsoft.System.StimulsoftStringList;
newVariable.requestFromUser = true;


var di = new Stimulsoft.Report.Dictionary.StiDialogInfo();
di.allowUserValues = false;
di.keys = ["1", "2", "3", "4"];
di.values = ["1", "2", "3", "4"];


newVariable.dialogInfo = di;


report.dictionary.variables.add(newVariable);
designer.onPreviewReport = function (args) {
  args.report.setVariable("Variable", ["1", "4"]);}
Thank you.

Re: Access String List of variable

Posted: Fri Jul 26, 2019 9:08 am
by ga6riel
Hello,

That's it, thank you!

Re: Access String List of variable

Posted: Mon Jul 29, 2019 7:10 am
by Lech Kulikowski
Hello,

We are always glad to help you.

Thank you.

Re: Access String List of variable

Posted: Wed Feb 12, 2020 3:46 am
by Stevechin83
Hello,

If i want to select all list element to filter, how should I pass the data from C#?

Thank you.

Re: Access String List of variable

Posted: Thu Feb 13, 2020 9:52 pm
by Lech Kulikowski
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?

Thank you.