Issue with MRT Template Scripts in StimulSoft

Stimulsoft Reports.JAVA discussion
Aurum
Posts: 7
Joined: Wed Sep 04, 2024 1:10 pm

Issue with MRT Template Scripts in StimulSoft

Post 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();
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue with MRT Template Scripts in StimulSoft

Post by Lech Kulikowski »

Hello,

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

Thank you.
Aurum
Posts: 7
Joined: Wed Sep 04, 2024 1:10 pm

Re: Issue with MRT Template Scripts in StimulSoft

Post 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
Attachments
example.zip
(10.63 KiB) Downloaded 347 times
Vadim
Posts: 409
Joined: Tue Apr 23, 2013 11:23 am

Re: Issue with MRT Template Scripts in StimulSoft

Post by Vadim »

Hello

Will be fixed from 2024.4.1 version
Aurum
Posts: 7
Joined: Wed Sep 04, 2024 1:10 pm

Re: Issue with MRT Template Scripts in StimulSoft

Post by Aurum »

Could you please tell me when version 2024.4.1 will be released?
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue with MRT Template Scripts in StimulSoft

Post by Lech Kulikowski »

Hello,

It will be available within two or three weeks.

Thank you.
Aurum
Posts: 7
Joined: Wed Sep 04, 2024 1:10 pm

Re: Issue with MRT Template Scripts in StimulSoft

Post 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
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue with MRT Template Scripts in StimulSoft

Post 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.
Aurum
Posts: 7
Joined: Wed Sep 04, 2024 1:10 pm

Re: Issue with MRT Template Scripts in StimulSoft

Post 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?
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: Issue with MRT Template Scripts in StimulSoft

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply