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.
See about enterprise components here: http://www.fast-report.com/pbc_download/EnterpriseEn.pdf
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).
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 will ask our Resseler to return you discount amount. Write to support please.
Write to support. Perhaps an error occurred while registering your new account
We will give you the order to the update. Write to support.
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.
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.
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.
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.
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.
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);
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.
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().
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()";
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.
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> |
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); |
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:
1. Create new MSChart object, set width, height and legend:
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:
Send us an email about this on support.fast-report.com and we'll give you the nearest accessible for you version.
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();
You should delete FastReport.config file from C:\Users\"Your user's name"\AppData\Local\FastReport folder.
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!
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!
You should use the following snippet:
Report.Dictionary.Connections[0].Tables[0].Parameters[0].Value.ToString();
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 |
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.
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; |
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(); |
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()].
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; } |
FastReport .NET Enterprise consist of:
FastReport .NET Professional and Online Designer.
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).
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.
How do we install your licence packages in our product using Linux, MacOS or Windows so that we won’t have to install the latest update of FastReport products manually by installer that has been downloaded from the website compatible only with Windows?
To answer this question, we have prepared a comprehensive decision such as our Fast Reports Private NuGet-server. Read more about it in the next article.
If your subscription has expired, you can keep using Fast Reports packages source, however you will have no access to the latest versions of packages. As a consequence, the latest available version of the package will be determined by the following condition:
Date of selected version release < Date of necessary subscription expiry
Important! When trying to download a package with the release date later than necessary subscription expiry date, Fast Reports NuGet server will provide you with the latest available version of the package based on your subscription. But we don’t recommend a link to unavailable package version, as it leads to Warning notification when restoring a project and delay of package downloading.