Académique Documents
Professionnel Documents
Culture Documents
htm
Todos los tutoriales de C # Crystal Reports en este sitio web se basan en la siguiente
base de datos: crystaldb. Antes de comenzar esta sección, eche un vistazo a la estructura
de la base de datos de crystaldb. Haga clic aquí :
En los sgts graficos se puede mostrar algunos archivos para las tablas
- Crystal Reports tutorial
Si es nuevo en Crystal Reports y no sabe cómo crear Crystal Reports desde C #, eche
un vistazo a la sección de tutorial paso a paso para crear Crystal Reports desde C # .
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-db.htm
Haga clic en siguiente, luego la pantalla muestra los valores de la propiedad OLE DB,
déjelo como está, y luego haga clic en el botón de finalizar.
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-db.htm
En la lista de tablas, haga doble clic en la tabla Producto y verá que la tabla Producto
aparecerá en la lista de la derecha.
Seleccione todos los campos de la tabla Producto en la lista del lado derecho.
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-db.htm
Haga clic en el botón Finalizar. Luego puede ver la ventana del diseñador Crystal
Reports en su proyecto C #. En la ventana del diseñador de Crystal Reports, puede ver
los campos seleccionados de la tabla Producto. Puede organizar el campo Objetos y el
diseño de la pantalla según sus requisitos. Después de eso, su pantalla se verá como la
siguiente imagen.
utilizando CrystalDecisions.CrystalReports.Engine;
NOTAS:
cryRpt.Load (PONGA LA RUTA DEL INFORME CRISTAL AQUÍ \\
CrystalReport1.rpt ");
La ruta del archivo de Crystal Reports en su ubicación del archivo de proyecto C #, allí
puede ver CrystalReport1.rpt. Así que proporcione el nombre de ruta completo del
archivo de Crystal Reports como c: \ projects \ crystalreports \ CrystalReport1.rpt
En la sección anterior, recibimos el informe de todos los pedidos de todos los clientes,
es decir, todos los pedidos realizados por todos los clientes. En esta sección, sacamos el
informe del cliente seleccionado solo pasando el nombre del Cliente como argumento.
Espero que entiendas bien la sección anterior, si no, haz clic aquí C # Crystal Reports de
varias tablas .
Complete el nombre apropiado para los campos de texto Indicar e indicar como la
siguiente imagen.
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-db.htm
Para crear una fórmula de selección, haga clic con el botón derecho en la ventana del
diseñador de Crystal Reports, seleccione INFORMAR -> FORMULARIO DE
SELECCIÓN -> GRABAR .
Ahora puede ver la pantalla del Editor de fórmulas de selección de registros. Para crear
una fórmula de selección, debe seleccionar los campos de la lista de campos de arriba y
hacer la fórmula.
Puede cerrar la pantalla del Editor de fórmulas de selección después de crear la fórmula
de selección.
http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-db.htm
utilizando CrystalDecisions.CrystalReports.Engine;
usando CrystalDecisions.Shared;
If you are new to Crystal Reports and do not know how to create
Crystal Reports from C# , please take a look at the section step by
step tutorial for creating a Crystal Reports from C#.
parameter and show all the orders of that customer to the Crystal
Reports.
In the previous section we are getting the report of all orders from all
customers , that is , all orders placed by all customers . In this
section we pull out the selected customer report only by passing
Customer name as argument.
Hope you understand the previous section well, if not, please click
here C# Crystal Reports from multiple tables.
Then you can see Field Explorer in the Left hand side.
Fill the appropriate name for Name and Prompting text fields like the
following picture.
Now you can see the record Selection Formula Editor Screen. For
creating selection formula , you have to select the fields from above
field list and make the formula .
Form the following picture you can understand how to select fields.
You can close Selection Formula Editor screen after creating selection
formula.
Now the designing part is over and the next step is to call the Crystal
Reports in C# and view it in Crystal Reports Viewer control .
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
Copy and paste the following source code and run your C# project
using System;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
ParameterFieldDefinitions crParameterFieldDefinitions ;
ParameterFieldDefinition crParameterFieldDefinition ;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new
ParameterDiscreteValue();
crParameterDiscreteValue.Value = textBox1.Text;
crParameterFieldDefinitions =
cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition =
crParameterFieldDefinitions["Customername"];
crParameterValues =
crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
}
}
}
NOTE :
cryRpt.Load(PUT CRYSTAL REPORT PATH HERE\\CrystalReport1.rpt");
La ruta del archivo de Crystal Reports en su ubicación de archivos del proyecto C #, allí
puede ver CrystalReport1.rpt. Así que proporcione el nombre de ruta completo del
archivo de Crystal Reports como c: \ projects \ crystalreports \ CrystalReport1.rpt