ReportBuilder.BuildReportToImages
ReportBuilder BuildReportToImages method. Populates the template document with data from multiple sources. Renders the output to images.
BuildReportToImages(string, ImageSaveOptions, object[], string[], ReportBuilderOptions)
Populates the template document with data from multiple sources. Renders the output to images.
public static Stream[] BuildReportToImages(string inputFileName, ImageSaveOptions saveOptions,
object[] data, string[] dataSourceNames, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
saveOptions | ImageSaveOptions | 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. |
Examples
Class used as a data object.
public class DummyData
{
public string Name { get; set; }
public string Position { get; set; }
}
Shows how to fill a template from an object using LINQ Reporting Engine and save the result to image streams.
List<DummyData> data = new List<DummyData>();
data.Add(new DummyData() { Name = "James Bond", Position = "Spy" });
data.Add(new DummyData() { Name = "John Doe", Position = "Unknown" });
Stream[] pages = ReportBuilder.BuildReportToImages(MyDir + "ReportingTemplateForeach.docx", new ImageSaveOptions(SaveFormat.Png), new object[] { data }, new string[] { "data" });
See Also
- class ImageSaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Wordize.Reporting
- assembly Wordize
BuildReportToImages(Stream, ImageSaveOptions, object[], string[], ReportBuilderOptions)
Populates the template document with data from multiple sources. Renders the output to images.
public static Stream[] BuildReportToImages(Stream inputStream, ImageSaveOptions saveOptions,
object[] data, string[] dataSourceNames, ReportBuilderOptions reportBuilderOptions = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input file stream. |
saveOptions | ImageSaveOptions | 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. |
Examples
Class used as a data object.
public class DummyData
{
public string Name { get; set; }
public string Position { get; set; }
}
Shows how to fill a template loaded from a stream with data from an object using the LINQ Reporting Engine and save the result as image streams.
List<DummyData> data = new List<DummyData>();
data.Add(new DummyData() { Name = "James Bond", Position = "Spy" });
data.Add(new DummyData() { Name = "John Doe", Position = "Unknown" });
using (Stream input = File.OpenRead(MyDir + "ReportingTemplateForeach.docx"))
{
Stream[] pages = ReportBuilder.BuildReportToImages(input, new ImageSaveOptions(SaveFormat.Png), new object[] { data }, new string[] { "data" });
}
See Also
- class ImageSaveOptions
- class ReportBuilderOptions
- class ReportBuilder
- namespace Wordize.Reporting
- assembly Wordize