protected void Page_Load(object sender, EventArgs e)
 {
     if (!ValidarConexionYUsuarioLogueado(sender))
     {
         return;
     }
     if (Session["connectionString"] == null || Session["USER"] == null)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true);
         //Response.Redirect("Login.aspx");
     }
     else
     {
         if (!Page.IsPostBack)
         {
             GetProviderInventory();
         }
         try
         {
             if (Session["DSDISEÑO_PROVIDER_INVENTORY"] != null)
             {
                 var reporte = new Report.ReportProviderInventory
                 {
                     DataSource = Session["DATA_PROVIDER_INVENTORY"],
                     DataMember = "SWIFT_PROVIDER_INVENTORY"
                 };
                 ASPxDocumentViewer1.Report = reporte;
                 ASPxDocumentViewer1.DataBind();
             }
             if (Session["DATA_PROVIDER_INVENTORY"] != null)
             {
                 ASPxGridView1.DataSource = Session["DATA_PROVIDER_INVENTORY"];
                 ASPxGridView1.DataBind();
             }
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
         }
     }
 }
 public void ReportView()
 {
     try
     {
         if (Session["DATA_PROVIDER_INVENTORY"] != null)
         {
             var reporte = new Report.ReportProviderInventory
             {
                 DataSource = Session["DATA_PROVIDER_INVENTORY"],
                 DataMember = "SWIFT_PROVIDER_INVENTORY"
             };
             Session["DSDISEÑO_PROVIDER_INVENTORY"] = "true";
             ASPxDocumentViewer1.Report             = reporte;
             ASPxDocumentViewer1.DataBind();
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }