-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from fediachov/master
Update a Documentation
- Loading branch information
Showing
23 changed files
with
535 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## Compiling the source code | ||
|
||
1. Install latest .Net Core SDK for your OS from https://www.microsoft.com/net/download | ||
2. Follow the commands | ||
|
||
```sh | ||
# for windows users | ||
git clone https://github.com/FastReports/FastReport.git | ||
cd FastReport | ||
Tools\pack.bat | ||
``` | ||
|
||
```sh | ||
# for linux users | ||
git clone https://github.com/FastReports/FastReport.git | ||
cd FastReport | ||
chmod 777 Tools/pack.sh && ./Tools/pack.sh | ||
``` | ||
|
||
The package is located at `fr_nuget` directory. | ||
|
||
## Installing from NuGet | ||
|
||
You can add FastReport to your current project via NuGet package manager: | ||
``` | ||
Install-Package FastReport.OpenSource | ||
Install-Package FastReport.OpenSource.Web | ||
``` | ||
|
||
## Compiling solution in Visual Studio | ||
|
||
Open the FastReport.OpenSource.sln file in Visual Studio and choice the Build -> Build Solution. | ||
Then you can set as StartUp any project from Demos folder and run it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 7.3. Configuring the Environment | ||
|
||
Using the static object FastReport.Utils.Config you can control some FastReport environment settings. | ||
|
||
The FastReport.Utils.Config.ReportSettings property contains some report-related settings: | ||
|
||
| Property | Description | | ||
|:-|:-| | ||
| Language DefaultLanguage | The default script language for new reports. | | ||
|
||
--- | ||
|
||
[Running a Report](RunningReport.md) | [Top Page](README.md) | [Passing Own Connection String](PassingOwnConnectionString.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# APPENDIX I: Examples | ||
# Examples | ||
|
||
Under Construction | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 7.5. Passing Custom SQL | ||
|
||
The report may contain data sources that are added using the Data Wizard in Designer (via "Data|Add Data Source..." menu). | ||
|
||
Sometimes it is needed to pass custom SQL to that data source from your application. To do this, use the following code: | ||
|
||
```csharp | ||
using FastReport.Data; | ||
... | ||
report1.Load(...); | ||
// do it after loading the report, before running it | ||
// find the table by its alias | ||
TableDataSource table = report1.GetDataSource("MyTable") as TableDataSource; | ||
table.SelectCommand = "new SQL text"; | ||
report1.Show(); | ||
``` | ||
|
||
--- | ||
|
||
[Passing Own Connection String](PassingOwnConnectionString.md) | [Top Page](README.md) | [Reference to a Report Object](ReferenceReportObject.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 7.4. Passing Own Connection String | ||
|
||
If you use data sources that are defined inside a report, you may need to pass an application-defined connection string to a report. | ||
This can be done in three ways. | ||
|
||
**The first method:** you pass a connection string directly to the Connection object in a report. Do the following: | ||
|
||
```csharp | ||
report1.Load(...); | ||
// do it after loading the report, before running it | ||
// assume we have one connection in the report | ||
report1.Dictionary.Connections[0].ConnectionString = my_connection_string; | ||
report1.Show(); | ||
``` | ||
|
||
**The second method:** you pass a connection string using the report parameter. Do the following: | ||
|
||
- run the report designer; | ||
- in the "Data" window, create a new report parameter (with "MyParameter" name, for example); | ||
- in the "Data" window, select the "Connection" object that contains a data source; | ||
- switch to the "Properties" window and set the ConnectionStringExpression property to the following: | ||
``` | ||
[MyParameter] | ||
``` | ||
- pass the connection string to the MyParameter parameter: | ||
```csharp | ||
report1.SetParameterValue("MyParameter", my_connection_string); | ||
``` | ||
|
||
--- | ||
|
||
[Configuring the Environment](ConfiguringEnvironment.md) | [Top Page](README.md) | [Passing Custom SQL](PassingCustomSQL.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 3.3. Query parameters | ||
|
||
There can be parameters in a query text. Let us see the following query: | ||
|
||
```sql | ||
select * from DVDs | ||
where Title = @param1 | ||
``` | ||
|
||
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. | ||
|
||
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. | ||
|
||
The following parameter's properties should be set in the properties window: | ||
|
||
| Property | Description | | ||
|:-|:-| | ||
| 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. | | ||
| DataType | Parameter data type. | | ||
| 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). | | ||
| 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). | | ||
| Size | Parameter data size. This property should be indicated if the parameter is of "string" data type. | | ||
|
||
## Passing a value to the parameter | ||
|
||
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. | ||
|
||
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: | ||
|
||
- Create the report parameter. Set the same DataType for the report parameter, as it is used in the query parameter. | ||
|
||
- In the "Expression" property of the query parameter, refer to a report parameter, for example: | ||
|
||
``` | ||
[MyReportParameter] | ||
``` | ||
|
||
- Pass a value to the report parameter: | ||
|
||
```csharp | ||
report1.SetParameterValue("MyReportParameter", 10); | ||
``` | ||
|
||
--- | ||
|
||
[Report Parameters](ReportParameters.md) | [Top Page](README.md) | [System Variables](SystemVariables.md) |
Oops, something went wrong.