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

kinslayer2004

Members
  • Posts

    3
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by kinslayer2004

  1. HEY tomsimmons , I have the same trouble with images when I´m exporting to HTML Stream to redirect it to the browser, please if you send me an example of you code that resolves the problem, I´ll be glad My Email : aramos@uci.cu thanks in advance Alain Code:public static byte[] exportReportToHtmlStream(JasperPrint jasperPrint, String imagesURI) throws JRException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); JRHtmlExporter exporter = new JRHtmlExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.setParameter(JRHtmlExporterParameter.CHARACTER_ENCODING, "ISO-8859-1"); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, new HashMap()); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); exporter.exportReport(); return baos.toByteArray(); }public void generateReport(/*ActionEvent actionEvent,*/ String reportName, Map parameters, Collection data) throws ClassNotFoundException, IOException, JRException { FacesContext context = FacesContext.getCurrentInstance(); try { HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse(); HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest(); ServletOutputStream servletOutputStream = response.getOutputStream(); CommonInformation(reportName, parameters, data); response.setContentType("text/html"); response.setHeader("Content-disposition", "inline"); byte[] aux = exportReportToHtmlStream(jasperPrint, imagesURI) ; request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint); Enumeration temp = request.getSession().getAttributeNames(); servletOutputStream.write(aux); servletOutputStream.flush(); servletOutputStream.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } context.responseComplete(); } Post Edited by Alain Ramos at 11/07/08 16:48
  2. I´m trying to display values above each point of my line chart but I have failed many times, I have tried with labelExpession Tag but it doesn´t work, a quick reference that I found means that this property only works with piechart. I post the JXRML code down here... thanks in advance... Code:<lineChart> <chart evaluationTime="Group" evaluationGroup="FirstLetterGroup" hyperlinkType="None"> <reportElement positionType="Float" x="0" y="25" width="270" height="175" backcolor="#FFFFFF"/> <chartTitle color="#000000"/> <chartSubtitle color="#000000"/> <chartLegend textColor="#000000" backgroundColor="#FFFFFF"/> </chart><categoryDataset> <dataset resetType="Group" resetGroup="FirstLetterGroup" incrementType="Group" incrementGroup="CityGroup"/> <categorySeries> <seriesExpression><![CDATA["Freight/Orders"]]></seriesExpression> <categoryExpression><![CDATA[$F{ShipCity} + ", " +$F{ShipCountry}]]> </categoryExpression> <valueExpression><![CDATA[new Double($V{FreightSumCityGroup}.doubleValue() / $V{CityGroup_COUNT}.doubleValue())]]></valueExpression> <labelExpression><![CDATA[$F{ShipCity}]]></labelExpression></categorySeries> </categoryDataset> <linePlot> <plot> <seriesColor seriesOrder="0" color="#0000CC"/> </plot> <valueAxisLabelExpression><![CDATA["Freight per Order"]]></valueAxisLabelExpression> <valueAxisFormat> <axisFormat labelColor="#0000CC" tickLabelColor="#0000CC" tickLabelMask="$#,##0" axisLineColor="#0000CC"/> </valueAxisFormat> </linePlot> </lineChart>
  3. I have those problems too, I´m newer than you using Jasper report y JfreeChart. I need you help, If you could send me all charts funtional examples that will be great. My best regards, and thanks very much for your help.
×
×
  • Create New...