logo
small logo
  • Produkty
  • Zamów
  • Wsparcie techniczne
  • About
  • Customer panel Wsparcie techniczne
    • en
    • de
    • JP
    • ZH
  • Glówna strona
  • /
  • Wsparcie techniczne
  • /
  • FAQ
  • /
  • FastReport .NET

FastReport .NET

Wersja: 2023.2.4 Data: 22 mar 2023 Zmiany...
  • Dokumentacja
  • Deinstallation
  • Licencja
  • FAQ

Can I add the report generator to the product that my customers are able to modify the reports? Or will every customer have to buy his own license

You can add a designer FastReport.NET to end-users without additional licensing. This means that you can add the report generator to the product only without the source code and outside the development environment.

Only Enterprise version contains this function: "Components for web-applications". Please can you write me what is it?

See about enterprise components here: http://www.fast-report.com/pbc_download/EnterpriseEn.pdf

What is the difference in the Single, Team and Site License?Please explain fully

You can order 1 single license (only per one developer). 2 team license (for teams of developers to four people inclusive. Included Build Server license). 3 site-license (for an unlimited number of work places in the organization with the one geographical address. Included Build Server license).

How much is the subscription renewal FastReport .NET? And what I'm getting from it?

Renew a subscription You can renew a subscription in your control panel. The subscription includes the technical support and product updates. It is available at a 1/3 of the full price per year. When your subscription is expired, you have two options: - renew a subscription. This will allow you to get a technical support and product updates. - continue to use the FastReport .NET. In this case, you will not able to use recent product updates and get technical support. 

We are old customer user but we don't have got a discount for this. We bought standard price. Why not let us discount was taken.

We will ask our Resseler to return you discount amount. Write to support please.

I have purchased a FastReport product. I should get the licensing information within 48 hours, but didn't get an e-mail. Also in "My downloads" I couldn't see anything about new product.

Write to support. Perhaps an error occurred while registering your new account

We would like to order update, unfortunately, in our panel is not an option.

We will give you the order to the update. Write to support.

I would like to buy the update to a "higher" version of FR* team license with discount, but I have only Single license of FR*. How much is it?

You can get a discount 30% of Single license. Price Team license - 30% of Single license = your Price. Write to support. We will give you the order.

Couldn't add FastReport .NET components on Form in Visual Studio

You should add FastReport.Editor.dll, FastReport.VSDesign.dll, FastReport.Web and FastReport.dll to the GAC. For it open Visual studio tools folder(C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts), open Developer Command Prompt for..., and write gacutil -i "reference path+ name.dll"(gacutil -i "Program Files\FastReports\FastReport.Net\Framework 4.0\FastReport.dll").Read more about GAC there - 
https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx

After this add FastReport controls in Visual Studio Toolbox: right click on Toolbox -> Choose Items -> Choose FastReport.dll from GAC and press OK.

How to calculate the size of the object, whose properties are set to dynamically change (AutoWidth, CanGrow, CanShrink)?

If you call .Height object property (Text1.Height), then the result will be the height of the object in the report template. When report is builded then the height changes.

You should use CalcHeight (Text1.CalcHeight ()) method to determine the height of the object in a prepared report. To calculate the width need also use CalcWidth method.

Receive an error message when compile the project:The type or namespace name 'FastReport' could not be found (are you missing a using directive or an assembly reference?)

Make sure that the project include links to the required libraries (FastReport.dll, FastReport.Web.dll). Check the .NET Framework version used by your project and the connected library.

After installing the full version FastReport .NET reports continue to be generated with the limitations.

You should delete Trial version. After it check directories C:\Windows\assembly and C:\Windows\Microsoft.NET\assembly\GAC_MSIL. It mustn't include FastReport .NET libraries. If it include - then delete it.
After uninstalling should install Full FastReport .NET version.

How to send a report in PDF format by e-mail using a code?

Use this snippet for it:
Report report = new Report();
report.Load(...);
report.RegisterData(...);
report.Prepare();

