About Class-Defined Template Problem

I use the class definition template for testing. The code is as follows:

@Component(TestReport.NAME)
public class TestReport implements CustomReport {
    public static final String NAME = “cubahrp_TestReport”;

    @Override
    public byte[] createReport(Report report, BandData rootBand, Map<String, Object> params) {
        if(!(report instanceof com.haulmont.reports.entity.Report)){
            return new byte[0];
        }
        com.haulmont.reports.entity.ReportTemplate reportTemplate = ((com.haulmont.reports.entity.Report) report).getDefaultTemplate();
        byte[] templateByte = reportTemplate.getContent();

        return templateByte;
    }
}

I found that the custom returned template file did not fill in the data after run report.
I think it’s a BUG.
I’m sorry for my poor English. I hope it won’t affect your understanding.

Can anyone reply to me?

I tracked the code and found that the class definition template did not actually perform data filling operations. I think it should be renamed as a custom report rather than a class definition template.
image
I hope to dynamically modify the word template through code before filling in the report data. I wonder if there are any other solutions?
Thanks!

Hello @jy00882735

Could you share a sample project that demonstrates the problem? Could you also clarify why you declared report template as a bean?

According documentation you should use FQN in report template editor to use class-defined template.

Regards,
Daniil

hi,Daniil
thank you for your reply.
I am just borrowed the method of creating beans to create classes in the core module, and I have defined FQA in the template. As shown in the figure:
image
My problem is that I want to be able to dynamically modify template content through code before YARG fills in data.
But now, with Class-Defined Template, YARG is no longer filling in data.