示例#1
0
        public static void exportarReporte(ReportClass pReporte,
                                           string pNombre,
                                           string pFormula,
                                           ExportFormatType pFormato)
        {
            try
            {
                PrincipalUI.cursorEnEspera();
                ConnectionInfo connInfo = obtenerConexionReporte();
                SetDBLogonForReport(connInfo, pReporte);
                SetDBLogonForSubreports(connInfo, pReporte);
                if (pFormula != null)
                {
                    pReporte.RecordSelectionFormula = pFormula;
                }
                string ruta = System.IO.Path.GetTempPath() +
                              pNombre +
                              DateTime.Now.Ticks +
                              obtenerExtensionReporte(pFormato.ToString());

                pReporte.ExportToDisk(pFormato, ruta);
                pReporte.Load(ruta);
                pReporte.Close();
                Process.Start(ruta);
            }
            catch (Exception ex)
            {
                Mensajes.mensajeError(ex);
            }
            PrincipalUI.cursorPredeterminado();
        }
示例#2
0
 void iniciarSesion(string usuario, string pass)
 {
     try
     {
         List <string> list = new List <string>();
         list.Add(usuario);
         list.Add(pass);
         if (iniciarSesion(list))
         {
             PrincipalUI principalUI = new PrincipalUI();
             principalUI.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Error");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error" + ex.Message);
     }
 }