Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update WebReport #11

Merged
merged 2 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bands.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bands
# 2.3. Bands

The band is an object which is located directly on the report page and is a container for other objects like "Text", "Picture" and others.

Expand Down
2 changes: 1 addition & 1 deletion CreatingReportUsingCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Let us consider how to create a report in code.

```
```csharp
Report report = new Report();
// register the "Products" table
report.RegisterData(dataSet1.Tables["Products"], "Products");
Expand Down
8 changes: 4 additions & 4 deletions Data.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Data
# 3. Data
Any report prints some data. In FastReport, you can operate with the following data:

- data sources;
Expand All @@ -19,7 +19,7 @@ DB table content is not saved in a report file. Instead, the connection string a

There can be parameters in a query text. Let us see the following query:

```
```sql
select * from DVDs
where Title = @param1
```
Expand Down Expand Up @@ -54,7 +54,7 @@ In the first way, you pass a value programmatically. Since there is no easy way

- Pass a value to the report parameter:

```
```csharp
report1.SetParameterValue("MyReportParameter", 10);
```

Expand Down Expand Up @@ -171,7 +171,7 @@ Let us see one example of using parameters. Assuming we have a report which prin

To pass parameter value from your program to the report, use the following code:

```
```csharp
report1.SetParameterValue("EmployeeID", 2);
```

Expand Down
6 changes: 3 additions & 3 deletions Exporting.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Exporting
# 7. Exporting

The following is an example of exporting a report in Jpeg file.

```
```csharp
// export to image
ImageExport image = new ImageExport();
image.ImageFormat = ImageExportFormat.Jpeg;
Expand All @@ -11,4 +11,4 @@ The following is an example of exporting a report in Jpeg file.

---

[Creating Report Using Code](CreatingReportUsingCode.md) | [Top Page](README.md) | [WebReport](WebReport.md)
[Creating Report Using Code](CreatingReportUsingCode.md) | [Top Page](README.md) | [Reports in Web](WebReport.md)
18 changes: 9 additions & 9 deletions Expressions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Expressions
# 4. Expressions

In many places in FastReport, expressions are used. For example, the "Text" object can contain expressions in square brackets.

Expand Down Expand Up @@ -52,7 +52,7 @@ You have access to all .Net objects declared in these assemblies. If you need to

For example, if you want to use a function in your report which was declared in your application, add application assembly (.exe or .dll) in a report assemblies list. After that you can call the function by using namespace of your application. For example, if the following function is defined in application:

```
```csharp
namespace Demo
{
public static class MyFunctions
Expand All @@ -67,7 +67,7 @@ namespace Demo

You can use it in your report in the following way:

```
```csharp
Demo.MyFunctions.Func1()
```

Expand Down Expand Up @@ -128,21 +128,21 @@ The error occurs because, you never mix strings with numbers. For this, you need

In this case, we refer to the "Employees.Age" column as if it is an integer variable. And it is so. We know that all expressions are compiled. All non-standard things (like referring to data columns) from a compiler's point of view are converted into another type, which is understandable to a compiler. So, the last expression will be turned into the following form:

```
```csharp
(string)(Report.GetColumnValue("Employees.FirstName")) + " " +
(int)(Report.GetColumnValue("Employees.Age")).ToString()
```

As seen, FastReport changes reference to data columns in the following way:

```
```csharp
[Employees.FirstName] --> (string)(Report.GetColumnValue("Employees.FirstName"))
[Employees.Age] --> (int)(Report.GetColumnValue("Employees.Age"))
```

That is, we can use data column in an expressions as if it is a variable having a definite type. For example, the following expression will return the first symbol of an employee's name:

```
```csharp
[Employees.FirstName].Substring(0, 1)
```

Expand Down Expand Up @@ -171,7 +171,7 @@ This expression returns the current year. As "Date" variable has DateTime type,

FastReport converts reference to system variable into the following form (for example, the "Date" variable):

```
```csharp
((DateTime)Report.GetVariableValue("Date"))
```

Expand All @@ -185,7 +185,7 @@ In order to refer to a total value, use its name:

FastReport converts reference to totals into the following form:

```
```csharp
Report.GetTotalValue("TotalSales")
```

Expand Down Expand Up @@ -213,7 +213,7 @@ Parameters have a definite data type. It is set in the "DataType" property of th

FastReport converts reference to a report parameter into the following way:

```
```csharp
((string)Report.GetParameterValue("Parameter1"))
```

Expand Down
2 changes: 1 addition & 1 deletion Fundamentals.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fundamentals
# 2. Fundamentals

In this chapter we will learn the principles of working with a report in the FastReport. We will also take a close look at report elements such as report pages, bands, and report objects.

Expand Down
2 changes: 2 additions & 0 deletions Introduction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 1. Introduction

## What is FastReport?

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.
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ We wish to draw up your attention to the fact that Documentation is under constr

## Table of Contents

### [Introduction](Introduction.md)
### 1. [Introduction](Introduction.md)

### [Fundamentals](Fundamentals.md)
#### [The Report](Report.md)
#### [Report Pages](ReportPages.md)
#### [Bands](Bands.md)
#### [Report Objects](ReportObjects.md)
### 2. [Fundamentals](Fundamentals.md)
#### 2.1. [The Report](Report.md)
#### 2.2. [Report Pages](ReportPages.md)
#### 2.3. [Bands](Bands.md)
#### 2.4. [Report Objects](ReportObjects.md)

### [Data](Data.md)
### 3. [Data](Data.md)

### [Expressions](Expressions.md)
### 4. [Expressions](Expressions.md)

### [Script](Script.md)
### 5. [Script](Script.md)

### [Report Creation](ReportCreation.md)
#### [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
#### [FastReport Online Designer](FastReportOnlineDesigner.md)
#### [Report Template File Structure](ReportTemplateFileStructure.md)
#### [Creating a Report by Using Code](CreatingReportUsingCode.md)
### 6. [Report Creation](ReportCreation.md)
#### 6.1. [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
#### 6.2. [FastReport Online Designer](FastReportOnlineDesigner.md)
#### 6.3. [Report Template File Structure](ReportTemplateFileStructure.md)
#### 6.5. [Creating a Report by Using Code](CreatingReportUsingCode.md)

### [Exporting](Exporting.md)
### 7. [Exporting](Exporting.md)

### [Web Reports](WebReport.md)
### 8. [Reports in Web](WebReport.md)

### [APPENDIX I: Examples](Examples.md)
### [APPENDIX II: Class Reference](https://fastreports.github.io/FastReport.Documentation/ClassReference/api/FastReport.html)
Expand Down
2 changes: 1 addition & 1 deletion Report.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The Report
# 2.1. The Report

The report building process can be represented as follows:

Expand Down
10 changes: 5 additions & 5 deletions ReportCreation.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Report Creation
# 6. Report Creation

### [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
### [FastReport Online Designer](FastReportOnlineDesigner.md)
### [Report Template File Structure](ReportTemplateFileStructure.md)
### [Creating a Report by Using Code](CreatingReportUsingCode.md)
### 6.1. [FastReport Designer Community Edition](FastReportDesignerCommunityEdition.md)
### 6.2. [FastReport Online Designer](FastReportOnlineDesigner.md)
### 6.3. [Report Template File Structure](ReportTemplateFileStructure.md)
### 6.4. [Creating a Report by Using Code](CreatingReportUsingCode.md)

---

Expand Down
2 changes: 1 addition & 1 deletion ReportObjects.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Report Objects
# 2.4. Report Objects

A wide variety of objects can be used in a report.

Expand Down
2 changes: 1 addition & 1 deletion ReportPages.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Report Pages
# 2.2. Report Pages

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:

Expand Down
2 changes: 1 addition & 1 deletion ReportTemplateFileStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The following is an example of the structure of a report template file.

```
```xml
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" TextQuality="Regular" ReportInfo.Name="Simple List" ReportInfo.Author="Fast Reports Inc" ReportInfo.Description="Demonstrates simple list report. To create it:&#13;&#10;- go to &quot;Data&quot; menu and select &quot;Choose Report Data...&quot; item to select datasource;&#13;&#10;- go to &quot;Report|Configure Bands...&quot; menu to create the band structure;&#13;&#10;- return to the report page, doubleclick the data band to show its editor;&#13;&#10;- choose the datasource;&#13;&#10;- drag data from the Data Dictionary window to the band." ReportInfo.Created="01/17/2008 03:05:57" ReportInfo.Modified="07/26/2018 12:14:37" ReportInfo.CreatorVersion="1.0.0.0">
<Dictionary>
Expand Down
32 changes: 16 additions & 16 deletions Script.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Script
# 5. Script

