protected void Page_Load(object sender, EventArgs e) { string idimpresora = Server.HtmlEncode(Request.QueryString["idimpresora"]); string usuario = ""; string departamento = ""; string telefono = ""; string marca = ""; string serial = ""; string numero = ""; string nombre = ""; string modelo = ""; string tipo = ""; string observaciones = ""; DBConnect conector = new DBConnect(); DataTable listado = conector.SVImpresoras(idimpresora); if (listado.Rows.Count > 0) { usuario = listado.Rows[0]["responsable"].ToString(); departamento = listado.Rows[0]["departamento"].ToString(); marca = listado.Rows[0]["marca"].ToString(); serial = listado.Rows[0]["serial"].ToString(); numero = listado.Rows[0]["numero"].ToString(); nombre = listado.Rows[0]["nombre"].ToString(); modelo = listado.Rows[0]["modelo"].ToString(); tipo = listado.Rows[0]["htdispositivo"].ToString(); observaciones = listado.Rows[0]["observaciones"].ToString(); } Response.ContentType = "application/pdf"; sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezadorptinv.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); sharpPDF.pdfPage myFirstPage = myDoc.addPage(); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 50, 700); //Titulo de reporte myFirstPage.addText("PLANILLA DE INVENTARIO DE EQUIPOS DE COMPUTACION", 60, 670, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12); //Datos Basicos myFirstPage.drawRectangle(40, 660, 562, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(40, 660, 562, 645, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.addText("1. Datos Básicos del Equipo", 45, 647, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(40, 645, 214, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(214, 645, 388, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(388, 645, 562, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.addText("1.1 Usuario Responsable", 45, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.2 Departamento al cual pertenece", 219, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.3 Telefono", 393, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(40, 630, 214, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(214, 630, 388, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(388, 630, 562, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(usuario, 45, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(departamento, 219, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Telefono", 393, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.drawRectangle(40, 615, 170, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(170, 615, 300, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(300, 615, 430, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(430, 615, 562, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.addText("1.4 Nombre del Equipo", 45, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.5 Marca del Equipo", 175, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.6 Serial del Equipo", 305, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.7 Numero BE", 435, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(40, 600, 170, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(170, 600, 300, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(300, 600, 430, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(430, 600, 562, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(nombre, 45, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(marca, 175, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(serial, 305, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(numero, 435, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.drawRectangle(40, 575, 562, 560, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(40, 560, 562, 545, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.8 Tipo de Impresora", 45, 562, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(tipo, 45, 547, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.drawRectangle(40, 545, 562, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(40, 530, 562, 500, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("1.9 Observaciones", 45, 532, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(observaciones, 45, 502, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 10, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage = null; myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { string id = Server.HtmlEncode(Request.QueryString["id"]); string serial = Server.HtmlEncode(Request.QueryString["serial"]); string fecha = ""; string departamento = ""; string solicitante = ""; string sa = ""; string ss = ""; string so = ""; string app = ""; string win = ""; string off = ""; string otr = ""; string observacioness = ""; string scpu = ""; string impresora = ""; string monitor = ""; string teclado = ""; string mouse = ""; string regulador = ""; string conexionr = ""; string conexioni = ""; string switche = ""; string observacionesh = ""; DBConnect conector = new DBConnect(); DataTable listado = conector.SSolicitud(id); for (int i = 0; i < listado.Rows.Count; i++) { ListItem opcion = new ListItem(); fecha = listado.Rows[i][1].ToString(); departamento = listado.Rows[i][2].ToString(); solicitante = listado.Rows[i][3].ToString(); sa = listado.Rows[i][4].ToString(); ss = listado.Rows[i][5].ToString(); so = listado.Rows[i][6].ToString(); app = listado.Rows[i][7].ToString(); win = listado.Rows[i][8].ToString(); off = listado.Rows[i][9].ToString(); otr = listado.Rows[i][10].ToString(); observacioness = listado.Rows[i][11].ToString(); scpu = listado.Rows[i][12].ToString(); impresora = listado.Rows[i][13].ToString(); monitor = listado.Rows[i][14].ToString(); teclado = listado.Rows[i][15].ToString(); mouse = listado.Rows[i][16].ToString(); regulador = listado.Rows[i][17].ToString(); conexionr = listado.Rows[i][18].ToString(); conexioni = listado.Rows[i][19].ToString(); observacionesh = listado.Rows[i][20].ToString(); switche = listado.Rows[i][21].ToString(); } Response.ContentType = "application/pdf"; //System.Web.HttpContext.Current.Server.MapPath sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezadorpt.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); /*Table's creation*/ sharpPDF.pdfPage myFirstPage = myDoc.addPage(); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 60; myTable.coordY = 640; myTable.tableHeader.addColumn(100); myTable.tableHeader.addColumn(210); myTable.tableHeader.addColumn(67); myTable.tableHeader.addColumn(115); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 50, 700); myFirstPage.addText("SOLICITUD DE SERVICIO", 60, 650, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 20); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); myRow[0].addText("Departamento:", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myRow[1].addText(departamento, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myRow[2].addText("Telefono:", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myRow[3].addText("0243-2721295", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myTable.addRow(myRow); myRow = null; myFirstPage.addTable(myTable, 600); sharpPDF.Tables.pdfTable myTable2 = new sharpPDF.Tables.pdfTable(myDoc); myTable2.borderSize = 1; myTable2.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable2.coordX = 60; myTable2.coordY = 617; myTable2.tableHeader.addColumn(146); myTable2.tableHeader.addColumn(164); myTable2.tableHeader.addColumn(49); myTable2.tableHeader.addColumn(133); sharpPDF.Tables.pdfTableRow myRow2 = myTable2.createRow(); myRow2[0].addText("Nombre del Solicitante:", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myRow2[1].addText(solicitante, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myRow2[2].addText("Fecha:", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myRow2[3].addText(fecha, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 12, new sharpPDF.pdfColor(0, 51, 153)); myTable2.addRow(myRow2); myRow2 = null; myFirstPage.addTable(myTable2, 600); myFirstPage.addText("Descripcion del Tipo de Falla", 60, 580, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12); myFirstPage.drawRectangle(60, 578, 552, 497, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Software", 65, 560, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); if (sa == "1") { myFirstPage.drawRectangle(65, 540, 75, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Sistemas Administrativos", 80, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(65, 540, 75, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Sistemas Administrativos", 80, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (ss == "1") { myFirstPage.drawRectangle(220, 540, 230, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Sistemas de Salud", 235, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(220, 540, 230, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Sistemas de Salud", 235, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (so == "1") { myFirstPage.drawRectangle(340, 540, 350, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Sistema Operativo", 355, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(340, 540, 350, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Sistema Operativo", 355, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (app == "1") { myFirstPage.drawRectangle(460, 540, 470, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Aplicaciones", 475, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(460, 540, 470, 550, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Aplicaciones", 475, 540, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (win == "1") { myFirstPage.drawRectangle(65, 520, 75, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Windows", 80, 520, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(65, 520, 75, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Windows", 80, 520, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (off == "1") { myFirstPage.drawRectangle(220, 520, 230, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Office", 235, 520, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(220, 520, 230, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Office", 235, 520, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (otr == "1") { myFirstPage.drawRectangle(340, 520, 350, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Otro", 355, 520, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(340, 520, 350, 530, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Otro", 355, 520, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } myFirstPage.addText(observacioness, 65, 500, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); /// hardware myFirstPage.drawRectangle(60, 497, 552, 409, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Hardware", 65, 477, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); if (scpu == "1") { myFirstPage.drawRectangle(65, 457, 75, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("C.P.U.", 80, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(65, 457, 75, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("C.P.U.", 80, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (impresora == "1") { myFirstPage.drawRectangle(220, 457, 230, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Impresora", 235, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(220, 457, 230, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Impresora", 235, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (monitor == "1") { myFirstPage.drawRectangle(340, 457, 350, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Monitor", 355, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(340, 457, 350, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Monitor", 355, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (teclado == "1") { myFirstPage.drawRectangle(460, 457, 470, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Teclado", 475, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(460, 457, 470, 467, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Teclado", 475, 457, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (mouse == "1") { myFirstPage.drawRectangle(65, 437, 75, 447, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Mouse", 80, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(65, 437, 75, 447, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Mouse", 80, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (regulador == "1") { myFirstPage.drawRectangle(220, 437, 230, 447, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Regulador", 235, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(220, 437, 230, 447, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Regulador", 235, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (conexionr == "1") { myFirstPage.drawRectangle(340, 437, 350, 447, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Conexion de Red", 355, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(340, 437, 350, 447, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Conexion de Red", 355, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (conexioni == "1") { myFirstPage.drawRectangle(65, 417, 75, 427, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Conexion de Internet", 80, 417, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(65, 417, 75, 427, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Conexion de Internet", 80, 417, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } if (switche == "1") { myFirstPage.drawRectangle(220, 417, 230, 427, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText("Switche de Red", 235, 417, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } else { myFirstPage.drawRectangle(220, 417, 230, 427, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Switche de Red", 235, 417, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); } myFirstPage.addText(observacioness, 220, 417, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("Datos del Servicio", 200, 395, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.drawRectangle(60, 390, 552, 320, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(276, 390, 552, 375, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Conforme Notificacion", 280, 377, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.drawRectangle(276, 375, 414, 360, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Firma Solicitante", 280, 362, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.drawRectangle(414, 375, 552, 360, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Firma Tecnico", 416, 362, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.drawRectangle(276, 360, 414, 320, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(414, 360, 552, 320, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("Fecha de notificacion al Tecnico:", 75, 375, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText(fecha, 90, 360, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 51, 153)); myTable = null; myFirstPage = null; myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { string fechainicio = Server.HtmlEncode(Request.QueryString["fechainicio"]); string fechafinal = Server.HtmlEncode(Request.QueryString["fechafinal"]); string dmyi = Server.HtmlEncode(Request.QueryString["dmyi"]); string dmyf = Server.HtmlEncode(Request.QueryString["dmyf"]); string departamento = Server.HtmlEncode(Request.QueryString["departamento"]); string departamentomay = departamento.ToUpper(); DBConnect conexion = new DBConnect(); DataTable DTrptpendiente = conexion.RPTDeppendiente(departamento, fechainicio, fechafinal); DataTable DTrptenrevision = conexion.RPTDepenrevision(departamento, fechainicio, fechafinal); DataTable DTrptculminado = conexion.RPTDepculminado(departamento, fechainicio, fechafinal); // Declaraciones de variables string rptString1 = "Solicitudes por:"; string rptString2 = "Pendiente"; string rptString3 = "En Revision"; string rptString4 = "Culminado"; string rptString5 = "Fallas Sistemas Administrativos"; string rptString6 = "Fallas Sistemas de Salud"; string rptString7 = "Fallas de Sistema Operativo"; string rptString8 = "Fallas en Aplicaciones"; string rptString9 = "Fallas de Windows"; string rptString10 = "Fallas del Office"; string rptString11 = "Otras"; string rptString12 = "Fallas de Impresora"; string rptString13 = "Fallas de Monitor"; string rptString14 = "Fallas de Teclado"; string rptString15 = "Fallas de Mouse"; string rptString16 = "Fallas de Regulador"; string rptString17 = "Fallas de Conexion de Red"; string rptString18 = "Fallas de Conexion de Internet"; string rptString19 = "Totales:"; string rptString20 = "Fallas de CPU (Hardware)"; string rptString21 = "Estatus de Actividades"; string sa_pend = ""; string ss_pend = ""; string sop_end = ""; string app_pend = ""; string win_pend = ""; string off_pend = ""; string otr_pend = ""; string cpu_pend = ""; string impresora_pend = ""; string monitor_pend = ""; string teclado_pend = ""; string mouse_pend = ""; string regulador_pend = ""; string conexionr_pend = ""; string conexioni_pend = ""; string total_pend = ""; string sa_enrev = ""; string ss_enrev = ""; string so_enrev = ""; string app_enrev = ""; string win_enrev = ""; string off_enrev = ""; string otr_enrev = ""; string cpu_enrev = ""; string impresora_enrev = ""; string monitor_enrev = ""; string teclado_enrev = ""; string mouse_enrev = ""; string regulador_enrev = ""; string conexionr_enrev = ""; string conexioni_enrev = ""; string total_enrev = ""; string sa_culm = ""; string ss_culm = ""; string so_culm = ""; string app_culm = ""; string win_culm = ""; string off_culm = ""; string otr_culm = ""; string cpu_culm = ""; string impresora_culm = ""; string monitor_culm = ""; string teclado_culm = ""; string mouse_culm = ""; string regulador_culm = ""; string conexionr_culm = ""; string conexioni_culm = ""; string total_culm = ""; // Fin Declaraciones //Asignacion de Valores sa_pend = DTrptpendiente.Rows[0]["sa"].ToString(); ss_pend = DTrptpendiente.Rows[0]["ss"].ToString(); sop_end = DTrptpendiente.Rows[0]["so"].ToString(); app_pend = DTrptpendiente.Rows[0]["app"].ToString(); win_pend = DTrptpendiente.Rows[0]["win"].ToString(); off_pend = DTrptpendiente.Rows[0]["off"].ToString(); otr_pend = DTrptpendiente.Rows[0]["otr"].ToString(); cpu_pend = DTrptpendiente.Rows[0]["cpu"].ToString(); impresora_pend = DTrptpendiente.Rows[0]["impresora"].ToString(); monitor_pend = DTrptpendiente.Rows[0]["monitor"].ToString(); teclado_pend = DTrptpendiente.Rows[0]["teclado"].ToString(); mouse_pend = DTrptpendiente.Rows[0]["mouse"].ToString(); regulador_pend = DTrptpendiente.Rows[0]["regulador"].ToString(); conexionr_pend = DTrptpendiente.Rows[0]["conexionr"].ToString(); conexioni_pend = DTrptpendiente.Rows[0]["conexioni"].ToString(); total_pend = DTrptpendiente.Rows[0]["total"].ToString(); sa_enrev = DTrptenrevision.Rows[0]["sa"].ToString(); ss_enrev = DTrptenrevision.Rows[0]["ss"].ToString(); so_enrev = DTrptenrevision.Rows[0]["so"].ToString(); app_enrev = DTrptenrevision.Rows[0]["app"].ToString(); win_enrev = DTrptenrevision.Rows[0]["win"].ToString(); off_enrev = DTrptenrevision.Rows[0]["off"].ToString(); otr_enrev = DTrptenrevision.Rows[0]["otr"].ToString(); cpu_enrev = DTrptenrevision.Rows[0]["cpu"].ToString(); impresora_enrev = DTrptenrevision.Rows[0]["impresora"].ToString(); monitor_enrev = DTrptenrevision.Rows[0]["monitor"].ToString(); teclado_enrev = DTrptenrevision.Rows[0]["teclado"].ToString(); mouse_enrev = DTrptenrevision.Rows[0]["mouse"].ToString(); regulador_enrev = DTrptenrevision.Rows[0]["regulador"].ToString(); conexionr_enrev = DTrptenrevision.Rows[0]["conexionr"].ToString(); conexioni_enrev = DTrptenrevision.Rows[0]["conexioni"].ToString(); total_enrev = DTrptenrevision.Rows[0]["total"].ToString(); sa_culm = DTrptculminado.Rows[0]["sa"].ToString(); ss_culm = DTrptculminado.Rows[0]["ss"].ToString(); so_culm = DTrptculminado.Rows[0]["so"].ToString(); app_culm = DTrptculminado.Rows[0]["app"].ToString(); win_culm = DTrptculminado.Rows[0]["win"].ToString(); off_culm = DTrptculminado.Rows[0]["off"].ToString(); otr_culm = DTrptculminado.Rows[0]["otr"].ToString(); cpu_culm = DTrptculminado.Rows[0]["cpu"].ToString(); impresora_culm = DTrptculminado.Rows[0]["impresora"].ToString(); monitor_culm = DTrptculminado.Rows[0]["monitor"].ToString(); teclado_culm = DTrptculminado.Rows[0]["teclado"].ToString(); mouse_culm = DTrptculminado.Rows[0]["mouse"].ToString(); regulador_culm = DTrptculminado.Rows[0]["regulador"].ToString(); conexionr_culm = DTrptculminado.Rows[0]["conexionr"].ToString(); conexioni_culm = DTrptculminado.Rows[0]["conexioni"].ToString(); total_culm = DTrptculminado.Rows[0]["total"].ToString(); //Fin de Asignaciones //Comienzo del Reporte Response.ContentType = "application/pdf"; sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezado.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); sharpPDF.pdfPage myFirstPage = myDoc.addPage(); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 50, 700); //Titulo de reporte myFirstPage.addText("ACTIVIDADES REALIZADAS PARA EL DEPARTAMENTO DE " + departamentomay, 50, 680, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12); myFirstPage.addText(" DURANTE EL PERIODO" + dmyi + " AL " + dmyf, 150, 665, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12); //+ Datos Basicos myFirstPage.drawRectangle(40, 660, 562, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(40, 660, 562, 645, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(40, 660, 262, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(262, 645, 362, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(362, 645, 462, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.drawRectangle(462, 645, 562, 630, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(128, 128, 128)); myFirstPage.addText(rptString21, 264, 647, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString1, 42, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString2, 264, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString3, 364, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString4, 464, 632, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(255, 255, 255)); //Sistemas Administrativos myFirstPage.drawRectangle(40, 630, 262, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 630, 362, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 630, 462, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 630, 562, 615, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString5, 42, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(sa_pend, 264, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(sa_enrev, 364, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(sa_culm, 464, 617, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Sistemas de Salud myFirstPage.drawRectangle(40, 615, 262, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 615, 362, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 615, 462, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 615, 562, 600, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString6, 42, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(ss_pend, 264, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(ss_enrev, 364, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(ss_culm, 464, 602, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Sistema Operativo myFirstPage.drawRectangle(40, 600, 262, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 600, 362, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 600, 462, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 600, 562, 585, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString7, 42, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(sop_end, 264, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(so_enrev, 364, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(so_culm, 464, 587, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Aplicaciones myFirstPage.drawRectangle(40, 585, 262, 570, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 585, 362, 570, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 585, 462, 570, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 585, 562, 570, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString8, 42, 572, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(app_pend, 264, 572, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(app_enrev, 364, 572, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(app_culm, 464, 572, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Windows myFirstPage.drawRectangle(40, 570, 262, 555, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 570, 362, 555, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 570, 462, 555, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 570, 562, 555, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString9, 42, 557, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(win_pend, 264, 557, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(win_enrev, 364, 557, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(win_culm, 464, 557, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Office myFirstPage.drawRectangle(40, 555, 262, 540, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 555, 362, 540, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 555, 462, 540, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 555, 562, 540, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString10, 42, 542, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(off_pend, 264, 542, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(off_enrev, 364, 542, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(off_culm, 464, 542, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Otras myFirstPage.drawRectangle(40, 540, 262, 525, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 540, 362, 525, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 540, 462, 525, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 540, 562, 525, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString11, 42, 527, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(otr_pend, 264, 527, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(otr_enrev, 364, 527, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(otr_culm, 464, 527, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Impresora myFirstPage.drawRectangle(40, 525, 262, 510, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 525, 362, 510, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 525, 462, 510, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 525, 562, 510, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString12, 42, 512, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(impresora_pend, 264, 512, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(impresora_enrev, 364, 512, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(impresora_culm, 464, 512, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Monitor myFirstPage.drawRectangle(40, 510, 262, 495, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 510, 362, 495, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 510, 462, 495, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 510, 562, 495, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString13, 42, 497, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(monitor_pend, 264, 497, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(monitor_enrev, 364, 497, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(monitor_culm, 464, 497, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Teclado myFirstPage.drawRectangle(40, 495, 262, 480, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 495, 362, 480, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 495, 462, 480, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 495, 562, 480, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString14, 42, 482, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(teclado_pend, 264, 482, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(teclado_enrev, 364, 482, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(teclado_culm, 464, 482, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Mouse myFirstPage.drawRectangle(40, 480, 262, 465, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 480, 362, 465, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 480, 462, 465, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 480, 562, 465, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString15, 42, 467, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(mouse_pend, 264, 467, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(mouse_enrev, 364, 467, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(mouse_culm, 464, 467, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Regulador myFirstPage.drawRectangle(40, 465, 262, 450, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 465, 362, 450, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 465, 462, 450, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 465, 562, 450, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString16, 42, 452, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(regulador_pend, 264, 452, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(regulador_enrev, 364, 452, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(regulador_culm, 464, 452, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Red myFirstPage.drawRectangle(40, 450, 262, 435, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 450, 362, 435, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 450, 462, 435, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 450, 562, 435, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString17, 42, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(conexionr_pend, 264, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(conexionr_enrev, 364, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(conexionr_culm, 464, 437, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Internet myFirstPage.drawRectangle(40, 435, 262, 420, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 435, 362, 420, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 435, 462, 420, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 435, 562, 420, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString18, 42, 422, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(conexioni_pend, 264, 422, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(conexioni_enrev, 364, 422, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(conexioni_culm, 464, 422, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //CPU myFirstPage.drawRectangle(40, 420, 262, 405, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 420, 362, 405, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 420, 462, 405, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 420, 562, 405, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString20, 42, 407, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(cpu_pend, 264, 407, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(cpu_enrev, 364, 407, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(cpu_culm, 464, 407, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); //Total myFirstPage.drawRectangle(40, 405, 262, 390, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(262, 405, 362, 390, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(362, 405, 462, 390, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.drawRectangle(462, 405, 562, 390, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText(rptString19, 42, 392, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(total_pend, 264, 392, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(total_enrev, 364, 392, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage.addText(total_culm, 464, 392, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12, new sharpPDF.pdfColor(0, 0, 0)); myFirstPage = null; myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { int mmm = 0; string menu = Server.HtmlEncode(Request.QueryString["menu"]); if (menu == "1") { mmm++; } else { Response.Redirect("../Default.aspx"); } DBConnect conexion = new DBConnect(); DataTable DTv6 = conexion.Sv6(); int rec = DTv6.Rows.Count; decimal d = rec / 25; int t = Convert.ToInt16(decimal.Round(d, 1)); int n = 0; Response.ContentType = "application/pdf"; //System.Web.HttpContext.Current.Server.MapPath sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezado.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); /*Table's creation*/ int k = 25; int i = 0; for (n = 0; n <= t; n++) { sharpPDF.pdfPage myFirstPage = myDoc.addPage(748, 1024); //sharpPDF.pdfPage myFirstPage = myDoc.addPage(210, 297); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 20; myTable.coordY = 600; myTable.tableHeader.addColumn(150); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 20, 690); myFirstPage.addText("FALLAS DE HARDWARE REPORTADAS Y SOLVENTADAS POR CADA DEPARTAMENTO", 80, 650, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 20); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); myRow[0].addText("DEPARTAMENTO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("CPU", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("CPUP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[3].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[4].addText("IMP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[5].addText("IMPP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[6].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[7].addText("MON", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[8].addText("MONP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[9].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[10].addText("TEC", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[11].addText("TECP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[12].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[13].addText("MOU", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[14].addText("MOUP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[15].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[16].addText("REG", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[17].addText("REGP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[18].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myTable.addRow(myRow); myRow = null; while (i < k) { if (i < rec) { sharpPDF.Tables.pdfTableRow myRow2 = myTable.createRow(); myRow2[0].addText(DTv6.Rows[i]["departamento"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[1].addText(DTv6.Rows[i]["cpurep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[2].addText(DTv6.Rows[i]["cpures"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[3].addText(DTv6.Rows[i]["cpup"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[4].addText(DTv6.Rows[i]["impresorarep"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[5].addText(DTv6.Rows[i]["impresorares"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[6].addText(DTv6.Rows[i]["impresorap"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[7].addText(DTv6.Rows[i]["monitorrep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[8].addText(DTv6.Rows[i]["monitorres"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[9].addText(DTv6.Rows[i]["cmonitor"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[10].addText(DTv6.Rows[i]["tecladorep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[11].addText(DTv6.Rows[i]["tecladores"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[12].addText(DTv6.Rows[i]["tecladop"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[13].addText(DTv6.Rows[i]["mouserep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[14].addText(DTv6.Rows[i]["mouseres"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[15].addText(DTv6.Rows[i]["mousep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[16].addText(DTv6.Rows[i]["reguladorrep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[17].addText(DTv6.Rows[i]["reguladorres"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[18].addText(DTv6.Rows[i]["reguladorp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myTable.addRow(myRow2); myRow2 = null; i++; } else { i++; } } myFirstPage.addTable(myTable, 600); myFirstPage.drawRectangle(20, 45, 990, 10, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("CPU = CPU Reportados", 30, 35, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("CPUP = Fallas de CPU resueltas", 30, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("IMP = Impresoras reportadas", 230, 35, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("IMPP = Fallas de Impresoras resueltas", 230, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("MON = Monitores Reportados", 430, 35, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("MONP = Fallas de Monitores Resueltas", 430, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("TEC = Teclados Reportados", 630, 35, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("TECP = Fallas de Teclados Resueltas", 630, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("MOU = Mouse Reportados", 780, 35, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("MOUP = Fallas de Mouse Resueltas", 780, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("REG = Reguladores Reportados", 30, 15, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("REP = Fallas de Mouse Resueltas", 230, 15, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myTable = null; myFirstPage = null; k = k + 25; } myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { string fechainicio = Server.HtmlEncode(Request.QueryString["fechainicio"]); string fechafinal = Server.HtmlEncode(Request.QueryString["fechafinal"]); string dmyi = Server.HtmlEncode(Request.QueryString["dmyi"]); string dmyf = Server.HtmlEncode(Request.QueryString["dmyf"]); string tipo = Server.HtmlEncode(Request.QueryString["tipo"]); string eq = ""; if (tipo == "1") { eq = "C.P.U"; } if (tipo == "2") { eq = "MONITOR"; } if (tipo == "3") { eq = "TECLADO"; } if (tipo == "4") { eq = "MOUSE"; } if (tipo == "5") { eq = "IMPRESORA"; } if (tipo == "6") { eq = "REGULADOR"; } if (tipo == "15") { eq = "SWITCHE"; } DBConnect conexion = new DBConnect(); DataTable DTrptAllequipos = conexion.RPTAllequipos(tipo, fechainicio, fechafinal); DataTable datos = new DataTable(); DataColumn columna1 = new DataColumn("Equipo"); DataColumn columna2 = new DataColumn("Pendiente"); DataColumn columna3 = new DataColumn("Revision"); DataColumn columna4 = new DataColumn("Culminado"); DataColumn columna5 = new DataColumn("Total"); columna1.AllowDBNull = true; columna2.AllowDBNull = true; columna3.AllowDBNull = true; columna4.AllowDBNull = true; columna5.AllowDBNull = true; datos.Columns.Add(columna1); datos.Columns.Add(columna2); datos.Columns.Add(columna3); datos.Columns.Add(columna4); datos.Columns.Add(columna5); int dd = 0; if (DTrptAllequipos.Rows.Count > 0) { for (dd = 0; dd < DTrptAllequipos.Rows.Count; dd++) { DataTable DTrptpendiente = conexion.RPTequipos(DTrptAllequipos.Rows[dd]["nequipo"].ToString(), tipo, "0", fechainicio, fechafinal); DataTable DTrptenrevision = conexion.RPTequipos(DTrptAllequipos.Rows[dd]["nequipo"].ToString(), tipo, "1", fechainicio, fechafinal); DataTable DTrptculminado = conexion.RPTequipos(DTrptAllequipos.Rows[dd]["nequipo"].ToString(), tipo, "2", fechainicio, fechafinal); DataRow dr = datos.NewRow(); dr["Equipo"] = DTrptAllequipos.Rows[dd]["nequipo"].ToString(); dr["Pendiente"] = DTrptpendiente.Rows[0]["count"].ToString(); dr["Revision"] = DTrptenrevision.Rows[0]["count"].ToString(); dr["Culminado"] = DTrptculminado.Rows[0]["count"].ToString(); dr["Total"] = DTrptAllequipos.Rows[dd]["count"].ToString(); datos.Rows.Add(dr); } } int rec = datos.Rows.Count; decimal d = rec / 25; int t = Convert.ToInt16(decimal.Round(d, 1)); int n = 0; Response.ContentType = "application/pdf"; sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezado.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); int k = 25; int i = 0; for (n = 0; n <= t; n++) { sharpPDF.pdfPage myFirstPage = myDoc.addPage(); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 20; myTable.coordY = 650; myTable.tableHeader.addColumn(150); myTable.tableHeader.addColumn(80); myTable.tableHeader.addColumn(80); myTable.tableHeader.addColumn(80); myTable.tableHeader.addColumn(80); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 50, 700); myFirstPage.addText("ACTIVIDADES REALIZADAS DURANTE EL PERIODO" + dmyi + " AL " + dmyf, 20, 680, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 12); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); myRow[0].addText("EQUIPOS (" + eq + ")", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.Black); myRow[1].addText("PENDIENTE", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.Black); myRow[2].addText("EN REVISION", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.Black); myRow[3].addText("CULMINADO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.Black); myRow[4].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.Black); myTable.addRow(myRow); myRow = null; while (i < k) { if (i < rec) { sharpPDF.Tables.pdfTableRow myRow2 = myTable.createRow(); myRow2[0].addText(datos.Rows[i]["Equipo"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 10, sharpPDF.pdfColor.Black); myRow2[1].addText(datos.Rows[i]["Pendiente"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 10, sharpPDF.pdfColor.Black); myRow2[2].addText(datos.Rows[i]["Revision"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 10, sharpPDF.pdfColor.Black); myRow2[3].addText(datos.Rows[i]["Culminado"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 10, sharpPDF.pdfColor.Black); myRow2[4].addText(datos.Rows[i]["Total"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 10, sharpPDF.pdfColor.Black); myTable.addRow(myRow2); myRow2 = null; i++; } else { i++; } } myFirstPage.addTable(myTable, 600); myTable = null; myFirstPage = null; k = k + 25; } myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { int mmm = 0; string menu = Server.HtmlEncode(Request.QueryString["menu"]); if (menu == "1") { mmm++; } else { Response.Redirect("../Default.aspx"); } DBConnect conexion = new DBConnect(); DataTable DTv9 = conexion.Sv9(); int rec = DTv9.Rows.Count; decimal d = rec / 25; int t = Convert.ToInt16(decimal.Round(d, 1)); int n = 0; Response.ContentType = "application/pdf"; //System.Web.HttpContext.Current.Server.MapPath sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezado.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); /*Table's creation*/ int k = 25; int i = 0; for (n = 0; n <= t; n++) { sharpPDF.pdfPage myFirstPage = myDoc.addPage(748, 1024); //sharpPDF.pdfPage myFirstPage = myDoc.addPage(210, 297); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 20; myTable.coordY = 600; myTable.tableHeader.addColumn(150); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(40); myTable.tableHeader.addColumn(60); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 20, 690); myFirstPage.addText("FALLAS DE SOFTWARE REPORTADAS Y SOLVENTADAS POR CADA DEPARTAMENTO", 80, 650, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 20); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); myRow[0].addText("DEPARTAMENTO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("SA", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("SAP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[3].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[4].addText("SS", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[5].addText("SSP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[6].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[7].addText("SO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[8].addText("SOP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[9].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[10].addText("AP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[11].addText("APP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[12].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[13].addText("WIN", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[14].addText("WINP", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[15].addText("%", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myTable.addRow(myRow); myRow = null; while (i < k) { if (i < rec) { sharpPDF.Tables.pdfTableRow myRow2 = myTable.createRow(); myRow2[0].addText(DTv9.Rows[i]["departamento"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[1].addText(DTv9.Rows[i]["sarep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[2].addText(DTv9.Rows[i]["saresp"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[3].addText(DTv9.Rows[i]["sap"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[4].addText(DTv9.Rows[i]["ssrep"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[5].addText(DTv9.Rows[i]["ssresp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[6].addText(DTv9.Rows[i]["ssp"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[7].addText(DTv9.Rows[i]["sorep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[8].addText(DTv9.Rows[i]["soresp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[9].addText(DTv9.Rows[i]["sop"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[10].addText(DTv9.Rows[i]["apprep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[11].addText(DTv9.Rows[i]["appresp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[12].addText(DTv9.Rows[i]["appp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[13].addText(DTv9.Rows[i]["winrep"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[14].addText(DTv9.Rows[i]["winresp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[15].addText(DTv9.Rows[i]["winp"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myTable.addRow(myRow2); myRow2 = null; i++; } else { i++; } } myFirstPage.addTable(myTable, 600); myFirstPage.drawRectangle(20, 55, 990, 20, new sharpPDF.pdfColor(0, 0, 0), new sharpPDF.pdfColor(255, 255, 255)); myFirstPage.addText("SA = Sistemas Administrativos", 30, 45, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("SAP = Fallas de Sistemas Administrativos Procesados", 30, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("SS = Sistemas de Salud", 230, 45, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("SSP = Fallas de Sistemas de Salud Procesados", 230, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("SO = Sistemas Operativos", 430, 45, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("SOP = Fallas de Sistemas Operativos Procesados", 430, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("AP = Aplicaciones", 630, 45, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("APP = Aplicaciones Procesadas", 630, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("WIN = Windows", 780, 45, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myFirstPage.addText("WINP = Fallas de Windows Procesadas", 780, 25, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 8, new sharpPDF.pdfColor(0, 51, 153)); myTable = null; myFirstPage = null; k = k + 25; } myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { string htipo = Server.HtmlEncode(Request.QueryString["htipo"]); string capacidad = Server.HtmlEncode(Request.QueryString["capacidad"]); string modelo = Server.HtmlEncode(Request.QueryString["modelo"]); DBConnect conexion = new DBConnect(); DataTable contar = new DataTable(); contar = conexion.SCountDisp(htipo, capacidad, modelo); int rec = contar.Rows.Count; decimal d = rec / 25; int t = Convert.ToInt16(decimal.Round(d, 1)); int n = 0; Response.ContentType = "application/pdf"; sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezado.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); /*Table's creation*/ int k = 25; int i = 0; for (n = 0; n <= t; n++) { sharpPDF.pdfPage myFirstPage = myDoc.addPage(); //sharpPDF.pdfPage myFirstPage = myDoc.addPage(748, 1024); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 50; myTable.coordY = 600; myTable.tableHeader.addColumn(150); myTable.tableHeader.addColumn(160); myTable.tableHeader.addColumn(100); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 20, 690); myFirstPage.addText("CANTIDAD DE DISPOSITIVOS EXISTENTES", 80, 650, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 20); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); if (htipo == "7") { myRow[0].addText("DISCO DURO TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("CAPACIDAD", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "8") { myRow[0].addText("TARJETA TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("MODELO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "9") { myRow[0].addText("MEMORIA TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("CAPACIDAD", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "10") { myRow[0].addText("PROCESADOR TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("MODELO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "11") { myRow[0].addText("TARJETA TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("MODELO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "12") { myRow[0].addText("TARJETA TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("MODELO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "14") { myRow[0].addText("TARJETA TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("MODELO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } if (htipo == "16") { myRow[0].addText("CDROM TIPO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("MODELO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("TOTAL", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); } myTable.addRow(myRow); myRow = null; while (i < k) { if (i < rec) { sharpPDF.Tables.pdfTableRow myRow2 = myTable.createRow(); myRow2[0].addText(contar.Rows[i]["dispositivo"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[1].addText(contar.Rows[i]["capacidad"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[2].addText(contar.Rows[i]["total"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myTable.addRow(myRow2); myRow2 = null; i++; } else { i++; } } myFirstPage.addTable(myTable, 600); myTable = null; myFirstPage = null; k = k + 25; } myDoc.createPDF(Response.OutputStream); myDoc = null; }
protected void Page_Load(object sender, EventArgs e) { string fechainicio = Server.HtmlEncode(Request.QueryString["fechainicio"]); string fechafinal = Server.HtmlEncode(Request.QueryString["fechafinal"]); int ts = Convert.ToInt16(Server.HtmlEncode(Request.QueryString["htipo"])); DBConnect conexion = new DBConnect(); DataTable DTv10 = conexion.Sv10(fechainicio, fechafinal); int rec = DTv10.Rows.Count; decimal d = rec / 25; int t = Convert.ToInt16(decimal.Round(d, 1)); int n = 0; Response.ContentType = "application/pdf"; //System.Web.HttpContext.Current.Server.MapPath sharpPDF.pdfDocument myDoc = new sharpPDF.pdfDocument("Sample Application", "Me", false); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/encabezado.gif"), "encabezado"); myDoc.addImageReference(System.Web.HttpContext.Current.Server.MapPath("../Imagenes/piedepagina.gif"), "pie"); /*Table's creation*/ if (ts == 1) { int k = 25; int i = 0; for (n = 0; n <= t; n++) { sharpPDF.pdfPage myFirstPage = myDoc.addPage(748, 1024); //sharpPDF.pdfPage myFirstPage = myDoc.addPage(210, 297); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 50; myTable.coordY = 600; myTable.tableHeader.addColumn(150); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(100); myTable.tableHeader.addColumn(70); myTable.tableHeader.addColumn(70); myTable.tableHeader.addColumn(80); myTable.tableHeader.addColumn(100); myTable.tableHeader.addColumn(110); myTable.tableHeader.addColumn(140); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 20, 690); myFirstPage.addText("ACTIVIDADES REALIZADAS HARDWARE", 80, 650, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 20); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); myRow[0].addText("SOPORTE TÉCNICO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("CPU", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("IMPRESORA", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[3].addText("MONITOR", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[4].addText("TECLADO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[5].addText("MOUSE", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[6].addText("REGULADOR", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[7].addText("CONEXION DE RED", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[8].addText("CONEXION DE INTERNET", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myTable.addRow(myRow); myRow = null; while (i < k) { if (i < rec) { sharpPDF.Tables.pdfTableRow myRow2 = myTable.createRow(); myRow2[0].addText(DTv10.Rows[i]["soporte"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[1].addText(DTv10.Rows[i]["cpu"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[2].addText(DTv10.Rows[i]["impresora"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[3].addText(DTv10.Rows[i]["monitor"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[4].addText(DTv10.Rows[i]["teclado"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[5].addText(DTv10.Rows[i]["mouse"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[6].addText(DTv10.Rows[i]["regulador"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[7].addText(DTv10.Rows[i]["conexionr"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[8].addText(DTv10.Rows[i]["conexioni"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myTable.addRow(myRow2); myRow2 = null; i++; } else { i++; } } myFirstPage.addTable(myTable, 600); myTable = null; myFirstPage = null; k = k + 25; } } if (ts == 2) { int k = 25; int i = 0; for (n = 0; n <= t; n++) { sharpPDF.pdfPage myFirstPage = myDoc.addPage(748, 1024); //sharpPDF.pdfPage myFirstPage = myDoc.addPage(210, 297); sharpPDF.Tables.pdfTable myTable = new sharpPDF.Tables.pdfTable(myDoc); myTable.borderSize = 1; myTable.borderColor = new sharpPDF.pdfColor(0, 0, 0); myTable.coordX = 50; myTable.coordY = 600; myTable.tableHeader.addColumn(150); myTable.tableHeader.addColumn(160); myTable.tableHeader.addColumn(145); myTable.tableHeader.addColumn(145); myTable.tableHeader.addColumn(115); myTable.tableHeader.addColumn(80); myTable.tableHeader.addColumn(60); myTable.tableHeader.addColumn(60); myFirstPage.addImage(myDoc.getImageReference("encabezado"), 20, 690); myFirstPage.addText("ACTIVIDADES REALIZADAS SOFTWARE", 80, 650, myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelvetica), 20); sharpPDF.Tables.pdfTableRow myRow = myTable.createRow(); myRow[0].addText("SOPORTE TÉCNICO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[1].addText("SISTEMAS ADMINISTRATIVOS", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[2].addText("SISTEMAS DE SALUD", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[3].addText("SISTEMA OPERATIVO", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[4].addText("APLICACIONES", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[5].addText("WINDOWS", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[6].addText("OFFICE", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myRow[7].addText("OTROS", myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csHelveticaBold), 10, sharpPDF.pdfColor.DarkBlue); myTable.addRow(myRow); myRow = null; while (i < k) { if (i < rec) { sharpPDF.Tables.pdfTableRow myRow2 = myTable.createRow(); myRow2[0].addText(DTv10.Rows[i]["soporte"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[1].addText(DTv10.Rows[i]["sa"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[2].addText(DTv10.Rows[i]["ss"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[3].addText(DTv10.Rows[i]["so"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[4].addText(DTv10.Rows[i]["app"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[5].addText(DTv10.Rows[i]["win"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[6].addText(DTv10.Rows[i]["off"].ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myRow2[7].addText(DTv10.Rows[i]["otr"].ToString().ToString(), myDoc.getFontReference(sharpPDF.Enumerators.predefinedFont.csCourier), 9, sharpPDF.pdfColor.Blue); myTable.addRow(myRow2); myRow2 = null; i++; } else { i++; } } myFirstPage.addTable(myTable, 600); myTable = null; myFirstPage = null; k = k + 25; } } myDoc.createPDF(Response.OutputStream); myDoc = null; }