Ver Mensaje Individual
  #11 (permalink)  
Antiguo 23/01/2011, 21:43
Avatar de Dradi7
Dradi7
 
Fecha de Ingreso: junio-2008
Ubicación: Peru - Lima
Mensajes: 1.518
Antigüedad: 15 años, 11 meses
Puntos: 220
Respuesta: dataset para reporte por código?

Haber si pruebas con este codigo es que primero debes hacer esto:
creas el reporte

Código C#:
Ver original
  1. Con = new SqlConnection(CONNECTION);
  2.                 Com = new SqlCommand();
  3.                 rep = new crReporte();          // Nombre de tu Crystal Report
  4.                 Dt= new DataTable();            //Nombre de tu Data Table
  5.  
  6.                 Con.Open();
  7.  
  8.                 Com.Connection = Con;
  9.                 Com.CommandType = CommandType.Text;
  10.                 Com.CommandText = "Select * From ReporteOrder Where OrderID = @ID";
  11.                 Com.Parameters.Add(new SqlParameter("@ID", SqlDbType.Int, 4)).Value = ID;
  12.  
  13.                 Adp = new SqlDataAdapter();
  14.                 Adp.SelectCommand = Com;
  15.                 Adp.Fill(Dt);
  16.                 rep.SetDataSource(Dt); // Enlazando el Crystal Report con la Data Obtenida          
  17.                 crvReporte.ReportSource = rep;  // Enlazando el Crystal Report con el Crystal Report Viewer
__________________
La clave de todo triunfador es eliminar todas sus excusas y sus limitaciones