Examples of JRException


Examples of net.sf.jasperreports.engine.JRException

   */
  public static InputStream getInputStream(File file) throws JRException
  {
    if (!file.exists() || !file.isFile())
    {
      throw new JRException( new FileNotFoundException(String.valueOf(file)) );
    }

    FileInputStream fis = null;

    try
    {
      fis = new FileInputStream(file);
    }
    catch (IOException e)
    {
      throw new JRException("Error opening input stream from file : " + file, e);
    }

    return fis;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

    {
      is = url.openStream();
    }
    catch (IOException e)
    {
      throw new JRException("Error opening input stream from URL : " + url, e);
    }

    return is;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

    if (url != null)
    {
      return getInputStream(url);
    }

    throw new JRException("Could not load object from location : " + location);
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

      baos.flush();
    }
    catch (IOException e)
    {
      throw new JRException("Error loading byte data : " + file, e);
    }
    finally
    {
      if (baos != null)
      {
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

      baos.flush();
    }
    catch (IOException e)
    {
      throw new JRException("Error loading byte data : " + url, e);
    }
    finally
    {
      if (baos != null)
      {
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

      baos.flush();
    }
    catch (IOException e)
    {
      throw new JRException("Error loading byte data from input stream.", e);
    }
    finally
    {
      if (baos != null)
      {
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

    if (url != null)
    {
      return loadBytes(url);
    }

    throw new JRException("Byte data not found at location : " + location);
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

      {
        is = new FileInputStream(file);
      }
      catch (FileNotFoundException e)
      {
        throw new JRException("Error opening file " + filename, e);
      }
    }
   
    return is;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

    catch (MalformedURLException e)
    {
    }
    catch (IOException e)
    {
      throw new JRException("Error opening URL " + spec, e);
    }
   
    return is;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.JRException

          {
            exportReportToStream(outWriter);
          }
          catch (IOException e)
          {
            throw new JRException("Error writing to writer : " + jasperPrint.getName(), e);
          }
        }
        else
        {
          OutputStream os = (OutputStream)parameters.get(JRExporterParameter.OUTPUT_STREAM);
          if (os != null)
          {
            try
            {
              exportReportToStream(new OutputStreamWriter(os, encoding));
            }
            catch (Exception e)
            {
              throw new JRException("Error writing to OutputStream : " + jasperPrint.getName(), e);
            }
          }
          else
          {
            destFile = (File)parameters.get(JRExporterParameter.OUTPUT_FILE);
            if (destFile == null)
            {
              String fileName = (String)parameters.get(JRExporterParameter.OUTPUT_FILE_NAME);
              if (fileName != null)
              {
                destFile = new File(fileName);
              }
              else
              {
                throw new JRException("No output specified for the exporter.");
              }
            }
           
            imagesDir = new File(destFile.getParent(), destFile.getName() + XML_FILES_SUFFIX);
           
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.