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

rauper

Members
  • Posts

    3
  • Joined

  • Last visited

rauper's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi All, Could someone please help me - I'm really stuck in this report. I'm using Ireport w/netbeans, trying to create a dynamic report based on SQL query. I'm passing the parameter from a java object using the params HashMap params.put("id_supplier", this.getCurrentSupplier().getSupplierId()); // Queries database for supplier id Then i pass the parameter hashmap to my report: JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, new JREmptyDataSource()); JasperPrintManager.printReport(jasperPrint, true); Within my SupplierReport.jrxml file, I have placed the parameter as tutorials state <parameter name="id_supplier" class="java.lang.Integer"/> and added the database query to return the information <queryString> <![CDATA[sELECT product_description,approved,report FROM product WHERE id_supplier=$P{id_supplier}]]> </queryString> added the field onto the report <textField isBlankWhenNull="true"> <reportElement x="13" y="11" width="342" height="20"/> <textElement verticalAlignment="Middle"> <font fontName="Verdana" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{product_description}]]> </textFieldExpression> </textField> Yet when I print my report it prints nothing. Someone please help me. Many thanks
  2. No replies :( Someone must be able to help me. I've spent weeks on this application and this is all i need to complete my project. I'd be so greatful if someone could help me. Even if it's just pasting a link I can read (although ive scoured the web for answers and not found anything). Many thanks,
  3. Hi all, I'm fairly new to using Ireport, and I'm really struggling to get the report I need, and I'd be extremely greatful if somebody could help me a little. I've built a database application based on JPA, the database app has 2 entity classes - 'Departments' and 'Employees'. I've managed to print a report on the employee by simply using Parameters within a Map and substituting the parameters into text fields in my report as follows: employeereport.jrxml <parameter name="employeeName" class="java.lang.String"/> <textField> <reportElement x="136" y="11" width="401" height="20"/> <textFieldExpression class="java.lang.String"><![CDATA[$P{employeeName}]]></textFieldExpression> </textField> and in my employee.java class Map<String, Object> params = new HashMap<String, Object>(); params.put("employeeName", this.getEmployee().getEmployeeName()); Now I need to create a report for the department, but I cant for the life of me figure out how to simply print the list of employees from each department, which is an ArrayList<Employee> attribute of the Department class. e.g. Department 1 Employees: Employee 1 Employee 2 Employee 3 Is there no simple way of passing a List parameter which prints a list of objects? I've been trying to figure this out for weeks and it's driving me insane. BTW I'm using netbeans with Ireport addon. Thanks in advance for any replies. Post Edited by rauper at 10/19/2010 11:41
×
×
  • Create New...