Aspose Cells Java - Smart markers - Strange behaviour with simple bean

Hi Aspose Cells team,


I was about going mad not being able to use a simple smart marker as: &=myObject.myField
Here is a test case to reproduce my issue.
Could you explain the difference in behaviour I have running the following code on both test1.xlsx and test2.xlsx?

Thread thread = new Thread();
thread.setName(“myThread”);

WorkbookDesigner designer1 = new WorkbookDesigner(new Workbook(“M:/tmp/test1.xlsx”));
designer1.setDataSource(“thread”, thread);
designer1.process();
designer1.getWorkbook().save(“M:/tmp/test1-out.xlsx”);

WorkbookDesigner designer2 = new WorkbookDesigner(new Workbook(“M:/tmp/test2.xlsx”));
designer2.setDataSource(“thread”, thread);
designer2.process();
designer2.getWorkbook().save(“M:/tmp/test2-out.xlsx”);

Thanks,
Jean.

Forgot to precise : I’m using Aspose Cells Java 8.9.2


Hi,


Thanks for the template files.

After an initial test, I observed the issue as you mentioned by using your sample code with your template files. I found some strange behaviour with simple bean using Smart Markers, if we do not use or omit the last marker in the template file, it does not work anymore.
i.e.,
&=$thread(bean)
&=thread.name
&=thread.name(bean) //if we omit this marker, it does not work.

I have logged an investigation ticket with an id “CELLSJAVA-41997” for your issue. Our concerned developer from product team will investigate and look into it what is causing this behavior.

Once we figure it out, we will let you know here.

Thank you.
Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java v9.0.7 and let us know your feedback.

Hi Shakeel,


Sorry but this is even more confusing with 9.0.7:

&=$thread(bean) // works as expected
&=thread.name // does NOT work (it should as it is the correct syntax according to documentation)
&=thread.name(bean) // does not work (syntax is not correct anyway)
&=thread.name(bean) // uh? same marker as above but this one works…

Regards,
Jean.

Hi,


Thanks for your feedback and using Aspose.Cells.

We have re-opened this issue and working on it. Once, there is some fix or other news for you, we will update you asap.

Hi,

Thanks for using Aspose.Cells.

This is to inform you that we have fixed your issue CELLSJAVA-41997 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java v9.0.9 and let us know your feedback.

Hi Shakeel,


It works fine… if you confirm that to display a simple POJO field we have to use the following syntax: &=thread.name(bean)

It’s not clear from the documentation nor the samples.

Regards,
Jean.

Hi,


Thanks for your feedback and using Aspose.Cells.

I have tested your sample code as below with the latest version: Aspose.Cells for Java v9.0.9 and attached the output excel files. Please let me know which of the excel file is wrong. Please also provide the expected excel file(s) so that we could look into it further and in case of error, fix it. Thanks for your cooperation in this regard and have a good day.

Java
Thread thread = new Thread();
thread.setName(“myThread”);

WorkbookDesigner designer1 = new WorkbookDesigner(new Workbook(dirPath + “test1.xlsx”));
designer1.setDataSource(“thread”, thread);
designer1.process();
designer1.getWorkbook().save(dirPath + “test1-sha.xlsx”);

WorkbookDesigner designer2 = new WorkbookDesigner(new Workbook(dirPath + “test2.xlsx”));
designer2.setDataSource(“thread”, thread);
designer2.process();
designer2.getWorkbook().save(dirPath + “test2-sha.xlsx”);


Hi Shakeel,


Thanks for your samples - they confirm that to display a Java bean attribute, one must use: &=myBean.myAttribute(bean)

It should be nice to have this case illustrated the documentation.

Regards,
Jean.

Hi Jean,


Thanks for your feedback and using Aspose.Cells.

It seems, your issue is resolved. Kindly confirm if. We will surely update the documentation soon.

The issues you have found earlier (filed as CELLSJAVA-41997) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.