Jump to content
We've recently updated our Privacy Statement, available here ×

PDF to HTML: spacing display


keogz

Recommended Posts

My Jasper reports were originally PDF's and now i need them to be in HTML... my problem would be that when i display/view the html, the spacings in blank areas show as jpg files that wont load. i need to dispaly the html properly. i know this seems easy to fix but im not to verse with jasper reports and would like to know how to fix this....i use .jasper files and have iReport 2.0...would appreciate it if someone could give me the best solution. thank you!
Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

yes, i always create the jrxml file everytime in iReport..the thing is, i dont know how to configure the page to recognize the blank spaces as not a jpg to be displayed as html...could you help me with this?
Link to comment
Share on other sites

Hi,

 

actually there is a specific html export parameter, JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, which tells the exporter how to fill empty cells in the generated html. If you set it to false, no more transparent pixel image will be loaded (or shouldn't be).

 

hth,

sanda

Link to comment
Share on other sites

thank you...but i've already added this line

 

exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, false);

 

to my BaseReportAction.java and tried to generate the html page again..unfortunately, it still wont recognize the spaces...

 

need help pls..

Link to comment
Share on other sites

my BaseReportAction.java includes the ff lines:

 

 

final JasperPrint jasperPrint =

JasperFillManager.fillReport(

jasperReport,

parameters,

getTransactionManager().getDataSource().getConnection()

);

request.getSession()

.setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);

final JRHtmlExporter exporter = new JRHtmlExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

final StringBuffer sbuffer = new StringBuffer(4096);

exporter.setParameter(JRExporterParameter.OUTPUT_STRING_BUFFER, sbuffer);

exporter.setParameter(JRHtmlExporterParameter.HTML_HEADER, "");

exporter.setParameter(JRHtmlExporterParameter.HTML_FOOTER, "");

exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,

"../../servlets/image?image=");

exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, false);

exporter.exportReport();

 

//log.debug(sbuffer.toString());

request.setAttribute("reportHTML", sbuffer.toString());

}

Post edited by: keogz, at: 2007/07/19 02:57

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...