日期:2014-05-17 浏览次数:20821 次
/*
* To change this template, choose Tools
------解决方案--------------------
Templates
* and open the template in the editor.
*/
package com.bitsperu.academia.reporte;
import com.bitsperu.academia.utilidades.DAO.DAO;
import java.io.IOException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.sql.Connection;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.util.JRLoader;
/**
*
* @author carlos
*/
public class Matricula extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("application/pdf");
ServletOutputStream out = response.getOutputStream();
Connection cn = DAO.getConexion();
try {
JasperReport reporte = (JasperReport) JRLoader.loadObject(getServletContext().getRealPath("app/matricula/matricula_byid.jasper"));
Map parametros = new HashMap();
parametros.put("id",