Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JasperReport


   *
   */
  public void fill() throws JRException
  {
    long start = System.currentTimeMillis();
    JasperReport subreport = (JasperReport)JRLoader.loadObjectFromLocation("build/reports/ProductReport.jasper");

    //Preparing parameters
    Map parameters = new HashMap();
    parameters.put("ProductsSubreport", subreport);
   
View Full Code Here


         
        case XLS:
          contentType = "application/xls";
          fileExt = "xls";

          JasperReport report = JasperCompileManager.compileReport(reportsDirectoryPath + reportFileName + ".jrxml");
          JasperPrint print = JasperFillManager.fillReport(report, params, conn);

          JRXlsExporter exporter = new JRXlsExporter();

          exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
View Full Code Here

        * 1. Load report input
        *    + sPathFileInput: Đường dẫn tới file report design trong folder src/pos/reports
        *    + JasperReport  : Chứa report design
        *    + JasperPrint   : Đổ dữ liệu vào report
        */
       JasperReport jasperReport;
     JasperPrint  jasperPrint;            
     Connection conn= (Connection)openConnection();    
     String sPathFileOutput = "";   
     String sPathFileInput="../../reports/"+inpReportName;      
         JasperDesign design = null;
View Full Code Here

        byte[] output;
        JasperPrint jasperPrint;

        // Fill the report and produce a print object
        try {
            JasperReport jasperReport = (JasperReport) JRLoader.loadObject(systemId);
            if (conn == null)
                jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, stackDataSource);
            else
                jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
        } catch (JRException e) {
View Full Code Here

        try {
            String datasourceName = delegator.getEntityHelperName(info);
            InputStream is = context.getResourceAsStream(page);
            Map parameters = UtilHttp.getParameterMap(request);

            JasperReport report = JasperCompileManager.compileReport(is);

            response.setContentType("text/xml");

            PipedOutputStream fillToPrintOutputStream = new PipedOutputStream();
            PipedInputStream fillToPrintInputStream = new PipedInputStream(fillToPrintOutputStream);
View Full Code Here

        if (delegator == null) {
            throw new ViewHandlerException("The delegator object was null, how did that happen?");
        }

        try {
            JasperReport report = (JasperReport) jasperReportsCompiledCache.get(page);
            if (report == null) {
                synchronized (this) {
                    report = (JasperReport) jasperReportsCompiledCache.get(page);
                    if (report == null) {
                        InputStream is = context.getResourceAsStream(page);
View Full Code Here

        if (delegator == null) {
            throw new ViewHandlerException("The delegator object was null, how did that happen?");
        }

        try {
            JasperReport report = (JasperReport) jasperReportsCompiledCache.get(page);
            if (report == null) {
                synchronized (this) {
                    report = (JasperReport) jasperReportsCompiledCache.get(page);
                    if (report == null) {
                        InputStream is = context.getResourceAsStream(page);
View Full Code Here

        if (delegator == null) {
            throw new ViewHandlerException("The delegator object was null, how did that happen?");
        }

        try {
            JasperReport report = (JasperReport) jasperReportsCompiledCache.get(page);
            if (report == null) {
                synchronized (this) {
                    report = (JasperReport) jasperReportsCompiledCache.get(page);
                    if (report == null) {
                        InputStream is = context.getResourceAsStream(page);
View Full Code Here

   
    ReportDataSource dataSource = report.getDataSource();

    try
    {
      JasperReport jr = null;

      if (report.isQueryReport()) return fillQueryReport(report, parameters, input.getExportType());

      jr = (JasperReport) JRLoader
          .loadObject(directoryProvider.getReportDirectory() + report.getFile());

      List<ReportParameterMap> subReports = report.getSubReportParameters();
      if (subReports != null && subReports.size() > 0)
      {
        Iterator<ReportParameterMap> iterator = report.getSubReportParameters().iterator();
        while (iterator.hasNext())
        {
          ReportParameterMap rpMap = iterator.next();

          JasperReport subReport = (JasperReport) JRLoader.loadObject(directoryProvider
              .getReportDirectory()
              + rpMap.getReportParameter().getData());

          parameters.put(rpMap.getReportParameter().getName(), subReport);
        }
View Full Code Here

    }

    if (exportType == ExportType.PDF) jasperDesign.setColumnHeader(bandHeader);
    jasperDesign.setDetail(bandDetail);
   
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters,
        new JRBeanCollectionDataSource(results));

    return jasperPrint;
 
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JasperReport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.