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

AnjumAbbas

Members
  • Posts

    11
  • 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 AnjumAbbas

  1. Okay I solved this by adding the following lines to the code which exports to html file. htmlExporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, request.getSession().getServletContext().getRealPath("/jsp/images/"));htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,getImageURI()); I found the solution right at the bottom of this thread:http://forum.spring.io/forum/spring-projects/web/16006-images-not-displaying-with-jasperreports
  2. Hi, I'm got a jrxml designed in ireport. It has a single image 'VW-logo-34px.jpg' defined in the report as $P{imagePath} + "VW-logo-34px.jpg". When I export to pdf and excel I can see the image clearly however it does not show when I export to xhtml. I have followed the example in demo/samples/webapp on adding an image servlet. This is what I have added to my web.xml <servlet><servlet-name>ImageServlet</servlet-name><servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class></servlet> <servlet-mapping><servlet-name>ImageServlet</servlet-name><url-pattern>/servlets/image</url-pattern></servlet-mapping> Here is the code which produces the jasperprint and does the export I have configured the image servlet in this way JRXhtmlExporter htmlExporter = new JRXhtmlExporter(); htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, getImageMap()); htmlExporter.setParameter(JRExporterParameter.OUTPUT_WRITER, response.getWriter()); htmlExporter.exportReport(); However after exporting the resulting html page shows the following:<img style="position: absolute; height: 56px; top: 0px; left: 0px;" alt="" src="image?image=img_0_1_34"/> Why is it hardcoding img_0_1_34 as the name of the image and not putting in the correct image name i.e. VW-logo-34px.jpg?! Someone please help as I've been searching for an answer on the forums for a day now and having tried everything suggested and following the sample demo. Thanks
  3. Create a parameter to pass in the database name eg $P{databaseName} then use it in a query for example using the $P!{databaseName} with the exclamation mark which means its a dynamic parameter. Anjum
  4. Hello, I seem to be getting a bold border around the column header (client) for table 1. The problem is this extra border isn't showing up in iReport so I really can't see what the problem is! Although its something fairly small its significant enough to annoy the users! Please help!! I've attached the pdf showing the box and the jrxml file. Its table1 column label is Client. Thanks, Anjum
  5. Sorted this. The problem was that in trying to fix the tables I'd been trying different datasources pass in when filling my report. The one I needed was the database connection below and not the one that I've now commented out! JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport, parameters, conn); // jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource()); Thanks for you help Ajinkya, both tables and the main report now work a treat! :)
  6. Sorted this. The problem was that in trying to fix the tables I'd been trying different datasources pass in when filling my report. The one I needed was the database connection below and not the one that I've now commented out! JasperPrint jasperPrint = JasperFillManager.fillReport( jasperReport, parameters, conn); // jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JREmptyDataSource());
  7. I've checked the query in the main report using the parameters and it executes fine. But that's what I was expecting as the main report was working fine before I mapped the table parameters to those of the main report parameters.
  8. Hi, I've got a report which is passed in some parameters. The main report has an sql query and therefore a connection to a database. The report also has two tables. Both tables use a subset of parameters from the main report. At first the main report was working fine and displaying data. As soon as I mapped the parameters from the tables to the main report parameters the tables started to work but now the main report is showing NULL values!!! Please could someone tell me what I'm doing wrong? Is it the datasource? I've attached the jrxml file. many thanks! Anjum
  9. Hi Ajinkya, Ok so I think I did what you said. I clicked on edit table datasource on table 1 and 2 and on the parameters tab I hit modify for each parameter and added a value expression which I picked from the pick list to be the one for the main report. So both tables are now working and pulling through values but the main report has stopped working!! And is showing NULL for all values!! Help!
  10. Hi, This is the first time I've used tables in my report. The main report works fine with a database connection and it displays all the data. I have two tables. Table 1 is at the top of the report and simply displays some parameters from the main report. But the values are displaying as null for these. I've set the Dataset for this as Connection / Datasource exp and it is set to new net.sf.jasperreports.engine.JREmptyDataSource(). I've added the parameters that I need in this table from the main report parameters to the Table Dataset 1 parameters. I've also added the parameters under the parameters tab in the edit table datasource! Table 2 is placed in the Summary band of the main report. This uses a query to retrieve fields, using the same datasource connection as the main report. The query string uses parameters from the main report. Again I've added the parameters I need for the query to Table Dataset 2 and to the parameters tab! I've followed all the instructions and the whole report compiles just fine but when I run it Table 1 shows null where the parameter values are meant to be shown. And Table 2 shows nothing at all where the field values are meant to be shown!! Could someone please help! I've attached the jrxml file. thanks, Anjum
×
×
  • Create New...