Examples of JasperReport


Examples of net.sf.jasperreports.engine.JasperReport

   * @param provider the JRDataSourceProvider to use
   * @return the created report
   */
  protected JRDataSource createReport(JRDataSourceProvider provider) {
    try {
      JasperReport report = getReport();
      if (report == null) {
        throw new IllegalStateException("No main report defined for JRDataSourceProvider - " +
            "specify a 'url' on this view or override 'getReport()'");
      }
      return provider.create(report);
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

  protected void exposeLocalizationContext(Map<String, Object> model, HttpServletRequest request) {
    RequestContext rc = new RequestContext(request, getServletContext());
    if (!model.containsKey(JRParameter.REPORT_LOCALE)) {
      model.put(JRParameter.REPORT_LOCALE, rc.getLocale());
    }
    JasperReport report = getReport();
    if ((report == null || report.getResourceBundle() == null) &&
        !model.containsKey(JRParameter.REPORT_RESOURCE_BUNDLE)) {
      model.put(JRParameter.REPORT_RESOURCE_BUNDLE,
          new MessageSourceResourceBundle(rc.getMessageSource(), rc.getLocale()));
    }
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @see #getReportData
   * @see #setJdbcDataSource
   */
  protected JasperPrint fillReport(Map<String, Object> model) throws Exception {
    // Determine main report.
    JasperReport report = getReport();
    if (report == null) {
      throw new IllegalStateException("No main report defined for 'fillReport' - " +
          "specify a 'url' on this view or override 'getReport()' or 'fillReport(Map)'");
    }

View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @param provider the JRDataSourceProvider to use
   * @return the created report
   */
  protected JRDataSource createReport(JRDataSourceProvider provider) {
    try {
      JasperReport report = getReport();
      if (report == null) {
        throw new IllegalStateException("No main report defined for JRDataSourceProvider - " +
            "specify a 'url' on this view or override 'getReport()'");
      }
      return provider.create(report);
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

  @SuppressWarnings("rawtypes")
  public JasperPrint fill( File jasperFile ,Map parameters,List list ){
    JasperPrint jasperPrint = null;
   
    try{     
      JasperReport jasperReport =(JasperReport)JRLoader.loadObject( jasperFile );
      jasperPrint = JasperFillManager.fillReport(
          jasperReport,parameters,new ListDataSource( list ));
     
    }catch (JRException e){
      //do something …
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
   */
  protected void exposeLocalizationContext(Map model, HttpServletRequest request) {
    Locale locale = RequestContextUtils.getLocale(request);
    model.put(JRParameter.REPORT_LOCALE, locale);
    JasperReport report = getReport();
    if (report == null || report.getResourceBundle() == null) {
      ResourceBundle bundle = new MessageSourceResourceBundle(getApplicationContext(), locale);
      model.put(JRParameter.REPORT_RESOURCE_BUNDLE, bundle);
    }
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @see #getReportData
   * @see #setJdbcDataSource
   */
  protected JasperPrint fillReport(Map model) throws IllegalArgumentException, SQLException, JRException {
    // Determine main report.
    JasperReport report = getReport();
    if (report == null) {
      throw new IllegalStateException("No main report defined for 'fillReport' - " +
          "specify a 'url' on this view or override 'getReport()' or 'fillReport(Map)'");
    }

View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @see net.sf.jasperreports.engine.data.JRBeanArrayDataSource
   */
  protected JRDataSource convertReportData(Object value) throws IllegalArgumentException {
    if (value instanceof JRDataSourceProvider) {
      try {
        JasperReport report = getReport();
        if (report == null) {
          throw new IllegalStateException("No main report defined for JRDataSourceProvider - " +
              "specify a 'url' on this view or override 'getReport()'");
        }
        return ((JRDataSourceProvider) value).create(report);
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @see org.springframework.web.servlet.support.JstlUtils#exposeLocalizationContext
   */
  protected void exposeLocalizationContext(Map model, HttpServletRequest request) {
    Locale locale = RequestContextUtils.getLocale(request);
    model.put(JRParameter.REPORT_LOCALE, locale);
    JasperReport report = getReport();
    if (report == null || report.getResourceBundle() == null) {
      ResourceBundle bundle = new MessageSourceResourceBundle(getApplicationContext(), locale);
      model.put(JRParameter.REPORT_RESOURCE_BUNDLE, bundle);
    }
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JasperReport

   * @see #getReportData
   * @see #setJdbcDataSource
   */
  protected JasperPrint fillReport(Map model) throws IllegalArgumentException, SQLException, JRException {
    // Determine main report.
    JasperReport report = getReport();
    if (report == null) {
      throw new IllegalStateException("No main report defined for 'fillReport' - " +
          "specify a 'url' on this view or override 'getReport()' or 'fillReport(Map)'");
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.