title: Converting JasperPrint to a File
body: <p>Im with a different problem... I've googled a little but havent found anything about my problem so im asking here...
  I have an object JasperPrint where i generate the document...
  The problem is that i need to create a java.io.File from this JasperPrint without saving the file on the computer.</p>
  
  <p>What do i need to do is: send a file by email. And this file must be generated by the jasperreport. I can't save the stream on the machine to delete it later... so i need to take the file in memory or something like that in runtime...</p>
  
  <p>So... i have my object jasperprint and need to get a java.io.File from this one...
  Someone knows what do can i do?</p>
  
  <p>Andrew... couldnt answer it at comment so im writing it here...
  In javax.mail i've done like this:</p>
  
  <pre><code>File fileAttachment = myfile;
  messageBodyPart = new MimeBodyPart();
  DataSource source = new FileDataSource(fileAttachment);
  messageBodyPart.setDataHandler(new DataHandler(source));
  messageBodyPart.setFileName(fileAttachment.getName());
  multipart.addBodyPart(messageBodyPart);
  </code></pre>
  
  <p>and its working when i pass him a file from my machine...
  So i think its gonna work when i use a java.io.File even if its only on memory...</p>