Package net.sf.jasperreports.engine

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


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

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

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

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

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

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

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

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

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

          {
            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

      writer = new BufferedWriter(new OutputStreamWriter(fileOutputStream, encoding));
      exportReportToStream(writer);
    }
    catch (IOException e)
    {
      throw new JRException("Error writing to file : " + destFile, e);
    }
    finally
    {
      if (writer != null)
      {
        try
        {
          writer.close();
        }
        catch(IOException e)
        {
        }
      }
    }
   
    if (!isEmbeddingImages)
    {
      Collection imageNames = imageNameToImageDataMap.keySet();
      if (imageNames != null && imageNames.size() > 0)
      {
        if (!imagesDir.exists())
        {
          imagesDir.mkdir();
        }
 
        for(Iterator it = imageNames.iterator(); it.hasNext();)
        {
          String imageName = (String)it.next();
          byte[] imageData = (byte[])imageNameToImageDataMap.get(imageName);

          File imageFile = new File(imagesDir, imageName);

          OutputStream fos = null;
          try
          {
            fos = new FileOutputStream(imageFile);
            fos.write(imageData, 0, imageData.length);
          }
          catch (IOException e)
          {
            throw new JRException("Error writing to image file : " + imageFile, e);
          }
          finally
          {
            if (fos != null)
            {
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRException

Copyright © 2018 www.massapicom. 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.