public void ReportView() { try { if (Session["DSsku"] != null) { var dsDiseño = new dsSKU(); var dsEjecucion = (DataSet)Session["DSsku"]; for (int i = 0; i < dsEjecucion.Tables[0].Rows.Count; i++) { var row = dsDiseño.SWIFT_SKU.NewRow(); row[0] = dsEjecucion.Tables[0].Rows[i]["CODE_SKU"]; row[1] = dsEjecucion.Tables[0].Rows[i]["DESCRIPTION_SKU"]; row[2] = dsEjecucion.Tables[0].Rows[i]["VALUE_TEXT_CLASSIFICATION"]; row[3] = dsEjecucion.Tables[0].Rows[i]["BARCODE_SKU"]; //row[4] = dsEjecucion.Tables[0].Rows[i]["CODE_FAMILY_SKU"]; /* ----------- */ row[4] = dsEjecucion.Tables[0].Rows[i]["NAME_PROVIDER"]; row[5] = dsEjecucion.Tables[0].Rows[i]["COST"]; row[6] = dsEjecucion.Tables[0].Rows[i]["CODE_FAMILY_SKU"]; row[7] = dsEjecucion.Tables[0].Rows[i]["HANDLE_DIMENSION"]; dsDiseño.SWIFT_SKU.Rows.Add(row); } //Session["DsDatos"] = dsDiseño; var reporte = new Report.ReportSKU { 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); } }
protected void Page_Load(object sender, EventArgs e) { if (ValidarConexionYUsuarioLogueado(sender)) { try { var reporte = new Report.ReportSKU { DataSource = Session["DSDISEÑO"] }; ASPxDocumentViewer1.Report = reporte; ASPxDocumentViewer1.DataBind(); Connection = Session["connectionString"].ToString(); _user = Session["USER"].ToString(); if (!Page.IsPostBack) { Session["dsUnidadesDeMedida"] = null; Session["DSsku"] = null; GetClassification(); GetFamily(); /* ------- */ GetMeasureUnit(); } if (Session["DSsku"] != null) { ASPxGridView1.DataSource = Session["DSsku"]; ASPxGridView1.DataBind(); } else { GetSku(); GetMeasureUnit(); } if (Session["dsProviderSKU"] != null) { var ds = (DataSet)Session["dsProviderSKU"]; var regionCombo = (ASPxGridView1.Columns["NAME_PROVIDER"] as GridViewDataComboBoxColumn); if (regionCombo != null) { regionCombo.PropertiesComboBox.DataSource = ds.Tables[0].DefaultView.ToTable(true, "NAME_PROVIDER"); regionCombo.PropertiesComboBox.ValueField = "NAME_PROVIDER"; regionCombo.PropertiesComboBox.TextField = "NAME_PROVIDER"; } ASPxComboBox2.DataSource = ds; ASPxComboBox2.ValueField = "PROVIDER"; ASPxComboBox2.TextField = "NAME_PROVIDER"; ASPxComboBox2.DataBind(); } else { GetProvider(); } //--------------------------------------------------------------------------------------------------------------- if (Session["dsCodeFamily"] != null) { var ds = (DataSet)Session["dsCodeFamily"]; ASPxCboFamSKU.DataSource = ds; ASPxCboFamSKU.ValueField = "CODE_FAMILY_SKU"; ASPxCboFamSKU.TextField = "DESCRIPTION_FAMILY_SKU"; ASPxCboFamSKU.DataBind(); } else { GetFamily(); } //--------------------------------------------------------------------------------------------------------------- if (Session["dsUnidadesDeMedida"] != null) { var ds = (DataSet)Session["dsUnidadesDeMedida"]; UiListaUnidadesDeMedida.DataSource = ds; UiListaUnidadesDeMedida.DataBind(); } else { GetPackUnit(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } } }