Page 1 of 2

Issue with MRT Template Scripts in StimulSoft

Posted: Fri Sep 06, 2024 10:24 am
by Aurum
My colleagues send me an MRT template created in the StimulSoft system version 2024.2.2. In my Java application, I use the latest version of the library, 2024.3.4 (currently in trial mode; we’ll switch to the full version once it works as expected). Now, the question is: within the MRT file, there are scripts, for example:

Code: Select all

WARN 37403 --- [nio-8080-exec-1] c.s.report.engine.parser.StiParser       : Parser error: Field, method, or property is not found: 'CountData'
InputExpression: DataBand2.CountData = (8 - (TestData % 2)) position: 51
As far as I know, CountData is a built-in script.  
I also downgraded to version 2024.2.2 in my Java application, but the result was the same.

Question:
To ensure these scripts work correctly, should I modify the MRT file creation process or adjust the Java code somewhere?

Java code is attached below:

Code: Select all

StiReport report = StiSerializeManager.deserializeReport(mrtReport);
StiXmlDatabase database = new StiXmlDatabase(name, xsd, xml);
report.getDictionary().getDatabases().add(database);
report.render();

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Fri Sep 06, 2024 2:22 pm
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Fri Sep 06, 2024 2:50 pm
by Aurum
I’ve attached the recording and logs of the Java application.

Code: Select all

2024-09-06 17:40:43.725  WARN 84393 --- [nio-8080-exec-1] c.s.report.engine.parser.StiParser       : Parser error: Field, method, or property is not found: 'CountData'
InputExpression: DataBand4.CountData = (4-(УвИсчСумНалог.Count % 4)) position: 51
2024-09-06 17:40:43.725  WARN 84393 --- [nio-8080-exec-1] c.s.report.engine.parser.StiParser       : Expression in Text property of 'Text97' can't be evaluated! Parser error: Field, method, or property is not found: 'CountData'
InputExpression: DataBand4.CountData = (4-(УвИсчСумНалог.Count % 4)) position: 51
2024-09-06 17:40:43.760  WARN 84393 --- [nio-8080-exec-1] c.stimulsoft.base.utils.StiLoggingUtil   : Error: argList= 01/01/2001 12:00:00 AM 6 4, objName=Substring, customFunctionName=null
Parser error: The 'Substring' function has invalid argument '1': cannot convert from 'class com.stimulsoft.base.system.StiDateTime' to 'string'
2024-09-06 17:40:43.770  WARN 84393 --- [nio-8080-exec-1] c.s.r.c.simplecomponents.StiSimpleText   : Component: TextInCells62 value: null
2024-09-06 17:40:43.771  WARN 84393 --- [nio-8080-exec-1] c.stimulsoft.base.utils.StiLoggingUtil   : Component: TextInCells62 value: null
For input string: "34.00"
2024-09-06 17:40:43.774  WARN 84393 --- [nio-8080-exec-1] c.stimulsoft.base.utils.StiLoggingUtil   : Error: argList= 01/01/2002 12:00:00 AM 6 4, objName=Substring, customFunctionName=null
Parser error: The 'Substring' function has invalid argument '1': cannot convert from 'class com.stimulsoft.base.system.StiDateTime' to 'string'
2024-09-06 17:40:43.776  WARN 84393 --- [nio-8080-exec-1] c.s.r.c.simplecomponents.StiSimpleText   : Component: TextInCells62 value: null
2024-09-06 17:40:43.776  WARN 84393 --- [nio-8080-exec-1] c.stimulsoft.base.utils.StiLoggingUtil   : Component: TextInCells62 value: null
For input string: "0.0"
2024-09-06 17:40:43.778  WARN 84393 --- [nio-8080-exec-1] c.stimulsoft.base.utils.StiLoggingUtil   : Error: argList= 01/01/2003 12:00:00 AM 6 4, objName=Substring, customFunctionName=null
Parser error: The 'Substring' function has invalid argument '1': cannot convert from 'class com.stimulsoft.base.system.StiDateTime' to 'string'
etc

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Mon Sep 09, 2024 12:44 pm
by Vadim
Hello

Will be fixed from 2024.4.1 version

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Mon Sep 09, 2024 1:46 pm
by Aurum
Could you please tell me when version 2024.4.1 will be released?

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Tue Sep 10, 2024 6:55 am
by Lech Kulikowski
Hello,

It will be available within two or three weeks.

Thank you.

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Fri Oct 11, 2024 12:14 pm
by Aurum
Good afternoon! We switched to version 2024.4.1. Today we tried to test it, but the issue is still relevant. It sends the same warnings.

Code: Select all

2024-10-11 15:13:03.157  WARN 57504 --- [nio-8080-exec-1] c.s.report.engine.parser.StiParser       : Parser error: Field, method, or property is not found: 'CountData'
InputExpression: DataBand4.CountData = (4-(УвИсчСумНалог.Count % 4)) position: 51
2024-10-11 15:13:03.158  WARN 57504 --- [nio-8080-exec-1] c.s.report.engine.parser.StiParser       : Expression in Text property of 'Text97' can't be evaluated! Parser error: Field, method, or property is not found: 'CountData'
InputExpression: DataBand4.CountData = (4-(УвИсчСумНалог.Count % 4)) position: 51

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Tue Oct 15, 2024 10:11 am
by Lech Kulikowski
Hello,

Your expression in the Text97 will work only in the Compilation mode. In the Java version, Compilation mode is not supported.

Thank you.

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Tue Oct 15, 2024 10:24 am
by Aurum
Good day!
But there is a method, isn't it?

Code: Select all

setCalculationMode(StiCalculationMode.Compilation);
And if this doesn't work, will support for compilation mode be added in Java?

Re: Issue with MRT Template Scripts in StimulSoft

Posted: Tue Oct 15, 2024 12:25 pm
by Lech Kulikowski
Hello,

No. The Compilation mode is available in the NET-based products only.

Thank you.