Create variable from code.

Stimulsoft Reports.JS discussion
Post Reply
fabien
Posts: 21
Joined: Thu Jul 15, 2021 9:07 am

Create variable from code.

Post 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.
Attachments
liste.mrt
(28.36 KiB) Downloaded 46 times
Lech Kulikowski
Posts: 4059
Joined: Tue Mar 20, 2018 5:34 am

Re: Create variable from code.

Post by Lech Kulikowski »

Hello,

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

Thank you.
Lech Kulikowski
Posts: 4059
Joined: Tue Mar 20, 2018 5:34 am

Re: Create variable from code.

Post 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.
Attachments
04. Edit report template in the designer.zip
(1.2 KiB) Downloaded 13 times
fabien
Posts: 21
Joined: Thu Jul 15, 2021 9:07 am

Re: Create variable from code.

Post by fabien »

Hello,

it works.

Thank you,

Fabien.
Lech Kulikowski
Posts: 4059
Joined: Tue Mar 20, 2018 5:34 am

Re: Create variable from code.

Post by Lech Kulikowski »

Hello Fabien,

You are welcome.
Post Reply