| Auszug |
|---|
|
Nuclos ReportProvider: run(OutputFormat), run(format, Map), NuclosFile, run report from a rule, attachment, Java example. |
Language: Deutsch · English
ReportProvider
Run reports via the API – ReportProvider.run(...) returns a NuclosFile to attach or send.
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
What is the ReportProvider?
The ReportProvider is an API helper class with all methods for the programmatic execution of a report – e.g. from a server-side rule.
run(...)
Runs a report. You specify the output format, which is uniquely assigned to a report – so the format is sufficient. The return value is a NuclosFile that can, for example, be attached to a BO or sent by e-mail.
| Codeblock |
|---|
|
public static NuclosFile run(OutputFormat format) throws BusinessException; |
With parameters for the query:
| Codeblock |
|---|
|
public static NuclosFile run(OutputFormat format, Map<String, Object> params) throws BusinessException; |
Example
When an order is created, the report is executed automatically and the PDF is attached to the BO:
| Codeblock |
|---|
|
package org.nuclet.businessentity;
import org.nuclet.report.MeinAuftragReportRE;
import org.nuclos.api.common.NuclosFile;
import org.nuclos.api.provider.ReportProvider;
public class AuftragReportRegel implements InsertRule {
public void insert(InsertContext context) throws BusinessException {
Auftrag a = context.getBusinessObject(Auftrag.class);
NuclosFile result = ReportProvider.run(MeinAuftragReportRE.Deutsch_PDF);
a.insertAttachment(result, "Kommentar: Generierter Auftragsreport");
}
} |
Related pages