Unable to format output Excel file generated by Aspose API in our JAVA application

Hi, we are currently using Aspose cell v. 24.2 to generate Excel output file from a Excel template in our JAVA application. While the file is generated correctly and column style (i.e. decimal place 0 and use 1000 separator ) also been transferred to output file. The columns data in output file does not show the format at all. I try to use cell.setStyle to manually set the style but no luck.
I have uploaded my template and output files for your reference. Please look into the columns B, c, and D in the output_sample files and you can see these columns’ format have been set correctly yet the data is not showing the format(i.e. decimal place 0 and use 1000 separator) at all. Any help is greatly appreciated !

aspose_sample.zip (18.7 KB)

@jma,

Thanks for the sample files.

I evaluated your issue a bit. The source data should be in text/string in your case, that’s why when you render data (after processing markers), your desired formatting is not applied. Please use “numeric” parameter when defining those markers in the template Excel file. For example, you may change the markers in C5, D5 and E5 cells in the template file as following:
“&=Section0.current_ltot(numeric)”, “&=Section0.expected(numeric)” and “&=Section0.diff(numeric)”.

Let us know if you still find any issue.

Hi, thank you for your prompt response. I didn’t mention that we are using Jason file as our data source and I understand that Aspose cell does not support Json with smart marker in Java until early this year. I was unable to find enough information to help our team, so we decided to write our own code to load Json data into excel file with Aspose marker and it works well with us. Your reply does give me a hint, I was able to resolve the issue by setting 2nd parameter to true in putValue(value, true) and the format was displayed properly. I’d appreciate if you can send me some examples with both Json file and Java code that will show me how to use Aspose API to load a Jason file in JAVA in case we decide to use it later on. Again, thank you very much for your helps.

@jma
Thank you for your feedback. Regarding how to load and process JSON files and use smart markers in Java, please refer to the following documents.