private void FrmKardexValorizado_Load(object sender, EventArgs e) { if (Tipo == "I") { Halley.Presentacion.CrystalReports.CrKardexInventario ObjCrCrGetVentasVendedor = new Halley.Presentacion.CrystalReports.CrKardexInventario(); ObjCrCrGetVentasVendedor.SetDataSource(Ds); CrvKardex.ReportSource = ObjCrCrGetVentasVendedor; //pasar datos directo al crystal reports TextObject txt; txt = (TextObject)ObjCrCrGetVentasVendedor.ReportDefinition.ReportObjects["TxtPeriodo"]; txt.Text = Titulo; CrvKardex.Refresh(); } else { Halley.Presentacion.CrystalReports.CrKardex ObjCrCrGetVentasVendedor = new Halley.Presentacion.CrystalReports.CrKardex(); ObjCrCrGetVentasVendedor.SetDataSource(Ds); CrvKardex.ReportSource = ObjCrCrGetVentasVendedor; //pasar datos directo al crystal reports TextObject txt; txt = (TextObject)ObjCrCrGetVentasVendedor.ReportDefinition.ReportObjects["TxtPeriodo"]; txt.Text = Titulo; CrvKardex.Refresh(); } }
private void GetKardexVenta(Int16 Accion) { try { DataSet Ds2 = new DataSet(); DataTable Dt = new DataTable("Logo"); Dt.Columns.Add("Logo", typeof(byte[])); Dt.Columns.Add("NomEmpresa", typeof(string)); Dt.Columns.Add("RUC", typeof(string)); Dt.Columns.Add("DomicilioFiscal", typeof(string)); DataRow Dr = Dt.NewRow(); // El campo productImage primero se almacena en un buffer DataRow[] customerRow = UTI_Datatables.DtEmpresas.Select("EmpresaID = '" + c1cboCia.SelectedValue.ToString() + "'"); if (customerRow[0]["Logo"] != DBNull.Value) { Dr["Logo"] = customerRow[0]["Logo"]; } else { Dr["Logo"] = DBNull.Value; } Dr["NomEmpresa"] = customerRow[0]["NomEmpresa"]; Dr["RUC"] = customerRow[0]["RUC"]; Dr["DomicilioFiscal"] = customerRow[0]["DomicilioFiscal"]; Dt.Rows.Add(Dr); Ds2.Tables.Add(Dt.Copy()); string Titulo; string Producto; Cursor = Cursors.WaitCursor; DtTemp = new CL_Kardex().getDTKardex_varios(ProductoId, c1cboCia.SelectedValue.ToString(), FecInicial, FecFinal, CboSede.SelectedValue.ToString(), Accion); DtTemp.TableName = "GetKardex4"; Halley.Presentacion.CrystalReports.CrRepKardex4 ObjCrCrRepKardex4 = new Halley.Presentacion.CrystalReports.CrRepKardex4(); Ds2.Tables.Add(DtTemp.Copy()); //pasar datos directo al crystal reports TextObject txt; Titulo = "SALIDAS DE INVENTARIOS POR PRODUCTOS DEL " + FecInicial.ToShortDateString() + " AL " + FecFinal.ToShortDateString(); txt = (TextObject)ObjCrCrRepKardex4.ReportDefinition.ReportObjects["TxtTitulo"]; txt.Text = Titulo; TextObject txt2; Producto = "PRODUCTO: " + cbProducto.Columns["Alias"].Value.ToString(); txt2 = (TextObject)ObjCrCrRepKardex4.ReportDefinition.ReportObjects["TxtProducto"]; txt2.Text = Producto; ObjCrCrRepKardex4.SetDataSource(Ds2); CrvKardex.ReportSource = ObjCrCrRepKardex4; CrvKardex.Refresh(); Cursor = Cursors.Default; } catch (Exception ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }