ReportBuilder
Inheritance: java.lang.Object
public class ReportBuilder
Provides methods intended to fill template with data using LINQ Reporting Engine.
Methods
buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data)
public static void buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data)
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
data | java.lang.Object |
buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data, ReportBuilderOptions reportBuilderOptions)
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
data | java.lang.Object | |
reportBuilderOptions | ReportBuilderOptions |
buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data, String dataSourceName)
public static void buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data, String dataSourceName)
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
data | java.lang.Object | |
dataSourceName | java.lang.String |
buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data, String dataSourceName, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object data, String dataSourceName, ReportBuilderOptions reportBuilderOptions)
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
data | java.lang.Object | |
dataSourceName | java.lang.String | |
reportBuilderOptions | ReportBuilderOptions |
buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object[] data, String[] dataSourceNames)
public static void buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object[] data, String[] dataSourceNames)
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
data | java.lang.Object[] | |
dataSourceNames | java.lang.String[] |
buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object[] data, String[] dataSourceNames, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(InputStream inputStream, OutputStream outputStream, int saveFormat, Object[] data, String[] dataSourceNames, ReportBuilderOptions reportBuilderOptions)
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | |
outputStream | java.io.OutputStream | |
saveFormat | int | |
data | java.lang.Object[] | |
dataSourceNames | java.lang.String[] | |
reportBuilderOptions | ReportBuilderOptions |
buildReport(String inputFileName, String outputFileName, int saveFormat, Object data)
public static void buildReport(String inputFileName, String outputFileName, int saveFormat, Object data)
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
data | java.lang.Object |
buildReport(String inputFileName, String outputFileName, int saveFormat, Object data, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(String inputFileName, String outputFileName, int saveFormat, Object data, ReportBuilderOptions reportBuilderOptions)
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
data | java.lang.Object | |
reportBuilderOptions | ReportBuilderOptions |
buildReport(String inputFileName, String outputFileName, int saveFormat, Object data, String dataSourceName)
public static void buildReport(String inputFileName, String outputFileName, int saveFormat, Object data, String dataSourceName)
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
data | java.lang.Object | |
dataSourceName | java.lang.String |
buildReport(String inputFileName, String outputFileName, int saveFormat, Object data, String dataSourceName, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(String inputFileName, String outputFileName, int saveFormat, Object data, String dataSourceName, ReportBuilderOptions reportBuilderOptions)
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
data | java.lang.Object | |
dataSourceName | java.lang.String | |
reportBuilderOptions | ReportBuilderOptions |
buildReport(String inputFileName, String outputFileName, int saveFormat, Object[] data, String[] dataSourceNames)
public static void buildReport(String inputFileName, String outputFileName, int saveFormat, Object[] data, String[] dataSourceNames)
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
data | java.lang.Object[] | |
dataSourceNames | java.lang.String[] |
buildReport(String inputFileName, String outputFileName, int saveFormat, Object[] data, String[] dataSourceNames, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(String inputFileName, String outputFileName, int saveFormat, Object[] data, String[] dataSourceNames, ReportBuilderOptions reportBuilderOptions)
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | |
outputFileName | java.lang.String | |
saveFormat | int | |
data | java.lang.Object[] | |
dataSourceNames | java.lang.String[] | |
reportBuilderOptions | ReportBuilderOptions |
buildReport(String inputFileName, String outputFileName, Object data)
public static void buildReport(String inputFileName, String outputFileName, Object data)
Populates the template document with data from the specified source, generating a completed report.
Examples:
Shows how to populate document with data.
public void buildReportData() throws Exception {
// There is a several ways to populate document with data:
String doc = getMyDir() + "Reporting engine template - If greedy (Java).docx";
AsposeData obj = new AsposeData();
{
obj.setList(new ArrayList<>());
{
obj.getList().add("abc");
}
}
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.1.docx", obj);
ReportBuilderOptions options = new ReportBuilderOptions();
options.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.2.docx", obj, options);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.3.docx", SaveFormat.DOCX, obj);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.4.docx", SaveFormat.DOCX, obj, options);
}
public static class AsposeData
{
public ArrayList getList() { return mList; }; public void setList(ArrayList value) { mList = value; };
private ArrayList mList;
}
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | The input file name. |
outputFileName | java.lang.String | The output file name. |
data | java.lang.Object | A data source object. |
buildReport(String inputFileName, String outputFileName, Object data, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(String inputFileName, String outputFileName, Object data, ReportBuilderOptions reportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with additional options.
Examples:
Shows how to populate document with data.
public void buildReportData() throws Exception {
// There is a several ways to populate document with data:
String doc = getMyDir() + "Reporting engine template - If greedy (Java).docx";
AsposeData obj = new AsposeData();
{
obj.setList(new ArrayList<>());
{
obj.getList().add("abc");
}
}
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.1.docx", obj);
ReportBuilderOptions options = new ReportBuilderOptions();
options.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.2.docx", obj, options);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.3.docx", SaveFormat.DOCX, obj);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportWithObject.4.docx", SaveFormat.DOCX, obj, options);
}
public static class AsposeData
{
public ArrayList getList() { return mList; }; public void setList(ArrayList value) { mList = value; };
private ArrayList mList;
}
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | The input file name. |
outputFileName | java.lang.String | The output file name. |
data | java.lang.Object | A data source object. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
buildReport(String inputFileName, String outputFileName, Object data, String dataSourceName)
public static void buildReport(String inputFileName, String outputFileName, Object data, String dataSourceName)
Populates the template document with data from the specified source, generating a completed report with a named data source reference.
Examples:
Shows how to populate document with data sources.
public void buildReportDataSource() throws Exception
{
// There is a several ways to populate document with data sources:
String doc = getMyDir() + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.2.docx", new Object[] { sender }, new String[] { "s" });
ReportBuilderOptions options = new ReportBuilderOptions();
options.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.3.docx", sender, "s", options);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.4.docx", SaveFormat.DOCX, sender, "s");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.5.docx", SaveFormat.DOCX, sender, "s", options);
}
public static class MessageTestClass
{
public String getName() { return mName; }; public void setName(String value) { mName = value; };
private String mName;
public String getMessage() { return mMessage; }; public void setMessage(String value) { mMessage = value; };
private String mMessage;
public MessageTestClass(String name, String message)
{
setName(name);
setMessage(message);
}
}
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | The input file name. |
outputFileName | java.lang.String | The output file name. |
data | java.lang.Object | A data source object. |
dataSourceName | java.lang.String | A name to reference the data source object in the template. |
buildReport(String inputFileName, String outputFileName, Object data, String dataSourceName, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(String inputFileName, String outputFileName, Object data, String dataSourceName, ReportBuilderOptions reportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with a named data source reference and additional options.
Examples:
Shows how to populate document with data sources.
public void buildReportDataSource() throws Exception
{
// There is a several ways to populate document with data sources:
String doc = getMyDir() + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.2.docx", new Object[] { sender }, new String[] { "s" });
ReportBuilderOptions options = new ReportBuilderOptions();
options.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.3.docx", sender, "s", options);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.4.docx", SaveFormat.DOCX, sender, "s");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.5.docx", SaveFormat.DOCX, sender, "s", options);
}
public static class MessageTestClass
{
public String getName() { return mName; }; public void setName(String value) { mName = value; };
private String mName;
public String getMessage() { return mMessage; }; public void setMessage(String value) { mMessage = value; };
private String mMessage;
public MessageTestClass(String name, String message)
{
setName(name);
setMessage(message);
}
}
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | The input file name. |
outputFileName | java.lang.String | The output file name. |
data | java.lang.Object | A data source object. |
dataSourceName | java.lang.String | A name to reference the data source object in the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
buildReport(String inputFileName, String outputFileName, Object[] data, String[] dataSourceNames)
public static void buildReport(String inputFileName, String outputFileName, Object[] data, String[] dataSourceNames)
Populates the template document with data from multiple sources, generating a completed report from the specified input and output file names. This overload automatically determines the save format based on the output file extension.
Examples:
Shows how to populate document with data sources.
public void buildReportDataSource() throws Exception
{
// There is a several ways to populate document with data sources:
String doc = getMyDir() + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.2.docx", new Object[] { sender }, new String[] { "s" });
ReportBuilderOptions options = new ReportBuilderOptions();
options.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.3.docx", sender, "s", options);
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.4.docx", SaveFormat.DOCX, sender, "s");
ReportBuilder.buildReport(doc, getArtifactsDir() + "LowCode.BuildReportDataSource.5.docx", SaveFormat.DOCX, sender, "s", options);
}
public static class MessageTestClass
{
public String getName() { return mName; }; public void setName(String value) { mName = value; };
private String mName;
public String getMessage() { return mMessage; }; public void setMessage(String value) { mMessage = value; };
private String mMessage;
public MessageTestClass(String name, String message)
{
setName(name);
setMessage(message);
}
}
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | The input file name. |
outputFileName | java.lang.String | The output file name. |
data | java.lang.Object[] | An array of data source objects. |
dataSourceNames | java.lang.String[] | An array of names to reference the data source objects within the template. |
buildReport(String inputFileName, String outputFileName, Object[] data, String[] dataSourceNames, ReportBuilderOptions reportBuilderOptions)
public static void buildReport(String inputFileName, String outputFileName, Object[] data, String[] dataSourceNames, ReportBuilderOptions reportBuilderOptions)
Populates the template document with data from multiple sources, generating a completed report with additional options. This overload automatically determines the save format based on the output file extension.
Parameters:
Parameter | Type | Description |
---|---|---|
inputFileName | java.lang.String | The input file name. |
outputFileName | java.lang.String | The output file name. |
data | java.lang.Object[] | An array of data source objects. |
dataSourceNames | java.lang.String[] | An array of names to reference the data source objects within the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |