aspose file tools*
The moose likes Other Open Source Projects and the fly likes Display POI Workbook in the Rich Clien application - TWS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Display POI Workbook in the Rich Clien application - TWS" Watch "Display POI Workbook in the Rich Clien application - TWS" New topic
Author

Display POI Workbook in the Rich Clien application - TWS

Fix Berg
Greenhorn

Joined: Aug 03, 2011
Posts: 3
We are moving away from Actuate. We keep data as a BLOB in the DB. I am trying to find the way to generate POI workbook from the blob and display it in the JFrame.
Any ideas?
Thank you.
Kenneth Rowe
Greenhorn

Joined: Nov 13, 2009
Posts: 5
The standard solution is to do something like this:


try{

PreparedStatement ps=conn.prepareStatement("SELECT graphic_blob from graphic_table where primary_key = ?");
ps.setString(1,sTemplateKey);
ResultSet rs=ps.executeQuery();
if(rs.next()){

{
Blob b=rs.getBlob(1);
InputStream in =b.getBinaryStream();
int n=in.read();
while(n!=-1) {
out.write(n);
n=in.read();
//System.out.print("n: " + n);
}
int sheetCount = wb.getNumberOfSheets();
System.out.print( "sheetCount for createWorkbook(out): " + sheetCount);

out.flush();
out.close();
in.close();


if (theRS != null) theRS.close();
if (stmt != null) stmt.close();


}// end if for while loop

}// end of resultset fetch
}// end of try
catch (SQLException e){
String theError =e.getMessage() ;
if (theError.startsWith("Io exception")){
theError = "<b>Connection Timed Out</b><br><br>"+theError;
}
System.out.print( "connection failed because: " + theError);
out.println(sTheHeader);
h.add(helperHTML.HEADING,theError, true);
h.add(helperHTML.LINE,"", true);
h.add(helperHTML.NORMAL,sSQLString, true);
sThePage = h.getPage();
out.println(sThePage);
out.println("</body>");
out.println("</html>");
out.close();
return;

}//end of catch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display POI Workbook in the Rich Clien application - TWS