Esempio n. 1
0
        private void Exportar(string pfechad, string pfechah, string pProveedorID, string ptipo_mant)
        {
            String NombreXLS = "Reporte_Estadistico_TipoTrabajoxOficina_" + DateTime.Now.ToString();

            brExportReportes br = new brExportReportes();

            DataTable dt = br.ListarReporte_Estadistico_xTrabajoEntidad_Export(pfechad, pfechah, pProveedorID, ptipo_mant);

            string attachment = "attachment; filename=" + NombreXLS + ".xls";

            Response.Clear();
            Response.ClearHeaders();
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType     = "application/vnd.ms-excel";
            Response.ContentEncoding = Encoding.Default;
            Response.AddHeader("Cache-Control", "max-age=0");
            Response.Charset = "UTF-8";

            string html = "<table border='1' style='color:#556DA6';>";

            html = html + "<thead><tr>";
            html = html + "<th style='background-color:#EBEBE9;'>PROVEEDOR</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TIPO_MANTENIMIENTO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TRABAJOS x TIPO MANT</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TRABAJOS x ENTIDAD</th>";
            html = html + "<th style='background-color:#EBEBE9;'>%(TIPO/ENTIDAD)</th>";
            html = html + "</tr></thead><tbody>";

            if (dt.Rows.Count == 0)
            {
                html = html + "<tr>";
                html = html + "<td colspan='5'>No se encontraron registros</td></tr>";
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    html = html + "<tr>";
                    html = html + "<td>" + dt.Rows[i][0].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][1].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][2].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][3].ToString() + "</td>";
                    html = html + "<td style=\"mso-number-format:'Percent';\">" + dt.Rows[i][4].ToString() + "</td>";

                    html = html + "</tr>";
                }
            }

            html = html + "</tbody></table>";

            Response.Write(html);

            Response.End();
        }
Esempio n. 2
0
        private void Exportar(string pfechad, string pfechah, string pProveedorID, string pPersonalID)
        {
            String NombreXLS = "Reporte_Estadistico_HorasTrabxTecnico_" + DateTime.Now.ToString();

            brExportReportes br = new brExportReportes();

            DataTable dt = br.ListarReporte_Estadistico_HorasTrabxTecnico_Export(pfechad, pfechah, pProveedorID, pPersonalID);

            string attachment = "attachment; filename=" + NombreXLS + ".xls";

            Response.Clear();
            Response.ClearHeaders();
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType     = "application/vnd.ms-excel";
            Response.ContentEncoding = Encoding.Default;
            Response.AddHeader("Cache-Control", "max-age=0");
            Response.Charset = "UTF-8";

            string html = "<table border='1' style='color:#556DA6';>";

            html = html + "<thead><tr>";
            html = html + "<th style='background-color:#EBEBE9;'>PROVEEDOR</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TÉCNICO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>HORA(s)</th>";
            html = html + "<th style='background-color:#EBEBE9;'>MINUTO(s)</th>";
            html = html + "<th style='background-color:#EBEBE9;'>PORCENTAJE %</th>";
            html = html + "</tr></thead><tbody>";

            if (dt.Rows.Count == 0)
            {
                html = html + "<tr>";
                html = html + "<td colspan='5'>No se encontraron registros</td></tr>";
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    html = html + "<tr>";
                    html = html + "<td>" + dt.Rows[i][1].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][3].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][7].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][8].ToString() + "</td>";
                    html = html + "<td style=\"mso-number-format:'Percent';\">" + dt.Rows[i][6].ToString() + "</td>";

                    html = html + "</tr>";
                }
            }

            html = html + "</tbody></table>";

            Response.Write(html);

            Response.End();
        }
Esempio n. 3
0
        private void Exportar(string pfechad, string pfechah, string pPersonalID)
        {
            String NombreXLS = "Reporte_Estadistico_SalidasNoReportadas_" + DateTime.Now.ToString();

            brExportReportes br = new brExportReportes();

            DataTable dt = br.ListarReporte_Estadistico_SalidasNoReportadas_Export(pfechad, pfechah, pPersonalID);

            string attachment = "attachment; filename=" + NombreXLS + ".xls";

            Response.Clear();
            Response.ClearHeaders();
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType     = "application/vnd.ms-excel";
            Response.ContentEncoding = Encoding.Default;
            Response.AddHeader("Cache-Control", "max-age=0");
            Response.Charset = "UTF-8";

            string html = "<table border='1' style='color:#556DA6';>";

            html = html + "<thead><tr>";
            html = html + "<th style='background-color:#EBEBE9;'>PROVEEDOR</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TÉCNICO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TOTAL TRABAJOS x TÉCNICOS</th>";
            html = html + "<th style='background-color:#EBEBE9;'>SALIDAS NO REPORTADAS X TÉCNICOS</th>";
            html = html + "</tr></thead><tbody>";

            if (dt.Rows.Count == 0)
            {
                html = html + "<tr>";
                html = html + "<td colspan='4'>No se encontraron registros</td></tr>";
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    html = html + "<tr>";
                    html = html + "<td>" + dt.Rows[i][0].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][1].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][5].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][2].ToString() + "</td>";

                    html = html + "</tr>";
                }
            }

            html = html + "</tbody></table>";

            Response.Write(html);

            Response.End();
        }
Esempio n. 4
0
        private void Exportar(string pfechad, string pfechah, string pCSID)
        {
            String NombreXLS = "Reporte_FichaPorOficina_" + DateTime.Now.ToString();

            brExportReportes br = new brExportReportes();

            DataTable dt = br.ListarReporte_xOficinaEntidad_Export(pfechad, pfechah, pCSID);

            string attachment = "attachment; filename=" + NombreXLS + ".xls";

            Response.Clear();
            Response.ClearHeaders();
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType     = "application/vnd.ms-excel";
            Response.ContentEncoding = Encoding.Default;
            Response.AddHeader("Cache-Control", "max-age=0");
            Response.Charset = "UTF-8";

            string html = "<table border='1' style='color:#556DA6';>";

            html = html + "<thead><tr>";
            html = html + "<th style='background-color:#EBEBE9;'>FECHA</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TIPO_MANTENIMIENTO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>DISTRIBUIDOR</th>";
            html = html + "<th style='background-color:#EBEBE9;'>ABONADO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>OFICINA</th>";
            html = html + "<th style='background-color:#EBEBE9;'>PROVEEDOR</th>";
            html = html + "<th style='background-color:#EBEBE9;'>TÉCNICO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>USUARIO</th>";
            html = html + "<th style='background-color:#EBEBE9;'>OBSERVACIONES</th>";
            html = html + "</tr></thead><tbody>";

            if (dt.Rows.Count == 0)
            {
                html = html + "<tr>";
                html = html + "<td colspan='9'>No se encontraron registros</td></tr>";
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    html = html + "<tr>";
                    html = html + "<td style=\"mso-number-format:mm/dd/yyyy hh:mm:ss;\">" + dt.Rows[i][0].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][11].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][3].ToString() + "</td>";
                    html = html + "<td style=\"mso-number-format:'@';\">" + dt.Rows[i][4].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][5].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][7].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][9].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][10].ToString() + "</td>";
                    html = html + "<td>" + dt.Rows[i][12].ToString() + "</td>";

                    html = html + "</tr>";
                }
            }

            html = html + "</tbody></table>";

            Response.Write(html);

            Response.End();
        }