PDFExport pdfExport = new PDFExport();
EmailExport export = new EmailExport();

// set up Account properties...
export.Account.Host = "...";
export.Account.Address = "...";

// set up email properties...
export.Address = "...";
export.Subject = "...";
export.MessageBody = "...";

// send email
export.Export = pdfExport;
export.SendEmail(report);

How to Remove DATA tab for End users?

Add the "EnvironmentSettings" control to your form. 
Then add the following line before calling report.Design():

1
2
EnvironmentSettings1.DesignerSettings.Restrictions.DontCreateData = True;
EnvironmentSettings1.DesignerSettings.Restrictions.DontEditData = True;

 If you use DesignerControl then should use this:

1
2
designerControl1.Restrictions.DontCreateData = true;
designerControl1.Restrictions.DontEditData = true;

this way the data controls will be disabled.

How to inherit report from code?

1. You should create new report:

Report report = new Report();

 2. Add CustomLoadEventHandler for loading base report:

report.LoadBaseReport += new CustomLoadEventHandler(FReport_LoadBaseReport); 

 3. Load inherited report:

report.Load("InheritReport.frx"); 

 4. Delete CustomLoadEventHandler:

report.LoadBaseReport -= new CustomLoadEventHandler(FReport_LoadBaseReport); 

 5. You can show report or edit it. Report have base and inhereted reports:

report.Show(); 

Also need create event for loading base report:

1
2
3
4
5
6
private void FReport_LoadBaseReport(object sender, CustomLoadEventArgs e) 
{ 
// e.FileName contains the name of base report. It may be the file name, or an ID in the database, 
// it depends on how you load the main report 
e.Report.Load("C:\\Users\\InheritReport\\bin\\Debug\\Title2.frx"); 
} 

 And full code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 }
 
 private void Form1_Load(object sender, EventArgs e)
 {
 Report report = new Report();
 report.LoadBaseReport += new CustomLoadEventHandler(FReport_LoadBaseReport);
 report.Load("InheritReport.frx");
 report.LoadBaseReport -= new CustomLoadEventHandler(FReport_LoadBaseReport);
 
 report.Show();
 }
 
 private void FReport_LoadBaseReport(object sender, CustomLoadEventArgs e)
 {
 // e.FileName contains the name of base report. It may be the file name, or an ID in the database,
 // it depends on how you load the main report
 e.Report.Load("C:\\Users\\InheritReport\\bin\\Debug\\Title2.frx");
 }
 }

 If you want load report from database, replace Load() method on LoadFromString().

 


How to call the Java Script Function when user Click on Hyper link inside the report in ASP .NET?

You can write js code in TextObject.Huperlink object(javascript:alert('You clicked!')). 

Or write your function into *.aspx(cshtml) file: 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestInheritReports._Default" %> 
<%@ Register assembly="FastReport.Web" namespace="FastReport.Web" tagprefix="cc2" %> 
 
<script type="text/javascript"> 
function count_rabbits() { 
for(var i=1; i<=3; i++) { 
 
alert("Pull out from hat rabbit " + i +" !") 
} 
} 
</script> 
 
<!DOCTYPE html> 
 
<html xmlns="http://www.w3.org/1999/xhtml">; 
<head runat="server"> 
<title></title> 
</head> 
<body> 
<form id="form1" runat="server"> 
<div> 
 
</div> 
<cc2:WebReport ID="WebReport1" runat="server" /> 
</form> 
</body> 
</html> 

 and call function in hyperlink: 
TextObject1.Hyperlink = "javascript:count_rabbits()";


How to Remove CODE tab for End users?

Add the "EnvironmentSettings" control to your form. 
Then add the following line before calling report.Design():

environmentSettings1.DesignerSettings.Restrictions.DontEditCode = true;

this way the data controls will be disabled.

How to use FastReport .NET controls in WPF application?

You should use WindowsFormsHost control for it:

0) Add reference on FastReport.dll;

1) Add attribute into Window(Page) tag: xmlns:fr="clr-namespace:FastReport.Preview;assembly=FastReport" if you want to use PreviewControl, xmlns:fr1="clr-namespace:FastReport.Design;assembly=FastReport" - if DesignerControl;

2) Add WindowsFormsHost tag into your XAML markup:

1
2
3
<WindowsFormsHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="3">
 
</WindowsFormsHost>

3) Add child into WindowsFormsHost: <fr:PreviewControl></fr:PreviewControl> or <fr1:Designer></fr1:Designer>.

Full markup should look like this snippet:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<Window
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
 x:Class="WpfApplication1.MainWindow"
 Title="MainWindow" Height="375.977" Width="939.258"
 xmlns:fr="clr-namespace:FastReport.Preview;assembly=FastReport">
 <Grid>
 <Grid.ColumnDefinitions>
 <ColumnDefinition Width="*"/>
 <ColumnDefinition Width="*"/>
 <ColumnDefinition Width="*"/>
 </Grid.ColumnDefinitions>
 <WindowsFormsHost HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="3">
 <fr:PreviewControl></fr:PreviewControl>
 </WindowsFormsHost>
 </Grid>
</Window>
 

 

 

How to programmatically set the values of Format

You can do this in script or in your project using this code:

1
2
3
4
5
FastReport.Format.NumberFormat format = new FastReport.Format.NumberFormat();
format.UseLocale = false;
format.DecimalDigits = 2;
format.DecimalSeparator = ".";
format.GroupSeparator = ",";

and following that:

1
2
textObject.Formats.Clear();
textObject.Formats.Add(format);
How to create a line with gaps in MSChartObject?

You should create base System.Windows.Forms.DataVisualization.Charting.Series object and create line there. After this should assign created series for MSChartObject base chart (MSChart1.Chart.Series.Add(series);) Don't forget add System.Windows.Forms.DataVisualization.dll in Report -> Script menu and namespace System.Windows.Forms.DataVisualization.Charting.

Example of line with gaps:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.
.
using System.Windows.Forms.DataVisualization.Charting;
 
namespace FastReport
{
 public class ReportScript
 {
 private void MSChart1_BeforePrint(object sender, EventArgs e)
 { 
 Series series = new Series("sample");
 series.ChartType = SeriesChartType.Line;
 series.BorderWidth = 2;
 series.MarkerSize = 5;
 
 series.Points.Add(new DataPoint(0, 1));
 series.Points.Add(new DataPoint(1, 2));
 DataPoint dp = new DataPoint(2, double.NaN);
 dp.IsEmpty = true;
 series.Points.Add(dp);
 series.Points.Add(new DataPoint(3, 5));
 series.Points.Add(new DataPoint(4, 8)); 
 
 MSChart1.Chart.Series.Add(series);
 
 }
 }
}

 Result:

Line with gaps

How to create MSChartObject from code?

1. Create new MSChart object, set width, height and legend:

1
2
3
4
MSChartObject MSChart1 = new MSChartObject();
 MSChart1.Width = 300;
 MSChart1.Height = 300;
 MSChart1.Chart.Legends.Add(new Legend() { Name = "Legend1", Title="Legend title"});

 2. Create ChartArea object, set name, axes titles and assign created ChartArea to MSChart:

1
2
3
4
5
ChartArea chartArea1 = new ChartArea();
 chartArea1.Name = "ChartArea1";
 chartArea1.Axes[0].Title = "X name";
 chartArea1.Axes[1].Title = "Y name";
 MSChart1.Chart.ChartAreas.Add(chartArea1);

3. Create Series object, set chart type, border width, add points and assign series to chart:

1
2
3
4
5
6
7
8
9
 Series series = new Series("sample");
 series.ChartType = SeriesChartType.Line;
 series.BorderWidth = 2;
 series.Points.Add(new DataPoint(0, 1));
 series.Points.Add(new DataPoint(1, 2));
 series.Points.Add(new DataPoint(3, 5));
 series.Points.Add(new DataPoint(4, 8));
 
 MSChart1.Chart.Series.Add(series);

 4. Assign created MSChart to DataBand:

1
2
3
4
5
Report report = new Report();
report.Load("ok.frx");
DataBand db = report.FindObject("Data1") as DataBand;
 
MSChart1.Parent = db;

 And full snippet:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 MSChartObject MSChart1 = new MSChartObject();
 MSChart1.Width = 300;
 MSChart1.Height = 300;
 MSChart1.Chart.Legends.Add(new Legend() { Name = "Legend1", Title="Legend title"});
 
 ChartArea chartArea1 = new ChartArea();
 chartArea1.Name = "ChartArea1";
 chartArea1.Axes[0].Title = "X name";
 chartArea1.Axes[1].Title = "Y name";
 MSChart1.Chart.ChartAreas.Add(chartArea1); 
 
 Series series = new Series("sample");
 series.ChartType = SeriesChartType.Line;
 series.BorderWidth = 2;
 series.Points.Add(new DataPoint(0, 1));
 series.Points.Add(new DataPoint(1, 2));
 series.Points.Add(new DataPoint(3, 5));
 series.Points.Add(new DataPoint(4, 8));
 
 MSChart1.Chart.Series.Add(series);
 
 Report report = new Report();
 report.Load("ok.frx");
 DataBand db = report.FindObject("Data1") as DataBand;
 MSChart1.Parent = db;

 Result:
MSChart 

 

 

My subscription has been expired. Where can I download last accessible version of the product?

Send us an email about this on support.fast-report.com and we'll give you the nearest accessible for you version.

How to turn off ProgressForm while building or viewing the report?

You can turn off the ProgressForm in EnvironmentSettings:
Report report = new Report();
report.LoadPrepared("1.fpx");
EnvironmentSettings s = new EnvironmentSettings();
s.ReportSettings.ShowProgress = false;
report.Show();

How return/reset the default Designer settings?

You should delete FastReport.config file from C:\Users\"Your user's name"\AppData\Local\FastReport folder.

I don't like translation in one of localizations. How can I improve it?

You could find needed localization *.frl file in FastReports\FastReport.Net\Localization folder and improve it. Ask us (support.fast-report.com) for english localization file, if there is no fields in needed  file.  Add fields according to english version. Then send your improved translation to us and get reward! 

How to create localization for the required language?

Send us an email about this on tz@fast-report.com or support.fast-report.com and we'll give you the english localization file for creating needed localization. Send us your localization file (*.frl) and we'll add it in the new build and also will give you a reward!

How to get query parameter value from code?

You should use the following snippet:
Report.Dictionary.Connections[0].Tables[0].Parameters[0].Value.ToString();

How to embed report in HTML format into the message and send by e-mail using a code?

Use this snippet for it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Report report = new Report();
 report.LoadPrepared("preparedreport.fpx");
 
 HTMLExport htmlExport = new HTMLExport()
 {
 SubFolder = false,
 Navigator = false,
 Pictures = true,
 EmbedPictures = true,
 SinglePage = true,
 Layers = true,
 HasMultipleFiles = false
 };
 EmailExport email = new EmailExport();
 
 //email mailer settings
 email.Account.Address = "Email@gmail.com";
 email.Account.Name = "Usename";
 email.Account.Host = "smtp.yandex.ru";
 email.Account.Port = 25;
 email.Account.UserName = "Email";
 email.Account.Password = "password";
 email.Account.MessageTemplate = "Test";
 email.Account.EnableSSL = true;
 
 //email addressee settings
 email.Address = "Destinationaddress@gmail.com";
 email.Subject = "Embedding of html";
 
 email.Export = htmlExport; //Set export type
 email.SendEmail(report); //Send email

 


Doesn't work web demos

If you can't run demos from Demos\C#\Web folder, then you should:

1. Repair NuGet packages;

2. Add all necessary references from "packages";

3. Change build versions on the current in Web.Config from root folder and in Views.

How to combine several reports in one?

You should use for it this snippets.

For desktop version:

