protected void Page_Load(object sender, EventArgs e) { if (!ValidarConexionYUsuarioLogueado(sender)) { return; } try { var reporte = new Report.ReportVehicles { DataSource = Session["DSDISEÑO"] }; ASPxDocumentViewer1.Report = reporte; ASPxDocumentViewer1.DataBind(); Connection = Session["connectionString"].ToString(); _user = Session["USER"].ToString(); GetVehicles(); GetClassification(); UiVistaVendedoresAsociados.DataSource = VendedoresAsociados; UiVistaVendedoresAsociados.DataBind(); UiUsuariosNOAsociados.DataSource = VendedoresNoAsociados; UiUsuariosNOAsociados.DataBind(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
public void ReportView() { try { if (Session["DsDatos"] != null) { var dsDiseño = new dsVehicles(); var dsEjecucion = (DataSet)Session["DsDatos"]; for (var i = 0; i < dsEjecucion.Tables[0].Rows.Count; i++) { var row = dsDiseño.SWIFT_VEHICLES.NewRow(); row[0] = dsEjecucion.Tables[0].Rows[i]["VEHICLE"]; row[1] = dsEjecucion.Tables[0].Rows[i]["CODE_VEHICLE"]; row[2] = dsEjecucion.Tables[0].Rows[i]["PLATE_VEHICLE"]; row[3] = dsEjecucion.Tables[0].Rows[i]["VALUE_TEXT_CLASSIFICATION"]; row[4] = dsEjecucion.Tables[0].Rows[i]["MAXIMUM_WEIGHT"] + " " + dsEjecucion.Tables[0].Rows[i]["UNIT"]; row[5] = dsEjecucion.Tables[0].Rows[i]["BRAND"]; row[6] = dsEjecucion.Tables[0].Rows[i]["UNIT"]; dsDiseño.SWIFT_VEHICLES.Rows.Add(row); } Session["DsDatos"] = dsDiseño; var reporte = new Report.ReportVehicles { DataSource = dsDiseño }; Session["DSDISEÑO"] = dsDiseño; ASPxDocumentViewer1.Report = reporte; ASPxDocumentViewer1.DataBind(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }