Como instanciar un Criystal Report en aspx.net
Publicado por felipe (4 intervenciones) el 13/03/2009 05:20:41
Saludos, de antemano agradesco a quien pueda ayudarme y todos los que traten de hacerlo.
He estado tratando de crear un reporte con crystal report para una aplicacion web basandome en otros reportes que he hecho en aplicaciones windows y un articulo encontrado en internet bastante interesante.
http://www.elguille.info/colabora/puntoNET/ericeec_InformeConCrystalReportDataset.htm
en el momento en q voy a instanciar mi reporte ya creado para asignar el dataset tipado .Net no me reconoce el reporte.
miReporte objReporte = new miReporte();
no logro q reconosca "miReporte". TEngo instalado el framework para CrystalReports.
Espero pueda ayudarme.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;
using CrystalDecisions.ReportSource;
public partial class wfReporteFacturasPendientes : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection ObjConexion = new SqlConnection(ConfigurationManager.ConnectionStrings["MibasededatosConnectionString"].ConnectionString);
ObjConexion.Open();
SqlCommand objComando = new SqlCommand();
objComando.CommandType = CommandType.StoredProcedure;
objComando.CommandText = "rConsultarCliente";
objComando.Connection = ObjConexion;
objComando.ExecuteNonQuery();
SqlCommand objComando1 = new SqlCommand();
objComando1.CommandType = CommandType.StoredProcedure;
objComando1.CommandText = "rConsultarFacturas";
objComando1.Connection = ObjConexion;
objComando1.ExecuteNonQuery();
dsFacturasPendientes dsFP = new dsFacturasPendientes();
SqlDataAdapter da = new SqlDataAdapter(objComando);
SqlDataAdapter da1 = new SqlDataAdapter(objComando1);
da.Fill(dsFP.CLIENTES);
da1.Fill(dsFP.FACTURAS);
miReporte objReporte = new miReporte(); --->> //No logro q reconosca "miReporte"
objReporte .SetDataSource(dsFP);
crystalReportViewer1.ReportSource = objReporte;
}
}
He estado tratando de crear un reporte con crystal report para una aplicacion web basandome en otros reportes que he hecho en aplicaciones windows y un articulo encontrado en internet bastante interesante.
http://www.elguille.info/colabora/puntoNET/ericeec_InformeConCrystalReportDataset.htm
en el momento en q voy a instanciar mi reporte ya creado para asignar el dataset tipado .Net no me reconoce el reporte.
miReporte objReporte = new miReporte();
no logro q reconosca "miReporte". TEngo instalado el framework para CrystalReports.
Espero pueda ayudarme.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;
using CrystalDecisions.ReportSource;
public partial class wfReporteFacturasPendientes : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection ObjConexion = new SqlConnection(ConfigurationManager.ConnectionStrings["MibasededatosConnectionString"].ConnectionString);
ObjConexion.Open();
SqlCommand objComando = new SqlCommand();
objComando.CommandType = CommandType.StoredProcedure;
objComando.CommandText = "rConsultarCliente";
objComando.Connection = ObjConexion;
objComando.ExecuteNonQuery();
SqlCommand objComando1 = new SqlCommand();
objComando1.CommandType = CommandType.StoredProcedure;
objComando1.CommandText = "rConsultarFacturas";
objComando1.Connection = ObjConexion;
objComando1.ExecuteNonQuery();
dsFacturasPendientes dsFP = new dsFacturasPendientes();
SqlDataAdapter da = new SqlDataAdapter(objComando);
SqlDataAdapter da1 = new SqlDataAdapter(objComando1);
da.Fill(dsFP.CLIENTES);
da1.Fill(dsFP.FACTURAS);
miReporte objReporte = new miReporte(); --->> //No logro q reconosca "miReporte"
objReporte .SetDataSource(dsFP);
crystalReportViewer1.ReportSource = objReporte;
}
}
Valora esta pregunta


0