@@ -0,0 +1,2430 @@
+/**%0A* OpenCPS is the open source Core Public Services software%0A* Copyright (C) 2016-present OpenCPS community%0A%0A* This program is free software: you can redistribute it and/or modify%0A* it under the terms of the GNU Affero General Public License as published by%0A* the Free Software Foundation, either version 3 of the License, or%0A* any later version.%0A%0A* This program is distributed in the hope that it will be useful,%0A* but WITHOUT ANY WARRANTY; without even the implied warranty of%0A* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A* GNU Affero General Public License for more details.%0A* You should have received a copy of the GNU Affero General Public License%0A* along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E%0A*/%0A%0Apackage org.opencps.jasperreport.compile;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.InputStream;%0Aimport java.io.Serializable;%0Aimport java.nio.charset.StandardCharsets;%0A%0Aimport com.liferay.portal.kernel.log.Log;%0Aimport com.liferay.portal.kernel.log.LogFactoryUtil;%0A%0Aimport net.sf.jasperreports.engine.JRExpressionCollector;%0Aimport net.sf.jasperreports.engine.JRReport;%0Aimport net.sf.jasperreports.engine.JasperCompileManager;%0Aimport net.sf.jasperreports.engine.JasperReport;%0Aimport net.sf.jasperreports.engine.base.JRBaseObjectFactory;%0A%0A/**%0A * @author trungnt%0A */%0Apublic class ReportTemplate extends JasperReport %7B%0A%0A%09/**%0A%09 * %0A%09 */%0A%09private static final long serialVersionUID = 1L;%0A%0A%09public ReportTemplate(%0A%09    JRReport report, String compilerClass, Serializable compileData,%0A%09    JRExpressionCollector expressionCollector, String compileNameSuffix) %7B%0A%09%09super(%0A%09%09    report, compilerClass, compileData, expressionCollector, compileNameSuffix);%0A%0A%09%7D%0A%0A%09public ReportTemplate(%0A%09    JRReport report, String compilerClass, Serializable compileData,%0A%09    JRBaseObjectFactory factory, String compileNameSuffix) %7B%0A%09%09super(%0A%09%09    report, compilerClass, compileData, factory, compileNameSuffix);%0A%0A%09%7D%0A%0A%09public static ReportTemplate compile(String jrxmlTemplate) %7B%0A%0A%09%09ReportTemplate reportTemplate = null;%0A%09%09try %7B%0A%09%09%09InputStream isTemplate = new ByteArrayInputStream(jrxmlTemplate%0A%09%09%09    .getBytes(StandardCharsets.UTF_8));%0A%09%09%09reportTemplate = (ReportTemplate) JasperCompileManager%0A%09%09%09    .compileReport(isTemplate);%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%0A%09%09return reportTemplate;%0A%09%7D%0A%0A%09private static Log _log = LogFactoryUtil%0A%09    .getLog(ReportTemplate.class);%0A%7D%0A

Add new class compile jasper report