1
2
3
4
5
6
7
8
Report report = new Report(); 
report.Load(Path.GetFullPath(@"..\..\Report1.frx")); 
report.Prepare(true); 
report.Load(Path.GetFullPath(@"..\..\Report2.frx")); 
report.Prepare(true); 
report.Load(Path.GetFullPath(@"..\..\Report3.frx")); 
report.Prepare(true); 
report.ShowPrepared();

 For web version:

1
2
3
4
5
6
7
8
webReport.Report.Load(Path.GetFullPath(@"..\..\Report1.frx")); 
webReport.Report.Prepare(true); 
webReport.Report.Load(Path.GetFullPath(@"..\..\Report2.frx")); 
webReport.Report.Prepare(true); 
webReport.Report.Load(Path.GetFullPath(@"..\..\Report3.frx")); 
webReport.Report.Prepare(true); 
webReport.ShowRefreshButton = false; 
webReport.ReportDone = true;

 

 

How to load into and call report from application resources?

Load report into application resources:

1)Go to Visual Studio Resourses tab ( Project -> Properties -> Resources);

2) Set name (report) and set resources content ( from myreport.frx file);

Call report from resources:

1
2
3
Report report = new Report();
report.ReportResourceString = Resources.report;
report.Show();

 

How to add assembly (dll) to report from code?

Use this snippet:

1
2
3
Report report = new Report;
List<string> assmbly = new List<string>(report.ReferencedAssemblies);
assmbly.Add("Newtonsoft.Json.dll"); //replace to your dll's name
report.ReferencedAssemblies = assmbly.ToArray();

 Be sure, that added dll placed in a same folder that FastReport.dll.

Now you can call methods from connected dll. E.g., you can add this expression into TextObject - [Newtonsoft.Json.ConstructorHandling.Default.ToString()].

How to set all tables and relations from DataSet enabled in report?

Use this snippet to set all tables from your data source as enable:

1
2
3
4
foreach (FastReport.Data.DataSourceBase tbl in report.Dictionary.DataSources)
 {
 tbl.Enabled = true;
 } 

 Then add relations:

1
2
3
4
for (int i = 0; i < ds.Relations.Count; i++)
 {
 report.RegisterData(ds.Relations[i], "relation" + i);
 }

 And set relations enabled:

1
2
3
4
 foreach (FastReport.Data.Relation rl in report.Dictionary.Relations)
 {
 rl.Enabled = true;
 }

 And full code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 Report report = new Report();
 DataSet ds = new DataSet();
 ds.ReadXml("EstimateFile.xml");
 report.RegisterData(ds, "ds");
 
 foreach (FastReport.Data.DataSourceBase tbl in report.Dictionary.DataSources)
 {
 tbl.Enabled = true;
 }
 
 for (int i = 0; i < ds.Relations.Count; i++)
 {
 report.RegisterData(ds.Relations[i], "relation" + i);
 }

 foreach (FastReport.Data.Relation rl in report.Dictionary.Relations)
 {
 rl.Enabled = true;
 } 

 

What components FastReport .NET Enterprise consist of?

FastReport .NET Enterprise consist of:
FastReport .NET Professional and Online Designer.

Visual Studio Toolbox doesn't contain FastReport .NET components

Add components to a Toolbox manually:
Click "Choose items" in toolbox and choose FastReport.dll from GAC folder (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\FastReport).

Why there are no libraries for the .NET Framework 2.0 in installations since version 2020.3?

We decided to stop supporting the old framework and Visual Studio 2005. We have some difficulties with supporting various code snippets for legacy framework. If you continue to use .NET Framework 2.0 in your applictions, please write to us or use the version of FastReport .NET 2020.2 or earlier.

logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Zamów
  • Pobierz
  • Dokumentacja
  • Opinie użytkowników
  • Jak odinstalować nasze produkty
  • FAQ
  • Tutorial Video
  • Forum
  • Support SLA
  • Articles
  • Our News
  • Prasa o nas
  • Partnerzy
  • Extended licensing
  • Kontakty

© 1998-2023 by Fast Reports Inc.

  • Poufność

Trustpilot