Page 1 of 1

Create variable from code.

Posted: Tue Sep 14, 2021 3:45 pm
by fabien
Hi,

i'm trying to create variable from code :

Code: Select all

var masquerlignesdetail = new Stimulsoft.Report.Dictionary.StiVariable();
masquerlignesdetail.name = "masquerlignesdetail";
masquerlignesdetail.alias = "masquerlignesdetail";
masquerlignesdetail.type = Stimulsoft.System.Int;
masquerlignesdetail.requestFromUser = false;
masquerlignesdetail.value = req.body.masquerlignesdetail;		// come from http post
var di = new Stimulsoft.Report.Dictionary.StiDialogInfo();
di.dateTimeType = "DateAndTime";
masquerlignesdetail.dialogInfo = di;
                        
report.dictionary.variables.add(masquerlignesdetail);   
but when i try to use it in a condition in band, it doesn't work (band is never disabled).

Code: Select all

dataBand.expressions.add(new Stimulsoft.Base.StiAppExpression('Enabled', "{masquerlignesdetail == 0}"));
where is my error ?

also, we don't see documentation for StiDialogInfo class in documentation : https://admin.stimulsoft.com/documentat ... lsoft.html

I also create a report from code : see liste.mrt in attached file.
but when i want to save this report, i've got a json parse error.
Where is my error ?

Thanks you,

Fabien.

Re: Create variable from code.

Posted: Thu Sep 16, 2021 1:18 pm
by Lech Kulikowski
Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.

Re: Create variable from code.

Posted: Fri Sep 24, 2021 12:09 pm
by Lech Kulikowski
Hello,

There are some errors in your code - incorrect types, conditions, etc. Please check the modified file in the attachment.

Thank you.

Re: Create variable from code.

Posted: Tue Oct 05, 2021 9:19 am
by fabien
Hello,

it works.

Thank you,

Fabien.

Re: Create variable from code.

Posted: Tue Oct 05, 2021 2:14 pm
by Lech Kulikowski
Hello Fabien,

You are welcome.