/**
* OpenCPS is the open source Core Public Services software
* Copyright (C) 2016-present OpenCPS community

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/

package org.opencps.jasperreport.util;


/**
 * @author trungnt
 *
 */
public class JRReportUtil {

}


@@ -784,67 +784,1405 @@
 l;%0A%0A
-%0A/**%0A * @author trungnt%0A *%0A */%0Apublic class JRReportUtil %7B%0A
+import java.util.Map;%0A%0Aimport org.opencps.jasperreport.compile.JRReportTemplate;%0Aimport org.opencps.jasperreport.datasource.JRJSONDataSource;%0A%0Aimport com.liferay.portal.kernel.log.Log;%0Aimport com.liferay.portal.kernel.log.LogFactoryUtil;%0Aimport com.liferay.portal.kernel.util.StringPool;%0A%0Aimport net.sf.jasperreports.engine.JRException;%0Aimport net.sf.jasperreports.engine.JasperExportManager;%0Aimport net.sf.jasperreports.engine.JasperFillManager;%0Aimport net.sf.jasperreports.engine.JasperPrint;%0A%0A/**%0A * @author trungnt%0A *%0A */%0Apublic class JRReportUtil %7B%0A%0A%09public static JasperPrint getJasperPrint(%0A%09    JRReportTemplate jrReportTemplate, Map%3CString, Object%3E parameters,%0A%09    JRJSONDataSource dataSource) %7B%0A%0A%09%09JasperPrint jasperPrint = null;%0A%09%09try %7B%0A%09%09%09jasperPrint = JasperFillManager%0A%09%09%09    .fillReport(jrReportTemplate, null, dataSource);%0A%0A%09%09%7D%0A%09%09catch (Exception e) %7B%0A%09%09%09_log%0A%09%09%09    .error(e);%0A%09%09%7D%0A%09%09return jasperPrint;%0A%09%7D%0A%09%0A%09public static String exportReportToPdfFile(%0A%09    JasperPrint jasperPrint, String outputDestination, String exportName) %7B%0A%0A%09%09try %7B%0A%09%09%09JasperExportManager%0A%09%09%09    .exportReportToPdfFile(%0A%09%09%09        jasperPrint, outputDestination + exportName);%0A%09%09%09return outputDestination + exportName;%0A%09%09%7D%0A%09%09catch (JRException e) %7B%0A%09%09%09_log%0A%09%09%09    .error(e);%0A%09%09%09return StringPool.BLANK;%0A%09%09%7D%0A%09%7D%0A%0A%09private static Log _log = LogFactoryUtil%0A%09    .getLog(JRReportUtil.class%0A%09        .getName());
 %0A%7D%0A%0A

Add method export to pdf