From 8793c1c9e50ff9cae1d2aaa90656d989588d1e56 Mon Sep 17 00:00:00 2001 From: Alexander Fediachov Date: Wed, 31 Oct 2018 12:22:47 +0300 Subject: [PATCH] update Introduction.md and Exporting.md --- Exporting.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++- Introduction.md | 10 +++++++-- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/Exporting.md b/Exporting.md index a6031e8..7fd9b39 100644 --- a/Exporting.md +++ b/Exporting.md @@ -1,14 +1,72 @@ # 7. Exporting +FastReport Open Source can save documents in HTML, BMP, PNG, JPEG, GIF, TIFF, EMF. + The following is an example of exporting a report in Jpeg file. ```csharp - // export to image +using FastReport; +using FastReport.Utils; +using FastReport.Export.Image; + ... + // Create new Report + Report report = new Report(); + // Load report from file + report.Load("report.frx"); + // Set the parameter + report.SetParameterValue("MYPARAMETER", 1024); + // Prepare the report + report.Prepare(); + // Export in Jpeg ImageExport image = new ImageExport(); image.ImageFormat = ImageExportFormat.Jpeg; + // Set up the quality + image.JpegQuality = 90; + // Decrease a resolution + image.Resolution = 72; + // We need all pages in one big single file + image.SeparateFiles = false; report.Export(image, "report.jpg"); ``` +The following is an example of exporting a report in PNG file. + +```csharp + // Export in PNG + ImageExport image = new ImageExport(); + image.ImageFormat = ImageExportFormat.Png; + // Increase a resolution + image.Resolution = 300; + // We need separate file for each report page, they will be numbered: report.png, report.2.png, report.3.png, etc. + image.SeparateFiles = true; + report.Export(image, "report.png"); +``` + +The following is an example of exporting a report in HTML file. + +```csharp +using FastReport; +using FastReport.Utils; +using FastReport.Export.Html; + ... + // Export in HTML + HTMLExport html = new HTMLExport(); + // We need embedded pictures inside html + html.EmbedPictures = true; + // Enable all report pages in one html file + html.SinglePage = true; + // We don't need a subfolder for pictures and additional files + html.SubFolder = false; + // Enable layered HTML + html.Layers = true; + // Turn off the toolbar with navigation + html.Navigator = false; + // Save the report in html + report.Export(html, "report.html"); +``` + +*To be continued ...* + --- [Creating Report Using Code](CreatingReportUsingCode.md) | [Top Page](README.md) | [Reports in Web](WebReport.md) \ No newline at end of file diff --git a/Introduction.md b/Introduction.md index cadb6bc..9ed1ed8 100644 --- a/Introduction.md +++ b/Introduction.md @@ -38,7 +38,7 @@ FastReport is written in C# and it is compatible with .NET Standard 2.0 and high - Thus you can not only use application-defined datasets but also connect to any database and use tables and queries directly within the report. -### Internal Scriping +### Internal Scripting FastReport has a built-in script engine that supports two .NET languages, C# and VB.NET. You can use all of the .NET power in your reports to perform complex data handling and much more. @@ -50,10 +50,16 @@ You can make a report template in several ways: - Developing report template as XML file. -- Using the FastReport Designer Community Edition. It can be downloaded from [Fast Reports home site](https://www.fast-report.com/). +- Using the FastReport Online Designer. + +- Using the FastReport Designer Community Edition (freeware). It can be downloaded from [Fast Report releases page](https://github.com/FastReports/FastReport/releases). [![Image of FastReport](images/FastReport-screenshot3-small.png)](images/FastReport-screenshot3.png) +## Exporting + +FastReport Open Source [can save](Exporting.md) documents in HTML, BMP, PNG, JPEG, GIF, TIFF, EMF. + --- [Top Page](README.md) | [Fundamentals](Fundamentals.md) \ No newline at end of file