@Override protected void checkLanguage(String language) throws JRException { if (!JRReport.LANGUAGE_JAVA.equals(language)) { throw new JRException(EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE, new Object[] { language, JRReport.LANGUAGE_JAVA }); } }
protected void checkLanguage(String language) throws JRException { if (!JRReport.LANGUAGE_JAVA.equals(language)) { throw new JRException( "Language \"" + language + "\" not supported by this report compiler.\n" + "Expecting \"java\" instead." ); } }
protected void checkLanguage(String language) throws JRException { if (!JRReport.LANGUAGE_JAVA.equals(language)) { throw new JRException( "Language \"" + language + "\" not supported by this report compiler.\n" + "Expecting \"java\" instead." ); } }
@Override protected void checkLanguage(String language) throws JRException { if (!JRReport.LANGUAGE_JAVA.equals(language)) { throw new JRException(EXCEPTION_MESSAGE_KEY_EXPECTED_JAVA_LANGUAGE, new Object[] { language, JRReport.LANGUAGE_JAVA }); } }
public void moveFirst() throws JRException { if (document == null) throw new JRException("document cannot be null"); if (selectExpression == null) throw new JRException("selectExpression cannot be null"); currentNode = null; currentNodeIndex = -1; nodeListLength = 0; nodeList = xPathExecuter.selectNodeList(document, selectExpression); nodeListLength = nodeList.getLength(); }
protected void checkLanguage(String language) throws JRException { if ( !LANGUAGE_BSH.equals(language) && !JRReport.LANGUAGE_JAVA.equals(language) ) { throw new JRException( "Language \"" + language + "\" not supported by this report compiler.\n" + "Expecting \"bsh\" or \"java\" instead." ); } }
protected void checkLanguage(String language) throws JRException { if ( !JRReport.LANGUAGE_GROOVY.equals(language) && !JRReport.LANGUAGE_JAVA.equals(language) ) { throw new JRException( "Language \"" + language + "\" not supported by this report compiler.\n" + "Expecting \"groovy\" or \"java\" instead." ); } }
private void cleanUpAndThrowError(File out, Exception e) throws JRException { log.error("Could not compile " + source.getName() + " because " + e.getMessage(), e); if (out != null && out.exists()) { out.delete(); } throw new JRException("Could not compile " + source.getName(), e); } }
protected JREvaluator loadEvaluator(Serializable compileData, String unitName) throws JRException { if (!(compileData instanceof JavaScriptCompileData)) { throw new JRException("Invalid compile data, should be an instance of " + JavaScriptCompileData.class.getName()); } JavaScriptCompileData jsCompileData = (JavaScriptCompileData) compileData; return new JavaScriptEvaluator(jsCompileData); }
public NodeList selectNodeList(Node contextNode, String expression) throws JRException { try { return xpathAPI.selectNodeList(contextNode, expression); } catch (TransformerException e) { throw new JRException("XPath selection failed. Expression: " + expression, e); } }
protected void checkExistingName(String name) throws JRException { if (getStyle(name) != null) { throw new JRException("Duplicate declaration of template style : " + name); } }
public Object evaluate(JRExpression expression, byte evaluationType) throws JRException { if (evaluationType != JRExpression.EVALUATION_DEFAULT) { throw new JRException("The crosstab evaluator doesn't support old or estimated expression evaluation."); } return evaluator.evaluate(expression); }
/** * Export report in .rtf format * @return report in .rtf format in a StringBuffer object */ protected StringBuffer exportReportToBuffer() throws JRException{ StringWriter buffer = new StringWriter(); writer = buffer; try { exportReportToStream(); } catch (IOException ex) { throw new JRException("Error while exporting report to the buffer"); } return buffer.getBuffer(); }
protected static JRSubreportRunnerFactory getRunnerFactory() throws JRException { String factoryClassName = JRProperties.getProperty(JRSubreportRunnerFactory.SUBREPORT_RUNNER_FACTORY); if (factoryClassName == null) { throw new JRException("Property \"" + JRSubreportRunnerFactory.SUBREPORT_RUNNER_FACTORY + "\" must be set"); } return (JRSubreportRunnerFactory) runnerFactoryCache.getCachedInstance(factoryClassName); } }
protected void openWorkbook(OutputStream os) throws JRException { try { workbook = Workbook.createWorkbook(os); } catch (IOException e) { throw new JRException("Error generating XLS report : " + jasperPrint.getName(), e); } }
/** * */ public JRQueryExecuterFactory getQueryExecuterFactory(String language) throws JRException { String factoryClassName = JRProperties.getProperty(JRQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX + language); if (factoryClassName == null) { throw new JRException("No query executer factory class registered for " + language + " queries."); } return (JRQueryExecuterFactory) cache.getCachedInstance(factoryClassName); }
protected void closeWorkbook(OutputStream os) throws JRException { try { workbook.write(os); } catch (IOException e) { throw new JRException("Error generating XLS report : " + jasperPrint.getName(), e); } }
protected void setRowHeight(int y, int lastRowHeight) throws JRException { try { sheet.setRowView(y, (lastRowHeight * 20)); // twips } catch (RowsExceededException e) { throw new JRException("Error generating XLS report : " + jasperPrint.getName(), e); } }
/** * Adds a parameter to the dataset. * @param parameter the parameter to add * @throws JRException * @see net.sf.jasperreports.engine.JRDataset#getParameters() */ public void addParameter(JRParameter parameter) throws JRException { if (parametersMap.containsKey(parameter.getName())) { throw new JRException("Duplicate declaration of parameter : " + parameter.getName()); } parametersList.add(parameter); parametersMap.put(parameter.getName(), parameter); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PARAMETERS, parameter, parametersList.size() - 1); }
/** * */ public void addParameter(JRSubreportParameter subreportParameter) throws JRException { if (this.parametersMap.containsKey(subreportParameter.getName())) { throw new JRException("Duplicate declaration of subreport parameter : " + subreportParameter.getName()); } this.parametersMap.put(subreportParameter.getName(), subreportParameter); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_PARAMETERS, subreportParameter, parametersMap.size() - 1); }