BuildReport
BuildReport(string, string, object, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with additional options.
public static void BuildReport(string inputFileName, string outputFileName, object data,
ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
data | Object | A data source object. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to populate document with data.
public void BuildReportData()
{
// There is a several ways to populate document with data:
string doc = MyDir + "Reporting engine template - If greedy.docx";
AsposeData obj = new AsposeData { List = new List<string> { "abc" } };
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.1.docx", obj);
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.2.docx", obj, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.3.docx", SaveFormat.Docx, obj);
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.4.docx", SaveFormat.Docx, obj, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
}
public class AsposeData
{
public List<string> List { get; set; }
}
See Also
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, SaveFormat, object, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with specified output format and additional options.
public static void BuildReport(string inputFileName, string outputFileName, SaveFormat saveFormat,
object data, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveFormat | SaveFormat | The output’s save format. |
data | Object | A data source object. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to populate document with data.
public void BuildReportData()
{
// There is a several ways to populate document with data:
string doc = MyDir + "Reporting engine template - If greedy.docx";
AsposeData obj = new AsposeData { List = new List<string> { "abc" } };
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.1.docx", obj);
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.2.docx", obj, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.3.docx", SaveFormat.Docx, obj);
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportWithObject.4.docx", SaveFormat.Docx, obj, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
}
public class AsposeData
{
public List<string> List { get; set; }
}
See Also
- enum SaveFormat
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, SaveOptions, object, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with specified output format and additional options.
public static void BuildReport(string inputFileName, string outputFileName,
SaveOptions saveOptions, object data, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveOptions | SaveOptions | The output’s save options. |
data | Object | A data source object. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- class SaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(Stream, Stream, SaveFormat, object, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with specified output format and additional options, from input and output streams.
public static void BuildReport(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
object data, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
outputStream | Stream | The output file stream. |
saveFormat | SaveFormat | The output’s save format. |
data | Object | A data source object. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
Examples
Shows how to populate document with data using documents from the stream.
// There is a several ways to populate document with data using documents from the stream:
AsposeData obj = new AsposeData { List = new List<string> { "abc" } };
using (FileStream streamIn = new FileStream(MyDir + "Reporting engine template - If greedy.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, obj);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, obj, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataStream.3.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
}
See Also
- enum SaveFormat
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(Stream, Stream, SaveOptions, object, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with specified output format and additional options, from input and output streams.
public static void BuildReport(Stream inputStream, Stream outputStream, SaveOptions saveOptions,
object data, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
outputStream | Stream | The output file stream. |
saveOptions | SaveOptions | The output’s save options. |
data | Object | A data source object. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
See Also
- class SaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, object, string, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with a named data source reference and additional options.
public static void BuildReport(string inputFileName, string outputFileName, object data,
string dataSourceName, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
data | Object | A data source object. |
dataSourceName | String | A name to reference the data source object in the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to populate document with data sources.
public void BuildReportDataSource()
{
// There is a several ways to populate document with data sources:
string doc = MyDir + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.2.docx", new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.3.docx", sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.4.docx", SaveFormat.Docx, sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.5.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.6.docx", SaveFormat.Docx, sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.7.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.8.docx", new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
Stream[] images = ReportBuilder.BuildReportToImages(doc, new ImageSaveOptions(SaveFormat.Png), new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilderContext reportBuilderContext = new ReportBuilderContext();
reportBuilderContext.ReportBuilderOptions.MissingMemberMessage = "Missed members";
reportBuilderContext.DataSources.Add(sender, "s");
ReportBuilder.Create(reportBuilderContext)
.From(doc)
.To(ArtifactsDir + "LowCode.BuildReportDataSource.9.docx")
.Execute();
}
public class MessageTestClass
{
public string Name { get; set; }
public string Message { get; set; }
public MessageTestClass(string name, string message)
{
Name = name;
Message = message;
}
}
See Also
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, SaveFormat, object, string, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with specified output format, a named data source reference, and additional options.
public static void BuildReport(string inputFileName, string outputFileName, SaveFormat saveFormat,
object data, string dataSourceName, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveFormat | SaveFormat | The output’s save format. |
data | Object | A data source object. |
dataSourceName | String | A name to reference the data source object in the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to populate document with data sources.
public void BuildReportDataSource()
{
// There is a several ways to populate document with data sources:
string doc = MyDir + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.2.docx", new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.3.docx", sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.4.docx", SaveFormat.Docx, sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.5.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.6.docx", SaveFormat.Docx, sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.7.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.8.docx", new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
Stream[] images = ReportBuilder.BuildReportToImages(doc, new ImageSaveOptions(SaveFormat.Png), new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilderContext reportBuilderContext = new ReportBuilderContext();
reportBuilderContext.ReportBuilderOptions.MissingMemberMessage = "Missed members";
reportBuilderContext.DataSources.Add(sender, "s");
ReportBuilder.Create(reportBuilderContext)
.From(doc)
.To(ArtifactsDir + "LowCode.BuildReportDataSource.9.docx")
.Execute();
}
public class MessageTestClass
{
public string Name { get; set; }
public string Message { get; set; }
public MessageTestClass(string name, string message)
{
Name = name;
Message = message;
}
}
See Also
- enum SaveFormat
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, SaveOptions, object, string, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with specified output format, a named data source reference, and additional options.
public static void BuildReport(string inputFileName, string outputFileName,
SaveOptions saveOptions, object data, string dataSourceName,
ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveOptions | SaveOptions | The output’s save options. |
data | Object | A data source object. |
dataSourceName | String | A name to reference the data source object in the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- class SaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(Stream, Stream, SaveFormat, object, string, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with a named data source reference and additional options.
public static void BuildReport(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
object data, string dataSourceName, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
outputStream | Stream | The output file stream. |
saveFormat | SaveFormat | The output’s save format. |
data | Object | A data source object. |
dataSourceName | String | A name to reference the data source object in the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
Examples
Shows how to populate document with data sources using documents from the stream.
// There is a several ways to populate document with data sources using documents from the stream:
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
using (FileStream streamIn = new FileStream(MyDir + "Report building.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataSourceStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, new object[] { sender }, new[] { "s" });
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataSourceStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, sender, "s");
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataSourceStream.3.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
Stream[] images = ReportBuilder.BuildReportToImages(streamIn, new ImageSaveOptions(SaveFormat.Png), new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilderContext reportBuilderContext = new ReportBuilderContext();
reportBuilderContext.ReportBuilderOptions.MissingMemberMessage = "Missed members";
reportBuilderContext.DataSources.Add(sender, "s");
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataSourceStream.4.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.Create(reportBuilderContext)
.From(streamIn)
.To(streamOut, SaveFormat.Docx)
.Execute();
}
See Also
- enum SaveFormat
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(Stream, Stream, SaveOptions, object, string, ReportBuilderOptions)
Populates the template document with data from the specified source, generating a completed report with a named data source reference and additional options.
public static void BuildReport(Stream inputStream, Stream outputStream, SaveOptions saveOptions,
object data, string dataSourceName, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
outputStream | Stream | The output file stream. |
saveOptions | SaveOptions | The output’s save options. |
data | Object | A data source object. |
dataSourceName | String | A name to reference the data source object in the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
See Also
- class SaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, object[], string[], 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.
public static void BuildReport(string inputFileName, string outputFileName, object[] data,
string[] dataSourceNames, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
data | Object[] | An array of data source objects. |
dataSourceNames | String[] | An array of names to reference the data source objects within the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to populate document with data sources.
public void BuildReportDataSource()
{
// There is a several ways to populate document with data sources:
string doc = MyDir + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.2.docx", new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.3.docx", sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.4.docx", SaveFormat.Docx, sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.5.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.6.docx", SaveFormat.Docx, sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.7.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.8.docx", new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
Stream[] images = ReportBuilder.BuildReportToImages(doc, new ImageSaveOptions(SaveFormat.Png), new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilderContext reportBuilderContext = new ReportBuilderContext();
reportBuilderContext.ReportBuilderOptions.MissingMemberMessage = "Missed members";
reportBuilderContext.DataSources.Add(sender, "s");
ReportBuilder.Create(reportBuilderContext)
.From(doc)
.To(ArtifactsDir + "LowCode.BuildReportDataSource.9.docx")
.Execute();
}
public class MessageTestClass
{
public string Name { get; set; }
public string Message { get; set; }
public MessageTestClass(string name, string message)
{
Name = name;
Message = message;
}
}
See Also
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, SaveFormat, object[], string[], ReportBuilderOptions)
Populates the template document with data from multiple sources, generating a completed report with a specified output format and additional options.
public static void BuildReport(string inputFileName, string outputFileName, SaveFormat saveFormat,
object[] data, string[] dataSourceNames, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveFormat | SaveFormat | The output’s save format. |
data | Object[] | An array of data source objects. |
dataSourceNames | String[] | An array of names to reference the data source objects within the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to populate document with data sources.
public void BuildReportDataSource()
{
// There is a several ways to populate document with data sources:
string doc = MyDir + "Report building.docx";
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.1.docx", sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.2.docx", new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.3.docx", sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.4.docx", SaveFormat.Docx, sender, "s");
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.5.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.6.docx", SaveFormat.Docx, sender, "s", new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.7.docx", SaveFormat.Docx, new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilder.BuildReport(doc, ArtifactsDir + "LowCode.BuildReportDataSource.8.docx", new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
Stream[] images = ReportBuilder.BuildReportToImages(doc, new ImageSaveOptions(SaveFormat.Png), new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
ReportBuilderContext reportBuilderContext = new ReportBuilderContext();
reportBuilderContext.ReportBuilderOptions.MissingMemberMessage = "Missed members";
reportBuilderContext.DataSources.Add(sender, "s");
ReportBuilder.Create(reportBuilderContext)
.From(doc)
.To(ArtifactsDir + "LowCode.BuildReportDataSource.9.docx")
.Execute();
}
public class MessageTestClass
{
public string Name { get; set; }
public string Message { get; set; }
public MessageTestClass(string name, string message)
{
Name = name;
Message = message;
}
}
See Also
- enum SaveFormat
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(string, string, SaveOptions, object[], string[], ReportBuilderOptions)
Populates the template document with data from multiple sources, generating a completed report with a specified output format and additional options.
public static void BuildReport(string inputFileName, string outputFileName,
SaveOptions saveOptions, object[] data, string[] dataSourceNames,
ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
saveOptions | SaveOptions | The output’s save options. |
data | Object[] | An array of data source objects. |
dataSourceNames | String[] | An array of names to reference the data source objects within the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- class SaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(Stream, Stream, SaveFormat, object[], string[], ReportBuilderOptions)
Populates the template document with data from multiple sources, generating a completed report with specified output format and additional options from the specified input and output file streams.
public static void BuildReport(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
object[] data, string[] dataSourceNames, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
outputStream | Stream | The output file stream. |
saveFormat | SaveFormat | The output’s save format. |
data | Object[] | An array of data source objects. |
dataSourceNames | String[] | An array of names to reference the data source objects within the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
Examples
Shows how to populate document with data using documents from the stream.
// There is a several ways to populate document with data using documents from the stream:
AsposeData obj = new AsposeData { List = new List<string> { "abc" } };
using (FileStream streamIn = new FileStream(MyDir + "Reporting engine template - If greedy.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, obj);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, obj, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
MessageTestClass sender = new MessageTestClass("LINQ Reporting Engine", "Hello World");
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.BuildReportDataStream.3.docx", FileMode.Create, FileAccess.ReadWrite))
ReportBuilder.BuildReport(streamIn, streamOut, SaveFormat.Docx, new object[] { sender }, new[] { "s" }, new ReportBuilderOptions() { Options = ReportBuildOptions.AllowMissingMembers });
}
See Also
- enum SaveFormat
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
BuildReport(Stream, Stream, SaveOptions, object[], string[], ReportBuilderOptions)
Populates the template document with data from multiple sources, generating a completed report with specified output format and additional options from the specified input and output file streams.
public static void BuildReport(Stream inputStream, Stream outputStream, SaveOptions saveOptions,
object[] data, string[] dataSourceNames, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
outputStream | Stream | The output file stream. |
saveOptions | SaveOptions | The output’s save options. |
data | Object[] | An array of data source objects. |
dataSourceNames | String[] | An array of names to reference the data source objects within the template. |
reportBuilderOptions | ReportBuilderOptions | Additional report build options. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
See Also
- class SaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Aspose.Words.LowCode
- assembly Aspose.Words