logo
small logo
  • Producto
  • Comprar
  • Ayuda
  • About
  • Consola de usarios Ayuda
    • en
    • de
    • JP
    • ZH
  • Página principal
  • /
  • Ayuda
  • /
  • FAQ
  • /
  • FastReport .NET

FastReport .NET

VERSIÓN: 2023.1.9 Fecha: 24 ene. 2023 Cambios...
  • Documentación
  • Deinstallation
  • Licencia
  • FAQ

¿Es posible añadir el generador de informes a los productos para que mis clientes puedan modificar informes? ¿O cada cliente tiene que comprar su propia licencia?

Puede añadir el diseñador del FastReport.NET para los usarios finales y para eso no se necesita comprar una licencia adicional. Esto quiere decir que puede añadir el generador de informes sólo a productos sin código fuente y fuera del ambiente de desarrollo

Sólo la versión Enterprise contiente la función "Componentes para aplicaciones web". ¿Podría explicarme qué significa esto?

Sobre los componentes Enterprise consulta el siguiente apartado: http://www.fast-report.com/pbc_download/EnterpriseEn.pdf

¿Podría explicarme en detalle cuál es la diferencia entre los tres tipos de licencia: Single, Team y Site?

Básicamente nuestros productos tienen tres tipos de licencia: licencia Single, licencia Team y licencia Site. La licencia Single es una licencia sólo para un desarrollador; la licencia Team, que también incluye licencia para el Build servidor, es para cuatro desarroladores; la licencia Site, que también incluye licencia para Build servidor, es para un número de desarrolladores ilimitado.

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. 

Somos sus viejos clientes y usarios pero no nos dan descuento. Hemos comprado una licencia por el precio para todos. ¿Por qué?

Pediremos a nuestro distribuidor que le devuelva la cantidad del descuento. Debería ponerse en contacto con el servicio al cliente.

He comprado un producto FastReport. Tenía que recibir la información sobre la licencia en 48 horas, pero no me han enviado correo electrónico. Además, en la sección "Mis descargas" no puedo ver nada respecto al nuevo producto.

Debería ponerse en contacto con el servicio al cliente. Quizás haya ocurrido un error al registrar su perfil.

Nos gustaría pedir la actualización pero, por desgracia, en el panel del administrador no tenemos esta opción.

Vamos a realizarlo. Póngase en contacto con el servicio al cliente.

Quería comprar con descuento la actualización para una versión más reciente de la licencia FR* Team pero solo tengo licencia Single. ¿Cuánto es?

Puede obtener un discuento de 30 % para la licencia Single. El precio de la licencia Team - 30 % de la licencia Single = su precio. Póngase en contacto con el servicio al cliente para más información. Le vamos a enviar el pedido.

No puedo añadir los componentes FastReport .NET en la Forma en Visual Studio.

Debería añadir FastReport.Editor.dll, FastReport.VSDesign.dll, FastReport.Web y FastReport.dll a GAC. Para ello, abra la carpeta Visual studio tools (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts), abra Developer Command Prompt for..., y escriba en la línea de comandos gacutil -i "reference path+ name.dll"(gacutil -i "Program Files\FastReports\FastReport.Net\Framework 4.0\FastReport.dll"). Más información sobre GAC puede encontrar aquí:
https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx

A continuación añada los elementos de control a Visual Studio Toolbox: haga clic en Toolbox -> Choose Items -> Choose FastReport.dll desde GAC y pulse OK.

¿Cómo calcular el tamaño del objeto cuyas propiedades son de cambio dinámico (AutoWidth, CanGrow, CanShrink)?

Si invoca la propiedad del objeto .Height (Text1.Height), el resultado será la altura del objeto en el modelo de informe.

A la hora de compilar un informe la altura se cambiará y para determinar la altura en el informe preparado debería utilizar el método CalcHeight(Text1.CalcHeight()). Para calcular la anchura también se utiliza el método CalcWidth.

Recibo el siguente mensaje de error a la hora de compilar el proyecto: The type or namespace name 'FastReport' could not be found (are you missing a using directive or an assembly reference?)

Asegúrese de que el proyecto incluya hipervínculos a las bibliotecas necesarias(FastReport.dll, FastReport.Web.dll). Revise la versión de .NET Framework que tuilizan el proyecto y las bibliotecas conectadas.

Después de instalar la versión completa de FastReport .NET, sigo teniendo limitaciones.

Debería desinstalar la versión Trial. A continuación, compruebe los directorios C:\Windows\assembly y C:\Windows\Microsoft.NET\assembly\GAC_MSIL. No debe incluir las bibliotecas FastReport.NET. Si no es así, elimínalos. Ahora puede instalar la versión completa de FastReport.NET.

¿Cómo enviar un informe en PDF por correo electrónico utilizando un código?

Utilizando este fragmento:
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);

¿Cómo eliminar la pestaña Data para usarios finales?

Añada el control EnvironmentSettings a su formulario.
A continuación, antes de invocar report.Design(), añada las siguientes líneas:

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

Si utiliza DesignerControl, añada estas líneas:

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

De esta manera los elementos de control Data se desactivarán.

¿Cómo heredar un informe de un código?

1. Cree un nuevo informe:

Report report = new Report();

2. Añada el evento CustomLoadEventHandler para cargar el informe básico:

report.LoadBaseReport += new CustomLoadEventHandler(FReport_LoadBaseReport); 

 3. Carga el informe que se herede:

report.Load("InheritReport.frx"); 

4. Elimine CustomLoadEventHandler:

report.LoadBaseReport -= new CustomLoadEventHandler(FReport_LoadBaseReport); 

5. Ahora puede mostrar el informe o abrirlo en el diseñador. Contiene el informe que se hereda y el que hereda el informe básico:

report.Show(); 

También tiene que crear un evento para cargar el informe básico:

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"); 
} 

Y el código completo:

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");
 }
 }

Si desea cargar un informe de la base de datos, remplace el método Load() por LoadFromString().

 


¿Cómo invocar la función JavaScript al hacer clic en un hipervínculo dentro de un informe en ASP .NET?

Puede escribir un código JS en el objeto TextObject.Huperlink object(javascript:alert('¡Ha hecho un clic!!')).

O escribir la función en el fichero *.aspx(cshtml):

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> 

 Y invocar la función:
TextObject1.Hyperlink = "javascript:count_rabbits()";


¿Cómo eliminar la pestaña CODE para usarios finales?

Añada el control EnvironmentSettings a tu formulario.

A continuación, antes de la invocación de report.Design(), añada la siguiente línea:

environmentSettings1.DesignerSettings.Restrictions.DontEditCode = true;

¿Cómo utilizar controles FastReport .NET en una aplicación WPF?

Debería utilizar el control WindowsFormsHost:

0) Añada hipervínculo a FastReport.dll;

1) Añada atributo en la etiqueta Window(Page): 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) Añada la etiqueta WindowsFormsHost en su marca XAML:

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

3) Añada etiqueta hijo en WindowsFormsHost:  <fr:PreviewControl></fr:PreviewControl> or <fr1:Designer></fr1:Designer>.

La marca completa se tiene que ver como este fragmento:

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);
¿Cómo crear una línea con campos en MSChartObject?

En MSChartObject debería crear el objeto básico para Series System.Windows.Forms.DataVisualization.Charting.Series y luego crear una línea allí. A continuación, debería asignar la serie creada para el objeto básico para MSChartObject (MSChart1.Chart.Series.Add(series); No se olvide añadir la biblioteca System.Windows.Forms.DataVisualization.dll (en el menú Informe -> Script) y el área de nombres System.Windows.Forms.DataVisualization.Charting.

Es un ejemplo de una línea con campos:

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.

¿Cómo desactivar ProgressForm a la hora de complicar informe?

Puede desactivar ProgressForm en 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
  • Comprar
  • Descargar
  • Documentación
  • Opiniones de usuarios
  • Cómo desinstalar nuestros productos
  • FAQ
  • Toturial en vídeo
  • Foro
  • Documentación técnica
  • Nuestras noticias
  • Quiénes somos
  • Socios
  • Extended licensing
  • Contactos

© 1998-2023 by Fast Reports Inc.

  • Privacidad