









Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Prepare-se para as provas
Estude fácil! Tem muito documento disponível na Docsity
Prepare-se para as provas com trabalhos de outros alunos como você, aqui na Docsity
Encontra documentos específicos para os exames da tua universidade
Prepare-se com as videoaulas e exercícios resolvidos criados a partir da grade da sua Universidade
Responda perguntas de provas passadas e avalie sua preparação.
Ganhe pontos para baixar
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Tecnologias usadas: - Ferramenta de modelagem: Astah Community Professional; - Linguagem de Programação: front-end em Java Swing e o back-end em Java; - Ambiente Integrado de Desenvolvimento: Netbeans 8.1; - Interface de programação de aplicações (API): iText 5.5.12; - Persistência de Dados: MySQL Workbench; - Servidor Independente de Plataforma: XAMPP Control Panel V3.2.2; - Backgrounds: CorelDRAW X7.
Tipologia: Notas de estudo
1 / 15
Esta página não é visível na pré-visualização
Não perca as partes importantes!










3 tabela.addCell("Estagiario"); 4 tabela.addCell("Estudante"); 5 tabela.addCell("RA"); 6 tabela.addCell("Data"); 7 tabela.addCell("Hora"); 8 tabela.addCell("Sala"); 9 // ---------------------------- PDF ------------------------------------ 10 // Este vector tabela vai guardar vários Vector de linha 11 Vector tabelaFZ = new Vector(); 12 13 while (Search.rs.next()) { 14 15 Vector linha = new Vector(); 16 17 linha.add(Search.rs.getString("Estagiario")); 18 linha.add(Search.rs.getString("Estudante")); 19 linha.add(Search.rs.getString("RA")); 20 linha.add(Search.rs.getString("Datta")); 21 linha.add(Search.rs.getString("Hora")); 22 linha.add(Search.rs.getString("Sala")); 23 tabelaFZ.add(linha); 24 25 // ---------------------------- PDF --------------------------- 26 tabela.addCell(Search.rs.getString("Estagiario")); 27 tabela.addCell(Search.rs.getString("Estudante")); 28 tabela.addCell(Search.rs.getString("RA")); 29 tabela.addCell(Search.rs.getString("Datta")); 30 tabela.addCell(Search.rs.getString("Hora")); 31 tabela.addCell(Search.rs.getString("Sala"));
1 public Vector Pesquisar1( String pesq, String tipoBusc) throws Exception { 2 // A classe Vector é um vetor mais dinâmico 3 4 Document doc = new Document(PageSize.A4, 10, 15, 15, 10); 5 6 this .conexao(); 7 8 // ----------------------------------- PDF ----------------------------- 9 PdfWriter.getInstance(doc, 10 new FileOutputStream("C:\Users\Sadrak_Silva\Desktop\SadrakSilva.pdf")); 11 doc.open(); 12 doc.add( new Paragraph("")); 13 doc.add( new Paragraph(" Rede Local de Ensino (RLE) ")); 14 Date dataSistema = new Date(); 15 SimpleDateFormat data = new SimpleDateFormat("dd/MM/yyyy"); 16 SimpleDateFormat hora = new SimpleDateFormat(" hh:mm:ss"); 17 doc.add( new Paragraph(" " +data.format( new Date()) + hora.format( new Date()))); 18 doc.add( new Paragraph("\n")); 19 20 21 PdfPTable tabela = new PdfPTable(7); // 7 -é o n° de colunas 22 PdfPCell cabecalho = new PdfPCell( 23 new Paragraph( " --- Relatório | Universidade Tecnológica Federal do Paraná ---")); 24 cabecalho.setHorizontalAlignment(Element.ALIGN_CENTER); 25 cabecalho.setBorder(PdfPCell.NO_BORDER); 26 cabecalho.setBackgroundColor( new BaseColor(100, 150, 200)); 27 cabecalho.setColspan(7); 28 tabela.addCell(cabecalho); 29 // adcionando rodapé no documento 30 31 // ---------------------------------------- PDF ------------------------------- 32 switch (tipoBusc) { 33 case "Nome": { 34 String url = "select * from Achados_e_Perdidos where Nome like '" + pesq + "%'"; 35 conectSQL(url); 36 break ; 37 }
112 SimpleDateFormat data = new SimpleDateFormat("dd/MM/yyyy"); 113 SimpleDateFormat hora = new SimpleDateFormat(" hh:mm:ss"); 114 doc.add( new Paragraph(" " +data.format( new Date()) + hora.format( new Date()))); 115 doc.add( new Paragraph("\n")); 116 117 118 PdfPTable tabela = new PdfPTable(7); // 7 -é o n° de colunas 119 PdfPCell cabecalho = new PdfPCell( 120 new Paragraph(" --- Relatório | Universidade Tecnológica Federal do Paraná ---")); 121 cabecalho.setHorizontalAlignment(Element.ALIGN_CENTER); 122 cabecalho.setBorder(PdfPCell.NO_BORDER); 123 cabecalho.setBackgroundColor( new BaseColor(100, 150, 200)); 124 cabecalho.setColspan(7); 125 tabela.addCell(cabecalho); 126 // adcionando rodapé no documento 127 128 // ---------------------------------------- PDF ------------------------------- 129 switch (tipoBusc) { 130 case "Estagiario": { 131 String url = "select * from Emprestimo where Estagiario " 132 + "like '" + pesq + "%'"; 133 conectSQL(url); 134 break ; 135 } 136 case "RA": { 137 String url = "select * from Emprestimo where RA like" 138 + " '" + pesq + "%'"; 139 conectSQL(url);; 140 break ; 141 } 142 case "Material": { 143 String url = "select * from Emprestimo where Material" 144 + " like '" + pesq + "%'"; 145 conectSQL(url); 146 break ; 147 } 148 case "DtEmprestimo": { 149 String url = "select * from Emprestimo where Encontrado " 150 + "like '" + pesq + "%'"; 151 conectSQL(url); 152 break ; 153 } 154 155 } 156 157 // ---------------------------- PDF ------------------------------------ 158 tabela.addCell("Estagiario"); 159 tabela.addCell("RA"); 160 tabela.addCell("Data de Emprestimo"); 161 tabela.addCell("Requerente"); 162 tabela.addCell("Hierarquia"); 163 tabela.addCell("Horário"); 164 tabela.addCell("Material"); 165 // ---------------------------- PDF ------------------------------------ 166 167 Vector tabelaFY = new Vector();// Este vector tabela vai guardar varios Vector de linha 168 169 while (Search.rs.next()) { 170 171 Vector linha = new Vector(); 172 173 linha.add(Search.rs.getString("Estagiario")); 174 linha.add(Search.rs.getString("RA")); 175 linha.add(Search.rs.getString("DtEmprestimo")); 176 linha.add(Search.rs.getString("Requerente")); 177 linha.add(Search.rs.getString("Hierarquia")); 178 linha.add(Search.rs.getString("Horario")); 179 linha.add(Search.rs.getString("Material")); 180 tabelaFY.add(linha); 181 182 // ---------------------------- PDF ------------------------------------ 183 tabela.addCell(Search.rs.getString("Estagiario")); 184 tabela.addCell(Search.rs.getString("RA")); 185 tabela.addCell(Search.rs.getString("DtEmprestimo")); 186 tabela.addCell(Search.rs.getString("Requerente")); 187 tabela.addCell(Search.rs.getString("Hierarquia"));
188 tabela.addCell(Search.rs.getString("Horario")); 189 tabela.addCell(Search.rs.getString("Material")); 190 191 } 192 193 doc.add(tabela); 194 195 doc.close(); 196 197 // ---------------------------- PDF ------------------------------------ 198 return tabelaFY; 199 } 200 CONCLUSÃO