While converting XLSX to PDF Dynamic marker is not working

I have applied Dynamic marker in template.xlsx but it is not reflecting in Generated PDF file.

JAVA Code .

WorkbookDesigner w=new WorkbookDesigner();
Template template=dao.getTemplate(templateID);

    InputStream inputStream=new ByteArrayInputStream(template.getTemplateData());

    Workbook workbook=new Workbook(inputStream);
    w.setWorkbook(workbook);

    DataSource dataSourse=dao.getTemplateData();
    List<DataSource> ds= new ArrayList<>();
    ds.add(dataSourse);
    w.setDataSource("DS",ds);
    w.process(false);
    w.getWorkbook().save("I:/Sample2.pdf", SaveFormat.Pdf); 

Template.xlsx

Applying Formula to Cell B.

&=&=CONCATENATE(“any case within-----”,A{r}, “of the date of this letter”)

Simple Concatenate is not working while converting to PDF .

For testing , I have tried to convert in XLSX . It is working but for PDF conversion not working

@Smital279,

Please call Workbook.calculateFormula() method before rendering to PDF file format, it should fix your issue. In case, you still find the issue, kindly do provide a standalone (runnable) console application, zip the project and post us with all the resource files, we will check it soon.

Thanks Amjad,

I tried to call before save method .
workbook.calculateFormula();
w.getWorkbook().save(“I:/Sample2.pdf”,SaveFormat.Pdf);

But now, in generated PDF i am getting value as #NAME?

Do i need to set formula?

ZIP file uploading taking loonger time .

I have send mail to your forum . Could you please check that .

Thanks Amjad,

I tried to call before save method .
workbook.calculateFormula();
w.getWorkbook().save(“I:/Sample2.pdf”,SaveFormat.Pdf);

But now, in generated PDF i am getting value as #NAME?

Do i need to set formula?

Hello amjad.sahi

Please find attachment of template . I want to concat line number 27,28,29 to Line number 30

Could you please check and revert

~WRD0002.jpg (357 Bytes)

(Attachment template1.xlsx is missing)

@Smital279,
To reduce the file size, you can simulate data by adding only problematic cell data. Finally zip the project and post us with all the resource files, we will check it soon

Issue has been resolved . Thanks for Support

I am able to concat the cells

Issue has been resolved . Thanks for Support

It works. workbook.calculateFormula()

But it is not applying BOLD and Underline text while concatenating . It did only concatenation .

How can we apply formatting as well while concatenation

@Smital279,
When generating a template, you can style the corresponding cells in the template. When importing data, those data will inherit the styles in the template.

I want to specific Line only BOLD and underline . remaining text will be in normal

Example :-1:
any case within 30 calendar days of the date of this letter.

Here’ 30 Calendar days’ should be BOLD and UNDERLINE.
I have applied this property corresponding cells but while importing/concatenating, it is not showing

@Smital279,
Would you like to provide your template file and executable console project? We will check it soon.
Or you can refer to the link below. We set the style in the template, and after importing the data, the data also inherits the style set in the template.
Failed to get Smart Marker in Text while generating PDF - #3 by John.He

ASPOSE-POC.zip (11.0 KB)

Please check this .

InputStream inputStream=new ByteArrayInputStream(template.getTemplateData());

Here we are getting template1.xlsx and then we are saving in PDF
in template1.xlsx -> sheet 1-> Cell No-> A30

We are applying concatenation as =CONCAT(‘sheet 2’!A3,‘sheet 2’!A4,‘sheet 2’!A5)

later on we are deleting while generation.

Problem statement :- Sheet2-> cell->A 4
Not applying BOLD and Underline while importing

@Smital279,

Thanks for the sample with template file.

I checked your template file and sample. This is expected behavior. This is same with MS Excel. Please try to perform the similar task in MS Excel manually, e.g., enter the CONCAT formula to merge some strings (a cell should have bold and underline text). You will notice the resultant cell won’t show those bold/underline text in the final string.

As requested earlier, to set specific text bold/underline form a string, you may apply formattings using the relevant API later on after your markers are processed and data is filled into the cells, see the document with example code for your reference.