Script is a higher-level programming language, which is part of the report. Script can be written in one of the following .Net languages:

Expand All @@ -17,7 +17,7 @@ A script is applicable in many places. Using the script, you can do the followin

A script is mainly used for creating objects' event handlers. For creating event handler select the needed object.

```
```csharp
private void Text2_BeforePrint(object sender, EventArgs e)
{

Expand Down Expand Up @@ -56,13 +56,13 @@ So, by using events of different objects, you can control every step of report f

For referring to report objects (for example, "Text" object) use the name of the object. The following example returns the height of Text1 object:

```
```csharp
float height = Text1.Height;
```

Note that report's native unit of measurement is screen pixels. Keep it in mind when using such object's properties like Left, Top, Width, and Height. To convert pixels into centimeters and back, use the constants, defined in the "Units" class:

```
```csharp
float heightInPixels = Text1.Height;
float heightInCM = heightInPixels / Units.Centimeters;
Text1.Height = Units.Centimeters * 5; // 5см
Expand Down Expand Up @@ -139,7 +139,7 @@ Item1

For controlling the current element, there are OutlineUp and OutlineRoot methods. The first method moves the pointer to the element, located on a higher level. So, the script

```
```csharp
Engine.AddOutline("Item1");
Engine.AddOutline("Item2");
Engine.AddOutline("Item3");
Expand All @@ -158,7 +158,7 @@ Item1

The OutlineRoot method moves the current element to the root of the outline. For example, the following script:

```
```csharp
Engine.AddOutline("Item1");
Engine.AddOutline("Item2");
Engine.AddOutline("Item3");
Expand All @@ -185,25 +185,25 @@ The GetBookmarkPage method returns the page number on which the bookmark is plac

Contrary to the FastReport expressions (covered in the "Expressions" section), never use square brackets in script for referring to the data sources. Instead of this, use the GetColumnValue method of the Report object, which returns the value of the column:

```
```csharp
string productName = (string)Report.GetColumnValue("Products.Name");
```

As seen, you need to indicate the name of the source and its column. The name of the source can be compound in case, if we are referring to the data source by using a relation. Details about relations can be found in the "Data" chapter. For example, you can refer to a column of the related data source in this way:

```
```csharp
string categoryName = (string)Report.GetColumnValue("Products.Categories.CategoryName");
```

For referring to the data source itself, use the GetDataSource method of the Report object:

```
```csharp
DataSourceBase ds = Report.GetDataSource("Products");
```

Help on properties and methods of the DataSourceBase class can be received from the FastReport.Net Class Reference help system. As a rule, this object is used in the script in the following way:

```
```csharp
// get a reference to the data source
DataSourceBase ds = Report.GetDataSource("Products");
// initialize it
Expand All @@ -224,21 +224,21 @@ while (ds.HasMoreRows)

For reference to system variables, use the GetVariableValue method of the Report object:

```
```csharp
DateTime date = (DateTime)Report.GetVariableValue("Date");
```

## Reference to total values

For reference to the total value, use the GetTotalValue method of the Report object:

```
```csharp
float sales = Report.GetTotalValue("TotalSales");
```

Total value has got the FastReport.Variant type. It can be used directly in any expression, because the FastReport.Variant type is automatically converted to any type. For example:

```
```csharp
float tax = Report.GetTotalValue("TotalSales") * 0.2f;
```

Expand All @@ -248,21 +248,21 @@ Reference to the total value can be done at that time when, it is being processe

For referring to report parameters, use the GetParameterValue method of the Report object:

```
```csharp
int myParam = (int)Report.GetParameterValue("MyParameter");
```

Parameters can be nested. In this case, indicate the name of the parent parameter and after the period, the name of the child parameter:

```
```csharp
Report.GetParameterValue("ParentParameter.ChildParameter")
```

Parameters have got a definite data type. It is given in the DataType property of the parameter. You must take this into account when referring to parameters.

For changing the value of the parameter, use the SetParameterValue method of the report object:

```
```csharp
Report.SetParameterValue("MyParameter", 10);
```

Expand Down
Loading