--------------------------------------------------------------------------------
/CompilationInstallation.md:
--------------------------------------------------------------------------------
1 | ## Compiling the source code
2 |
3 | 1. Install latest .Net Core SDK for your OS from https://www.microsoft.com/net/download
4 | 2. Follow the commands
5 |
6 | ```sh
7 | # for windows users
8 | git clone https://github.com/FastReports/FastReport.git
9 | cd FastReport
10 | Tools\pack.bat
11 | ```
12 |
13 | ```sh
14 | # for linux users
15 | git clone https://github.com/FastReports/FastReport.git
16 | cd FastReport
17 | chmod 777 Tools/pack.sh && ./Tools/pack.sh
18 | ```
19 |
20 | The package is located at `fr_nuget` directory.
21 |
22 | ## Installing from NuGet
23 |
24 | You can add FastReport to your current project via NuGet package manager:
25 | ```
26 | Install-Package FastReport.OpenSource
27 | Install-Package FastReport.OpenSource.Web
28 | ```
29 |
30 | ## Compiling solution in Visual Studio
31 |
32 | Open the FastReport.OpenSource.sln file in Visual Studio and choice the Build -> Build Solution.
33 | Then you can set as StartUp any project from Demos folder and run it.
34 |
--------------------------------------------------------------------------------
/ConfiguringEnvironment.md:
--------------------------------------------------------------------------------
1 | # 7.3. Configuring the Environment
2 |
3 | Using the static object FastReport.Utils.Config you can control some FastReport environment settings.
4 |
5 | The FastReport.Utils.Config.ReportSettings property contains some report-related settings:
6 |
7 | | Property | Description |
8 | |:-|:-|
9 | | Language DefaultLanguage | The default script language for new reports. |
10 |
11 | ---
12 |
13 | [Running a Report](RunningReport.md) | [Top Page](README.md) | [Passing Own Connection String](PassingOwnConnectionString.md)
--------------------------------------------------------------------------------
/CreatingReportUsingCode.md:
--------------------------------------------------------------------------------
1 | # Creating a report by using code
2 |
3 | Let us consider how to create a report in code.
4 |
5 | ```csharp
6 | Report report = new Report();
7 | // register the "Products" table
8 | report.RegisterData(dataSet1.Tables["Products"], "Products");
9 | // enable it to use in a report
10 | report.GetDataSource("Products").Enabled = true;
11 | // create A4 page with all margins set to 1cm
12 | ReportPage page1 = new ReportPage();
13 | page1.Name = "Page1";
14 | report.Pages.Add(page1);
15 | // create ReportTitle band
16 | page1.ReportTitle = new ReportTitleBand();
17 | page1.ReportTitle.Name = "ReportTitle1";
18 | // set its height to 1.5cm
19 | page1.ReportTitle.Height = Units.Centimeters * 1.5f;
20 | // create group header
21 | GroupHeaderBand group1 = new GroupHeaderBand();
22 | group1.Name = "GroupHeader1";
23 | group1.Height = Units.Centimeters * 1;
24 | // set group condition
25 | group1.Condition = "[Products.ProductName].Substring(0, 1)";
26 | // add group to the page.Bands collection
27 | page1.Bands.Add(group1);
28 | // create group footer
29 | group1.GroupFooter = new GroupFooterBand();
30 | group1.GroupFooter.Name = "GroupFooter1";
31 | group1.GroupFooter.Height = Units.Centimeters * 1;
32 | // create DataBand
33 | DataBand data1 = new DataBand();
34 | data1.Name = "Data1";
35 | data1.Height = Units.Centimeters * 0.5f;
36 | // set data source
37 | data1.DataSource = report.GetDataSource("Products");
38 | // connect databand to a group
39 | group1.Data = data1;
40 | // create "Text" objects
41 | // report title
42 | TextObject text1 = new TextObject();
43 | text1.Name = "Text1";
44 | // set bounds
45 | text1.Bounds = new RectangleF(0, 0,
46 | Units.Centimeters * 19, Units.Centimeters * 1);
47 | // set text
48 | text1.Text = "PRODUCTS";
49 | // set appearance
50 | text1.HorzAlign = HorzAlign.Center;
51 | text1.Font = new Font("Tahoma", 14, FontStyle.Bold);
52 | // add it to ReportTitle
53 | page1.ReportTitle.Objects.Add(text1);
54 | // group
55 | TextObject text2 = new TextObject();
56 | text2.Name = "Text2";
57 | text2.Bounds = new RectangleF(0, 0,
58 | Units.Centimeters * 2, Units.Centimeters * 1);
59 | text2.Text = "[[Products.ProductName].Substring(0, 1)]";
60 | text2.Font = new Font("Tahoma", 10, FontStyle.Bold);
61 | // add it to GroupHeader
62 | group1.Objects.Add(text2);
63 | // data band
64 | TextObject text3 = new TextObject();
65 | text3.Name = "Text3";
66 | text3.Bounds = new RectangleF(0, 0,
67 | Units.Centimeters * 10, Units.Centimeters * 0.5f);
68 | text3.Text = "[Products.ProductName]";
69 | text3.Font = new Font("Tahoma", 8);
70 | // add it to DataBand
71 | data1.Objects.Add(text3);
72 | // group footer
73 | TextObject text4 = new TextObject();
74 | text4.Name = "Text4";
75 | text4.Bounds = new RectangleF(0, 0,
76 | Units.Centimeters * 10, Units.Centimeters * 0.5f);
77 | text4.Text = "Count: [CountOfProducts]";
78 | text4.Font = new Font("Tahoma", 8, FontStyle.Bold);
79 | // add it to GroupFooter
80 | group1.GroupFooter.Objects.Add(text4);
81 | // add a total
82 | Total groupTotal = new Total();
83 | groupTotal.Name = "CountOfProducts";
84 | groupTotal.TotalType = TotalType.Count;
85 | groupTotal.Evaluator = data1;
86 | groupTotal.PrintOn = group1.Footer;
87 | // add it to report totals
88 | report.Dictionary.Totals.Add(groupTotal);
89 | // run the report
90 | report.Prepare();
91 | ...
92 | ```
93 | The prepared report looks as follows:
94 |
95 | 
96 |
97 | ---
98 |
99 | [Report Template File Structure](ReportTemplateFileStructure.md) | [Top Page](README.md) | [Using the Report](UsingReport.md)
--------------------------------------------------------------------------------
/Data.md:
--------------------------------------------------------------------------------
1 | # 3. Data
2 | Any report prints some data. In FastReport, you can operate with the following data:
3 |
4 | - data sources;
5 | - system variables;
6 | - total values;
7 | - report parameters;
8 | - expressions, containing any of the above mentioned data.
9 |
10 | ## Data sources
11 |
12 | Ordinarily, the data source represents a DB table or SQL query. There can be several data sources in a report. For most of reports, only one data source is needed. A report like Master-Detail needs two data sources which are connected to each other using a relation.
13 |
14 | Data source has one or several data columns. Each column has a definite data type. Column type is indicated in the "DataType" property.
15 |
16 | DB table content is not saved in a report file. Instead, the connection string and the data source schema are stored. A connection string can contain such data as login and password, that is why it is kept ciphered in a report file. When needed, you may increase the safety by using own key for data ciphering. In this case a report file can be opened correctly only in your program.
17 |
18 | ## Aliases
19 |
20 | Every data element (data sources and columns) has got its own name. By default, this is the name defined in the database. In some cases, it can be difficult to understand what is hidden behind such name, for example, ProdID.
21 |
22 | Data elements have got a second name - alias. By using an alias, you can rename an element. For example, if we have got a data source CATEGORY_TABLE with a column called "PROD_ID", you can give the following alias:
23 |
24 | ```
25 | CATEGORY_TABLE --> Categories
26 | PROD_ID --> Product ID
27 | ```
28 |
29 | You can refer to such a data column in the following way:
30 |
31 | ```
32 | [Categories.Product ID]
33 | ```
34 |
35 | When referring to the data element, you must use the alias, if it has been defined. Never refer to an element by using its original name in this case.
36 |
37 | ## Hierarchical data sources
38 |
39 | The data sources we have looked at, are relational, that is, they come from a relational DBMS (often called RDBMS). FastReport also supports other kinds of data - the hierarchical data sources. Such data sources come from so-called business objects, which are often used in applications to represent a relational data sources as a .Net classes.
40 |
41 | The only way to add a hierarchical data source in your report is to register it programmatically. It will be discussed in the "Programmer's manual". Now we will look at some differences between ordinal and hierarchical data sources. In the figure below you can see two data sources, "Categories BusinessObject" and "Products". As you can see, the "Products" data source is contained within its parent, "Categories BusinessObject":
42 |
43 | 
44 |
45 | This means that, these two data sources are related to each other and can be used in the "master-detail" report type. You can also use each of these data sources separately in a "simple list" report type.
46 |
47 | ---
48 |
49 | [Report Objects](ReportObjects.md) | [Top Page](README.md) | [Registering Data](RegisteringData.md)
--------------------------------------------------------------------------------
/Examples.md:
--------------------------------------------------------------------------------
1 | # Examples
2 |
3 | [FastReport Open Source Articles and How-Tos](https://fropensource.blogspot.com/)
4 |
5 | [FastReport Open Source Demos](https://github.com/FastReports/FastReport/tree/master/Demos/OpenSource)
6 |
7 |
--------------------------------------------------------------------------------
/Exporting.md:
--------------------------------------------------------------------------------
1 | # 8. Exporting
2 |
3 | FastReport Open Source can save documents in HTML, BMP, PNG, JPEG, GIF, TIFF, EMF.
4 |
5 | The following is an example of exporting a report in Jpeg file.
6 |
7 | ```csharp
8 | using FastReport;
9 | using FastReport.Utils;
10 | using FastReport.Export.Image;
11 | ...
12 | // Create new Report
13 | Report report = new Report();
14 | // Load report from file
15 | report.Load("report.frx");
16 | // Set the parameter
17 | report.SetParameterValue("MYPARAMETER", 1024);
18 | // Prepare the report
19 | report.Prepare();
20 | // Export in Jpeg
21 | ImageExport image = new ImageExport();
22 | image.ImageFormat = ImageExportFormat.Jpeg;
23 | // Set up the quality
24 | image.JpegQuality = 90;
25 | // Decrease a resolution
26 | image.Resolution = 72;
27 | // We need all pages in one big single file
28 | image.SeparateFiles = false;
29 | report.Export(image, "report.jpg");
30 | ```
31 |
32 | The following is an example of exporting a report in PNG file.
33 |
34 | ```csharp
35 | // Export in PNG
36 | ImageExport image = new ImageExport();
37 | image.ImageFormat = ImageExportFormat.Png;
38 | // Increase a resolution
39 | image.Resolution = 300;
40 | // We need separate file for each report page, they will be numbered: report.png, report.2.png, report.3.png, etc.
41 | image.SeparateFiles = true;
42 | report.Export(image, "report.png");
43 | ```
44 |
45 | The following is an example of exporting a report in HTML file.
46 |
47 | ```csharp
48 | using FastReport;
49 | using FastReport.Utils;
50 | using FastReport.Export.Html;
51 | ...
52 | // Export in HTML
53 | HTMLExport html = new HTMLExport();
54 | // We need embedded pictures inside html
55 | html.EmbedPictures = true;
56 | // Enable all report pages in one html file
57 | html.SinglePage = true;
58 | // We don't need a subfolder for pictures and additional files
59 | html.SubFolder = false;
60 | // Enable layered HTML
61 | html.Layers = true;
62 | // Turn off the toolbar with navigation
63 | html.Navigator = false;
64 | // Save the report in html
65 | report.Export(html, "report.html");
66 | ```
67 |
68 | The following is an example of exporting a report in multiple streams.
69 |
70 | ```csharp
71 | // Creatint the Report object
72 | using (Report report = new Report())
73 | {
74 | // Loading a report
75 | report.Load("report.frx");
76 | // Preparing a report
77 | report.Prepare();
78 |
79 | // Creating the HTML export
80 | using (HTMLExport html = new HTMLExport())
81 | {
82 | // Choose the Jpeg pictures
83 | html.ImageFormat = ImageFormat.Jpeg;
84 | // We need the saving in multiple streams
85 | html.SaveStreams = true;
86 | // Exporting with fake null stream object, html export will keep all files inside
87 | report.Export(html, (Stream)null);
88 | // Checking for the exporting
89 | if (html.GeneratedFiles.Count > 0)
90 | {
91 | // Loop for generated files
92 | for (int i = 0; i < html.GeneratedFiles.Count; i++)
93 | {
94 | // We have several streams, let's save it in files
95 | using (FileStream file = new FileStream("export_path/" + html.GeneratedFiles[i], FileMode.Create))
96 | {
97 | // You need reset the internal stream position
98 | html.GeneratedStreams[i].Position = 0;
99 | // Saving a stream in the file
100 | html.GeneratedStreams[i].CopyTo(file);
101 | }
102 | }
103 | }
104 | }
105 | }
106 |
107 | ```
108 | The result of the code above:
109 | ```
110 | 1.html
111 | 3D8711F2B3E0CB27B4ABB3B008100944.jpeg
112 | 8ADC69235827736FEFD905D29F1BA3C3.jpeg
113 | A4310A5FEB8A9D6D4FFDC4F3747940F4.jpeg
114 | D040CA1257EC42CE08EA369E5101E2D1.jpeg
115 | E9376AC431359E9A088B9F104665ABE9.jpeg
116 | EA63D4A0288B3841CD552CA0DC3845DB.jpeg
117 | EC5F2B95E3DA517ED1244012D77901BC.jpeg
118 | ```
119 |
120 | ---
121 |
122 | [Reference to a Report Object](ReferenceReportObject.md) | [Top Page](README.md) | [Reports in Web](WebReport.md)
--------------------------------------------------------------------------------
/FastReportDesignerCommunityEdition.md:
--------------------------------------------------------------------------------
1 | # FastReport Designer Community Edition
2 |
3 | The easiest way to create a report template is to use the FastReport Designer Community Edition utility.
4 |
5 | 
6 |
7 | The FastReport Designer Community Edition is [Freeware](https://en.wikipedia.org/wiki/Freeware). The file FastReport.Community.zip can be downloaded from [this link](https://github.com/FastReports/FastReport/releases/latest).
8 |
9 | ---
10 |
11 | [Report Creation](ReportCreation.md) | [Top Page](README.md) | [FastReport Online Designer](FastReportOnlineDesigner.md)
--------------------------------------------------------------------------------
/FastReportOnlineDesigner.md:
--------------------------------------------------------------------------------
1 | # FastReport Online Designer
2 |
3 | [FastReport Online Designer](https://www.fast-report.com/en/product/fast-report-online-designer/) is a visual report designer for Web.
4 |
5 | 
6 |
7 | ## Cross-platform
8 |
9 | [FastReport Online Designer](https://www.fast-report.com/en/product/fast-report-online-designer/) allows creating, editing and viewing reports on devices with Android, iOS or Windows platform. Designer can be run on any device with a modern browser whether it's a computer, tablet, smartphone, game console or a TV set.
10 |
11 |
12 | ## FastReport Online Designer demo
13 |
14 | [FastReport Online Designer in action](https://www.fast-report.com:2015/razor/Home/Designer)
15 |
16 |
17 | ## Using FastReport Online Designer
18 |
19 | FastReport Online Designer can work only together [WebReport](WebReport.md).
20 |
21 | ---
22 |
23 | [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md) | [Top Page](README.md) | [Report Template File Structure](ReportTemplateFileStructure.md)
24 |
--------------------------------------------------------------------------------
/Fundamentals.md:
--------------------------------------------------------------------------------
1 | # 2. Fundamentals
2 |
3 | In this chapter we will learn the principles of working with a report in the FastReport.
4 |
5 | We will also take a close look at report elements such as report pages, bands, and report objects.
6 |
7 | 
8 |
9 | ---
10 |
11 | [Introduction](Introduction.md) | [Top Page](README.md) | [The Report](Report.md)
12 |
--------------------------------------------------------------------------------
/Introduction.md:
--------------------------------------------------------------------------------
1 | # 1. Introduction
2 |
3 | ## What is FastReport?
4 |
5 | FastReport provides open source report generator for .NET Core 2.x/.Net Framework 4.x. You can use the FastReport in MVC, Web API applications.
6 |
7 | [](images/FastReport-screenshot2.png)
8 |
9 | ## Features
10 |
11 | FastReport is written in C# and it is compatible with .NET Standard 2.0 and higher. Extendable FastReport architecture allows creating your own objects, export filters, wizards and DB engines.
12 |
13 | [](images/FastReport-screenshot1.png)
14 |
15 | ### Report Objects
16 |
17 | - FastReport is a band-oriented report generator. There are 13 types of bands available: Report Title, Report Summary, Page Header, Page Footer, Column Header, Column Footer, Data Header, Data, Data Footer, Group Header, Group Footer, Child and Overlay. In addition, sub-reports are fully supported.
18 |
19 | - A wide range of band types allows creating any kind of report: list, master-detail, group, multi-column, master-detail-detail and many more.
20 |
21 | - Wide range of available report objects : text, picture, line, shape, barcode, matrix, table, checkbox.
22 |
23 | - Reports can consist of several design pages, which allows reports to contain a cover, the data and a back cover, all in one file.
24 |
25 | - The Table object allows building a tabular report with variable number of rows and/or columns, just like in MS Excel. Aggregate functions are also available.
26 |
27 | - Powerful, fully configurable Matrix object that can be used to print pivot tables.
28 |
29 | - Report inheritance. For creating many reports with common elements such as titles, logos or footers you can place all the common elements in a base report and inherit all other reports from this base.
30 |
31 | ### Data Sources
32 |
33 | - You can get data from XML, CSV, Json, MS SQL, MySql, Oracle, Postgres, MongoDB, Couchbase, RavenDB, SQLite.
34 |
35 | - FastReport has ability to get data from business objects of IEnumerable type.
36 |
37 | - Report can contain data sources (tables, queries, DB connections).
38 |
39 | - Thus you can not only use application-defined datasets but also connect to any database and use tables and queries directly within the report.
40 |
41 | ### Internal Scripting
42 |
43 | 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.
44 |
45 | ## Working with report templates
46 |
47 | You can make a report template in several ways:
48 |
49 | - Creating report from code.
50 |
51 | - Developing report template as XML file.
52 |
53 | - Using the FastReport Online Designer.
54 |
55 | - Using the FastReport Designer Community Edition (freeware). It can be downloaded from [Fast Report releases page](https://github.com/FastReports/FastReport/releases).
56 |
57 | [](images/FastReport-screenshot3.png)
58 |
59 | ## Exporting
60 |
61 | FastReport Open Source [can save](Exporting.md) documents in HTML, BMP, PNG, JPEG, GIF, TIFF, EMF.
62 |
63 | ---
64 |
65 | [Top Page](README.md) | [Fundamentals](Fundamentals.md)
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2018 Fast Reports Inc
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/PassingCustomSQL.md:
--------------------------------------------------------------------------------
1 | # 7.5. Passing Custom SQL
2 |
3 | The report may contain data sources that are added using the Data Wizard in Designer (via "Data\|Add Data Source..." menu).
4 |
5 | Sometimes it is needed to pass custom SQL to that data source from your application. To do this, use the following code:
6 |
7 | ```csharp
8 | using FastReport.Data;
9 | ...
10 | report1.Load(...);
11 | // do it after loading the report, before running it
12 | // find the table by its alias
13 | TableDataSource table = report1.GetDataSource("MyTable") as TableDataSource;
14 | table.SelectCommand = "new SQL text";
15 | report1.Show();
16 | ```
17 |
18 | ---
19 |
20 | [Passing Own Connection String](PassingOwnConnectionString.md) | [Top Page](README.md) | [Reference to a Report Object](ReferenceReportObject.md)
21 |
--------------------------------------------------------------------------------
/PassingOwnConnectionString.md:
--------------------------------------------------------------------------------
1 | # 7.4. Passing Own Connection String
2 |
3 | If you use data sources that are defined inside a report, you may need to pass an application-defined connection string to a report.
4 | This can be done in three ways.
5 |
6 | **The first method:** you pass a connection string directly to the Connection object in a report. Do the following:
7 |
8 | ```csharp
9 | report1.Load(...);
10 | // do it after loading the report, before running it
11 | // assume we have one connection in the report
12 | report1.Dictionary.Connections[0].ConnectionString = my_connection_string;
13 | report1.Show();
14 | ```
15 |
16 | **The second method:** you pass a connection string using the report parameter. Do the following:
17 |
18 | - run the report designer;
19 | - in the "Data" window, create a new report parameter (with "MyParameter" name, for example);
20 | - in the "Data" window, select the "Connection" object that contains a data source;
21 | - switch to the "Properties" window and set the ConnectionStringExpression property to the following:
22 | ```
23 | [MyParameter]
24 | ```
25 | - pass the connection string to the MyParameter parameter:
26 | ```csharp
27 | report1.SetParameterValue("MyParameter", my_connection_string);
28 | ```
29 |
30 | ---
31 |
32 | [Configuring the Environment](ConfiguringEnvironment.md) | [Top Page](README.md) | [Passing Custom SQL](PassingCustomSQL.md)
--------------------------------------------------------------------------------
/QueryParameters.md:
--------------------------------------------------------------------------------
1 | # 3.3. Query parameters
2 |
3 | There can be parameters in a query text. Let us see the following query:
4 |
5 | ```sql
6 | select * from DVDs
7 | where Title = @param1
8 | ```
9 |
10 | This is the query to MS SQL demonstration database. The parameter with "param1" name is defined in a query. Here it should be noted: method of describing parameters in a query differs for different DBMS. For MS SQL a parameter is marked by a "@" symbol, MS Access parameters do not have names and are marked by the "?" symbol.
11 |
12 | If your SQL query contains parameters, you have to declare them. It can be done in the third step of the "Query Wizard" which we have looked at above. To create a parameter, press the "Add parameter" button.
13 |
14 | The following parameter's properties should be set in the properties window:
15 |
16 | | Property | Description |
17 | |:-|:-|
18 | | Name | Parameter name. Here you need to indicate the same name which you use in the query text. Some DBMS (for example, MS Access) do not support named parameters. In this case do not change this property. |
19 | | DataType | Parameter data type. |
20 | | DefaultValue | Value which will be used if the "Expression" property is not specified, or if it is impossible to calculate it (for example, when operating with the query in the report design mode). |
21 | | Expression | Expression which returns parameter's value. This expression will be processed when you run the report. You can indicate any expression in this property (see details in the "Expressions" chapter). |
22 | | Size | Parameter data size. This property should be indicated if the parameter is of "string" data type. |
23 |
24 | ## Passing a value to the parameter
25 |
26 | Parameters are often used to ask a value from the user. Let us look at two ways to pass a value to the query parameter.
27 |
28 | In the first way, you pass a value programmatically. Since there is no easy way to pass a value directly to the query parameter, you need to use the report parameter, which can be easily set via code. You should do the following:
29 |
30 | - Create the report parameter. Set the same DataType for the report parameter, as it is used in the query parameter.
31 |
32 | - In the "Expression" property of the query parameter, refer to a report parameter, for example:
33 |
34 | ```
35 | [MyReportParameter]
36 | ```
37 |
38 | - Pass a value to the report parameter:
39 |
40 | ```csharp
41 | report1.SetParameterValue("MyReportParameter", 10);
42 | ```
43 |
44 | ---
45 |
46 | [Report Parameters](ReportParameters.md) | [Top Page](README.md) | [System Variables](SystemVariables.md)
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://twitter.com/FastReports) [](https://t.me/fastreport_open_source) [](https://t.me/joinchat/hs87tfi79Rg3OGQy)
2 |
3 | # FastReport Open Source Documentation
4 |
5 | ## What is FastReport?
6 |
7 | [FastReport](https://github.com/FastReports/FastReport) provides open source report generator for .NET6/.NET Core/.NET Framework 4.x. You can use the FastReport in MVC, Web API applications. FastReport Open Source is based on the FastReport.Net project.
8 |
9 | ## About Repository
10 |
11 | Here is the FastReport Open Source Documentation.
12 |
13 | We wish to draw up your attention to the fact that Documentation is under construction.
14 |
15 | ## Table of Contents
16 |
17 | ### 1. [Introduction](Introduction.md)
18 |
19 | ### 2. [Fundamentals](Fundamentals.md)
20 | #### 2.1. [The Report](Report.md)
21 | #### 2.2. [Report Pages](ReportPages.md)
22 | #### 2.3. [Bands](Bands.md)
23 | #### 2.4. [Report Objects](ReportObjects.md)
24 |
25 | ### 3. [Data](Data.md)
26 | #### 3.1. [Registering Data](RegisteringData.md)
27 | #### 3.2. [Report Parameters](ReportParameters.md)
28 | #### 3.3. [Query Parameters](QueryParameters.md)
29 | #### 3.4. [System Variables](SystemVariables.md)
30 | #### 3.5. [Totals](Totals.md)
31 |
32 | ### 4. [Expressions](Expressions.md)
33 |
34 | ### 5. [Script](Script.md)
35 |
36 | ### 6. [Report Creation](ReportCreation.md)
37 | #### 6.1. [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
38 | #### 6.2. [FastReport Online Designer](FastReportOnlineDesigner.md)
39 | #### 6.3. [Report Template File Structure](ReportTemplateFileStructure.md)
40 | #### 6.5. [Creating a Report by Using Code](CreatingReportUsingCode.md)
41 |
42 | ### 7. [Using the Report](UsingReport.md)
43 | #### 7.1. [Storing and Loading a Report](StoringLoadingReport.md)
44 | #### 7.2. [Running a Report](RunningReport.md)
45 | #### 7.3. [Configuring the Environment](ConfiguringEnvironment.md)
46 | #### 7.4. [Passing Own Connection String](PassingOwnConnectionString.md)
47 | #### 7.5. [Passing Custom SQL](PassingCustomSQL.md)
48 | #### 7.6. [Reference to a Report Object](ReferenceReportObject.md)
49 |
50 | ### 8. [Exporting](Exporting.md)
51 |
52 | ### 9. [WebReport](WebReport.md)
53 |
54 | ### [APPENDIX I: Compilation and Installation](CompilationInstallation.md)
55 | ### [APPENDIX II: Examples](Examples.md)
56 | ### [APPENDIX III: Class Reference](https://fastreports.github.io/FastReport.Documentation/ClassReference/api/FastReport.html)
57 | ### [APPENDIX IV: The Feature Comparison Table for FastReport Open Source, FastReport Core, FastReport .Net](COMPARISON.md)
58 |
59 | ### [LICENSE](LICENSE.md)
60 |
61 | ## Links
62 |
63 | [FastReport Open Source Home](https://github.com/FastReports/FastReport "Click for visiting the FastReport Open Source GitHub")
64 |
65 | [FastReport .Net User's Manual](https://www.fast-report.com/public_download/docs/FRNet/online/en/index.html)
66 |
--------------------------------------------------------------------------------
/ReferenceReportObject.md:
--------------------------------------------------------------------------------
1 | # 7.6. Reference to a Report Object
2 |
3 | When you work with a report as a class (see the ["Storing a report and loading it"](StoringLoadingReport.md)),
4 | you may refer to the report objects directly.
5 | The following example demonstrates how to change the font of the "Text1" object contained in a report:
6 |
7 | ```csharp
8 | SimpleListReport report = new SimpleListReport();
9 | report.Text1.Font = new Font("Arial", 12);
10 | ```
11 | In other cases, you have to use the FindObject method of the Report object, if you need to get a reference to an object:
12 |
13 | ```csharp
14 | TextObject text1 = report1.FindObject("Text1") as TextObject;
15 | text1.Font = new Font("Arial", 12);
16 | ```
17 |
18 | To reference to a data source defined in a report, use the GetDataSource method of the Report object.
19 | This method takes a data source's alias as a parameter:
20 |
21 | ```csharp
22 | DataSourceBase ds = report1.GetDataSource("Products");
23 | ```
24 |
25 | ---
26 |
27 | [Passing Custom SQL](PassingCustomSQL.md) | [Top Page](README.md) | [Exporting](Exporting.md)
--------------------------------------------------------------------------------
/RegisteringData.md:
--------------------------------------------------------------------------------
1 | # 3.1. Registering Data
2 |
3 | If your report uses data from an application (for example, the typed dataset or a business-object),
4 | you have to register such data in a report. This can be done using the RegisterData method of the Report object.
5 |
6 | The RegisterData method must be called after you have loaded the report:
7 |
8 | ```csharp
9 | report1 = new Report();
10 | report1.Load("report.frx");
11 | report1.RegisterData(dataSet1, "NorthWind");
12 | ```
13 |
14 | The RegisterData method is overloaded and allows to register the following data:
15 |
16 | | Method | Description |
17 | |:-|:-|
18 | | `void RegisterData(DataSet data)` | Registers the dataset. This method registers all tables, views and relations as well. Attention: if you register more than one dataset, use the RegisterData(DataSet data, string name) method instead. |
19 | | `void RegisterData(DataSet data, string name)` | Registers the dataset. Specify any name in the name parameter (it must be persistent and unique if you register more than one dataset). |
20 | | `void RegisterData(DataTable data, string name)` | Registers the data table. |
21 | | `void RegisterData(DataView data, string name)` | Registers the data view. |
22 | | `void RegisterDataAsp(IDataSource data, string name)` | Registers the ASP.NET data source such as AccessDataSource. |
23 | | `void RegisterData(DataRelation data, string name)` | Registers the relation. |
24 | | `void RegisterData(IEnumerable data, string name, BOConverterFlags flags, int maxNestingLevel)` | Registers the business object. Specify what items (properties, fields) should be used, in the flags parameter. Specify the maximum nesting level in the maxNestingLevel parameter (typically you need no more than 3 levels). Several nested objects may slow down the report. |
25 |
26 | ---
27 |
28 | [Data](Data.md) | [Top Page](README.md) | [Report Parameters](ReportParameters.md)
--------------------------------------------------------------------------------
/Report.md:
--------------------------------------------------------------------------------
1 | # 2.1. The Report
2 |
3 | The report building process can be represented as follows:
4 |
5 | 
6 |
7 | Report template (later-Report) - this is, what we see in the Designer. Reports are saved in files with an extension .FRX. A Report can be created with the help of Designer or programmatically.
8 |
9 | Data can be any: this is data, defined in the program, or data from DBMS, for example, MS SQL. FastReport can also work with business-logic objects (later - business-objects).
10 |
11 | Prepared Report - this is what we see in the preview window (for Desktop application) or in web browser. Prepared report can be previewed, printed, saved in one of the supported formats (.png, jpg, .docx, .xlsx, .pdf and others).
12 |
13 | ---
14 |
15 | [Fundamentals](Fundamentals.md) | [Top Page](README.md) | [Report Pages](ReportPages.md)
--------------------------------------------------------------------------------
/ReportCreation.md:
--------------------------------------------------------------------------------
1 | # 6. Report Creation
2 |
3 | ### 6.1. [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
4 | ### 6.2. [FastReport Online Designer](FastReportOnlineDesigner.md)
5 | ### 6.3. [Report Template File Structure](ReportTemplateFileStructure.md)
6 | ### 6.4. [Creating a Report by Using Code](CreatingReportUsingCode.md)
7 |
8 | ---
9 |
10 | [Script](Script.md) | [Top Page](README.md) | [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
11 |
--------------------------------------------------------------------------------
/ReportObjects.md:
--------------------------------------------------------------------------------
1 | # 2.4. Report Objects
2 |
3 | A wide variety of objects can be used in a report.
4 |
5 | | Name | Description |
6 | |:-|:-|
7 | | `TextObject` | Displays one or several text lines. |
8 | | `PictureObject` | Displays a picture. |
9 | | `LineObject` | Displays a line. A line can be vertical, horizontal or diagonal. |
10 | | `ShapeObject` | Displays one of the geometrical shapes - rectangle, ellipse, triangle and others. |
11 | | `BarcodeObject` | Displays a barcode. |
12 | | `CheckBoxObject` | Displays a checkbox which can have two states - "Enabled" or "Disabled". |
13 | | `TableObject` | Displays a table containing rows, columns and cells. |
14 | | `MatrixObject` | Displays a matrix (also known as "Cross-tab"). |
15 | | `ZipCodeObject` | Displays a zip code. |
16 | | `CellularTextObject` | Displays each character of a text in its individual cell. |
17 | | `PolyLineObject` | Displays a composite line. |
18 | | `PolygonObject` | Displays a polygon shape. |
19 | | `LinearGauge` | Displays a linear gauge. |
20 | | `SimpleGauge` | Displays a simple gauge. |
21 | | `RadialGauge` | Displays a radial gauge. |
22 | | `SimpleProgressGauge` | Displays a simple progress gauge. |
23 |
24 | An object can be used to display an information ("Text", etc objects) or to improve the report appearance ("Picture", "Line", "Shape" objects). Complex objects like "Table" and "Matrix" can contain other simple objects.
25 |
26 | ## Common object properties
27 |
28 | All report objects are inherited from one basic class (ReportComponentBase) and have got certain set of common properties. Before studying each object, we will look at these properties.
29 |
30 | You can change the value of properties with the help of the "Properties" window. Some properties can be changed using the object's context menu or toolbars (for example, border and fill).
31 |
32 | | Property | Description |
33 | |:-|:-|
34 | | `Left`, `Top`, `Width`, `Height` | A report object, as a rule, is a rectangle. It has coordinates (properties `Left`, `Top`) and size (properties `Width`, `Height`). |
35 | | `Anchor` | This property determines how the object will be changing its position and/or its size when the container on which it is laying grows or shrinks. By using Anchor, it can be done in such a way that, the object expands or moves synchronously with container. Read more about this property in the "Dynamic layout" chapter. |
36 | | `Dock` | This property determines on which side of the container the object will be docked. Read more about this property in the "Dynamic layout" chapter. |
37 | | `Border`, `Fill` | These properties control the object's border and fill. They can be changed using the "Border and Fill" toolbar. |
38 | | `CanGrow`, `CanShrink` | These properties allow fitting the height of the object in such a way that it fits the whole text. Read more about this property in the "Dynamic layout" chapter. |
39 | | `ShiftMode` | An object, whose property is enabled, will be moving up and down, if the object above on can either grow or shrink. Read more about this property in the "Dynamic layout" chapter. |
40 | | `GrowToBottom` | An object, whose property is enabled, will be stretched to the bottom of a band. Read more about this property in the "Dynamic layout" chapter. |
41 | | `CanBreak` | Objects "Text" and "Rich Text" have this property. It determines whether the object’s contents can be broken into parts. |
42 | | `PrintOn` | This property determines on which pages the object can be printed. Read more about this property in the "Booklet-type report" chapter. |
43 | | `Cursor` | This property determines the type of mouse cursor when it is located over an object. The property works only in the preview window. |
44 | | `Visible` | This property determines whether the object will be displayed in the report. Invisible object is never displayed in the preview window and is never printed on the printer as well. |
45 | | `Printable` | This property determines whether the object will be printed on the printer. If this property is disabled, then the object will be visible in the preview window but it will not be printed. |
46 | | `Hyperlink` | This property makes it possible to make the report object interactive. Read more about this property in the "Interactive reports" chapter. |
47 | | `Bookmark` | This property is used together with the `Hyperlink` property. It can contain any expression. The expression will be calculated when the report will be working, and its value will be used as bookmark's name.
48 | | `Restrictions` | This property restricts certain operations, such as moving, resizing, deleting the object. |
49 | | `Style` | You can assign the style name to this property. When this is done, the object will become like it has been indicated in the style. If the parameters of the style changes, the appearance of the object changes as well. |
50 |
51 | ---
52 |
53 | [Report Pages](ReportPages.md) | [Top Page](README.md) | [Data](Data.md)
--------------------------------------------------------------------------------
/ReportPages.md:
--------------------------------------------------------------------------------
1 | # 2.2. Report Pages
2 |
3 | Template consists of one (mostly) or several report pages. Report page, in turn, contains bands. Report objects like Text, Picture and others are placed on the band:
4 |
5 | 
6 |
7 | Report template can consist of several pages. For example, you can create a template containing title-page and a page with data. When creating such a report, the first page will be printed first, then the second page and so on. Every page of template can generate one or several pages of a prepared report – this depends on the data it contains:
8 |
9 | 
10 |
11 | Report pages are also used when working with subreports. Contrary to other report generators, subreports in FastReport are saved in a separate template page, and not in a separate file.
12 |
13 | ---
14 |
15 | [The Report](Report.md) | [Top Page](README.md) | [Band](Bands.md)
--------------------------------------------------------------------------------
/ReportParameters.md:
--------------------------------------------------------------------------------
1 | # 3.2. Report Parameters
2 |
3 | You can define parameters in a report. Parameter is a variable, the value of which can be defined both in a report itself and outside of it. A parameter can be used in expressions and be displayed in report objects like the "Text" object.
4 |
5 | Most common methods of using parameters:
6 |
7 | - data filtering by condition set in a parameter;
8 | - printing parameter value in a report.
9 |
10 | A parameter has the following properties:
11 |
12 | | Property | Description |
13 | |:-|:-|
14 | | Name | Parameter's name can have any symbols except dot ".". |
15 | | DataType | Parameter data type. |
16 | | Expression | Expression which returns parameter's value. More details about expressions can be found in the "Expression" chapter. This expression will be processed when calling a parameter. |
17 | | Value | Parameter value. This property is not available in the designer and can be filled programmatically. |
18 |
19 | You have to set up "Name" and "DataType" properties. The "Expression" property can be left empty. In this case parameter's value should be passed programmatically.
20 |
21 | You can refer to a parameter from an expression using square brackets:
22 |
23 | ```
24 | [Parameter name]
25 | ```
26 |
27 | To a nested parameter you need to refer using this method:
28 |
29 | ```
30 | [Parent parameter.Child parameter]
31 | ```
32 |
33 | Since a parameter has got a definite type (it is given in the DataType property), then with parameters, you can perform those actions which are allowed for data type. So, string type parameters can be used in an expression the following way:
34 |
35 | ```
36 | [StringParameter].Substring(0, 2)
37 | ```
38 |
39 | Let us see one example of using parameters. Assuming we have a report which prints "Employees" table. We want to modify the report to print information about an employee with an indicated number. To do this, we need to filter the data on the "EmployeeID" data column. Create a parameter with "EmployeeID" name. Indicate parameter's type - Int32, as exactly this type has the "EmployeeID" data column. To filter an employee with an indicated ID we need to enter "Data" band editor and indicate the following expression in "Filter" tab:
40 |
41 | ```
42 | [Employees.EmployeeID] == [EmployeeID]
43 | ```
44 |
45 | ## Passing a Value to a Report Parameter
46 |
47 | To pass a value to the parameter, use the SetParameterValue method of the Report object:
48 |
49 | ```csharp
50 | report1.Load("report.frx");
51 | report1.SetParameterValue("MyParam", 10);
52 | report1.Prepare();
53 | ```
54 | This method is declared as follows:
55 |
56 | ```csharp
57 | public void SetParameterValue(string complexName, object value)
58 | ```
59 |
60 | Specify the parameter's name in the complexName parameter. To access a nested parameter, use its full name, for example:
61 |
62 | ```csharp
63 | "ParentParameter.ChildParameter"
64 | ```
65 |
66 | ---
67 |
68 | [Registering Data](RegisteringData.md) | [Top Page](README.md) | [Query Parameters](QueryParameters.md)
--------------------------------------------------------------------------------
/RunningReport.md:
--------------------------------------------------------------------------------
1 | # 7.2. Running a Report
2 |
3 | To run a report, use one of the following methods of the Report object:
4 |
5 | `bool Prepare()` - Runs a report. If the report was prepared successfully, returns true.
6 |
7 | `bool Prepare(bool append)` - Runs a report. If the append parameter is set to true, the prepared report will be added to the existing one. So you can build several reports and display them in the preview as one report:
8 | ```csharp
9 | report1.Load("report1.frx");
10 | report1.Prepare();
11 | report1.Load("report2.frx");
12 | report1.Prepare(true);
13 | ```
14 |
15 | ---
16 |
17 | [Storing and Loading a Report](StoringLoadingReport.md) | [Top Page](README.md) | [Configuring the Environment](ConfiguringEnvironment.md)
--------------------------------------------------------------------------------
/StoringLoadingReport.md:
--------------------------------------------------------------------------------
1 | # 7.1. Storing and Loading a Report
2 |
3 | You may store a report in the following ways:
4 |
5 |
6 | ## In the .FRX file
7 |
8 | To load the report from a file, use the `Load` method of the `Report` object:
9 |
10 | ```csharp
11 | report1.Load("filename.frx");
12 | ```
13 |
14 | ## In the database
15 |
16 | You may store a report in the database, either as a string or in a blob-stream.
17 | To load the report from a string, use the `LoadFromString` method of the `Report` object.
18 | To load the report from a stream, use the overloaded version of the Load method:
19 |
20 | ```csharp
21 | report1.Load(stream);
22 | ```
23 |
24 | ## As a C#/VB.NET class
25 | To work with a report as a class, design your report and save in to the .cs/.vb file.
26 | To do this, select "file type" in the "Save" dialog. The file type maybe either .cs or .vb - it depends on the script language in the report (it may be changed in the "Report|Options..." menu).
27 | Include that file into your project. This method has the following Pros:
28 |
29 | - you can work with a report as a class;
30 | - you may debug a report;
31 | - this is the only way to use a report in ASP.NET project running on medium trust environment;
32 |
33 | and Cons:
34 |
35 | - you cannot edit such a report. To do this, you need the original .FRX file;
36 | - if you need to change a report, you have to recompile your application.
37 |
38 | To work with a report, create an instance of the report's class:
39 |
40 | ```csharp
41 | SimpleListReport report = new SimpleListReport();
42 | report.Show();
43 | ```
44 |
45 | ---
46 |
47 | [Using the Report](UsingReport.md) | [Top Page](README.md) | [Running a Report](RunningReport.md)
48 |
--------------------------------------------------------------------------------
/SystemVariables.md:
--------------------------------------------------------------------------------
1 | # 3.4. System Variables
2 |
3 | There is a list of system variables that can be used in a report:
4 |
5 | | Variable | Description |
6 | |:-|:-|
7 | | `Date` | Date and time of the report's start. |
8 | | `Page` | Current page number. |
9 | | `TotalPages` | Total number of pages in the report. To use this variable, you need to enable the report's double pass. You can do this in "Report\|Properties..." menu. |
10 | | `PageN` | Page number in the form: "Page N". |
11 | | `PageNofM` | Page number in the form: "Page N of M". |
12 | | `Row#` | Data row number inside the group. This value is reset at the start of a new group. |
13 | | `AbsRow#` | Absolute number of data row. This value is never reset at the start of a new group. |
14 | | `Page#` | Current page number. If you join several prepared reports into one package, this variable will return current page number in a package. This variable is actually a macro. It value is substituted when the component is viewed in the preview window. That means you cannot use it in an expression. |
15 | | `TotalPages#` | Total number of pages in the report. If you join several prepared reports into one package, this variable will return the number of pages in a package. You don't need to use double pass to get the correct value. This variable is actually a macro. It value is substituted when the component is viewed in the preview window. That means you cannot use it in an expression. |
16 | | `HierarchyLevel` | Current level of hierarchy in a hierarchical report. The top level is equal to 1. |
17 | | `HierarchyRow#` | Full row number like "1.2.1" in a hierarchical report. |
18 |
19 | ---
20 |
21 | [Query Parameters](QueryParameters.md) | [Top Page](README.md) | [Totals](Totals.md)
22 |
--------------------------------------------------------------------------------
/Totals.md:
--------------------------------------------------------------------------------
1 | # 3.5. Totals
2 |
3 | In many reports, we may need to show some total information: sum of the group, number of rows in the list, and many others. FastReport uses totals to perform this task. For the total, you need to indicate the following parameters:
4 |
5 | - The total function type;
6 | - The expression, which is supposed to be calculated. For the "Count" function, you do not need to indicate the expression;
7 | - The condition. The function will be calculated if the condition is met. It's not obligatory to set up the condition.
8 | - The data band, for which the function will be processed;
9 | - The band, in which the total value will be printed.
10 |
11 | The list of total functions is given below:
12 |
13 | | Function | Description |
14 | |:-|:-|
15 | | `Sum` | Calculates the sum of the expression. |
16 | | `Min` | Calculates the minimum value of the expression. |
17 | | `Max` | Calculates the maximum value of the expression. |
18 | | `Average` | Calculates the average value of the expression. |
19 | | `Count` | Returns the number of rows. |
20 |
21 |
22 | ---
23 |
24 | [System Variables](SystemVariables.md) | [Top Page](README.md) | [Expressions](Expressions.md)
--------------------------------------------------------------------------------
/UsingReport.md:
--------------------------------------------------------------------------------
1 | # 7. Using the Report
2 |
3 | ## Working with Report in a code
4 |
5 | To work with Report component in a code, you need to do the following:
6 |
7 | - create a report instance;
8 | - load a report file into it;
9 | - register the application-defined data in a report;
10 | - pass the values into the report parameters, if needed;
11 | - run the report.
12 |
13 | The following example demonstrates how to do this:
14 |
15 | ```csharp
16 | using (Report report = new Report())
17 | {
18 | report.Load("report1.frx");
19 | report.RegisterData(dataSet1, "NorthWind");
20 | report.Show();
21 | }
22 | ```
23 |
24 | ---
25 |
26 | [Creating a Report by Using Code](CreatingReportUsingCode.md) | [Top Page](README.md) | [Storing and Loading a Report](StoringLoadingReport.md)
--------------------------------------------------------------------------------
/WebReport.md:
--------------------------------------------------------------------------------
1 | # 9. Reports in Web
2 |
3 | ## Inside WebReport
4 |
5 | 
6 |
7 | ## Browsers support
8 |
9 | FastReport.OpenSource.Web supports latest versions of Chrome, Firefox, Safari, Opera and Edge browsers.
10 |
11 | ## Using WebReport in ASP.NET MVC application
12 |
13 | 1. Add **FastReport.OpenSource.Web** as nuget dependency in your **ASP.NET Core** project:
14 |
15 | ```xml
16 |
17 | ```
18 |
19 | 2. Register **FastReport.OpenSource.Web** in the *Configure* method of your *Startup* class:
20 |
21 | ```csharp
22 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
23 | {
24 | ...
25 | app.UseFastReport();
26 | ...
27 | }
28 | ```
29 |
30 | 3. Create WebReport object and render it in your view file:
31 |
32 | ```csharp
33 | public IActionResult Index()
34 | {
35 | var webReport = new WebReport();
36 | webReport.Report.Load("path/to/report.frx");
37 |
38 | return View(webReport);
39 | }
40 | ```
41 |
42 | ```html
43 | @model FastReport.Web.WebReport
44 |
45 |
46 | @await Model.Render()
47 |
48 | ```
49 |
50 | ## Editing a Report in FastReport Online Designer
51 |
52 | The WebReport can be used together [FastReport Online Designer](https://www.fast-report.com/en/product/fast-report-online-designer/).
53 |
54 | Look at the following example:
55 | ```csharp
56 | public IActionResult Index()
57 | {
58 | var webReport = new WebReport();
59 | webReport.Report.Load(Server.MapPath("~/App_Data/report.frx"));
60 | // Enable code editor in the Report Designer
61 | webReport.Mode = WebReportMode.Design;
62 | // Disable editing of script code
63 | webReport.DesignScriptCode = false;
64 | // Set a path to the Report Designer
65 | webReport.DesignerPath = "/WebReportDesigner/index.html";
66 | // Set a path to the Designer Save Callback
67 | webReport.DesignerSaveCallBack = "~/Home/SaveDesignedReport";
68 | // Set a ID for using it in Callback
69 | webReport.ID = "DesignReport";
70 | return View(webReport);
71 | }
72 |
73 | ....
74 |
75 | [HttpPost]
76 | // Call-back for save the designed report
77 | public ActionResult SaveDesignedReport(string reportID, string reportUUID)
78 | {
79 | ViewBag.Message = String.Format("Confirmed {0} {1}", reportID, reportUUID);
80 | if (reportID == "DesignReport")
81 | {
82 | // Do something with designed report, for example
83 | Stream reportForSave = Request.InputStream;
84 | string pathToSave = Server.MapPath("~/App_Data/DesignedReports/test.frx");
85 | using (FileStream file = new FileStream(pathToSave, FileMode.Create))
86 | {
87 | reportForSave.CopyTo(file);
88 | }
89 | }
90 | return View();
91 | }
92 | ```
93 | Also you need to create a simple view in `\Views\Home\SaveDesignedReport.cshtml`.
94 |
95 | ```html
96 |