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

ftkjba

Members
  • Posts

    4
  • Joined

  • Last visited

ftkjba's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. Thank sanbez for the answer. I have done what you wrote at office place, and got the right number of rows, but the hobby field is empty in each row. I created "JasperReports project" in Eclipse with the Jaspersoft Studio 6.4.0 plugin at home. I added files described in the question and I had got the worked fine example. When my holiday will be finished I'm going to understand the difference between home and office environment. Thanks for the help.
  2. Thank you for the answer. I have added isRemoveLineWhenBlank attribute into xml_addressbook.jrxml --> detail --> subreport --> reportElement and after that I got the folowing result: I think the report does not pass the data into the subreport that is why subreport has nothing to display.
  3. Hello all, I want to create a report with a subreport with XML Data Source in Jaspersoft Studio. I was trying to copy example from the chapter XML Data Source and Subreports, but I have empty subreport area. Could you explain me my mistake? The listing of the files is shown below: xml_addressbook.jrxml <?xml version="1.0" encoding="UTF-8"?> [/code]xml_addresses.jrxml <?xml version="1.0" encoding="UTF-8"?> [/code]complex_addressbook.xml Davolio Nancy davolio1@sf.net davolio2@sf.net Music Sport Fuller Andrew af@test.net afullera@fuller.org Cinema Sport Leverling leverling@xyz.it Peacock Margaret margaret@foo.org Food Books [/code]
  4. I have ReportDataSourceServiceImpl class which defines datasource by commandName. The method data.get() returns data for datasouce. public class ReportDataSourceServiceImpl implements ReportDataSourceService { private String commandName; @Override public void setReportParameterValues(@SuppressWarnings("rawtypes") Map parameterValues) { JRDataSource ds; switch (commandName) { case "first": ds = new FirstDataSource(data.get(url, auth, parameterValues)); break; case "second": ds = new SecondDataSource(data.get(url, auth, parameterValues)); break; default: ds = new FirstDataSource(data.get(url, auth, parameterValues)); } parameterValues.put(JRParameter.REPORT_DATA_SOURCE, ds); }}[/code]To define some parameters for the data.get() method I added these parameters to reportUnit with "Add Input control..." on JasperReport page. This works fine but now I want to create a report with a subreport. I have created two data sources and report unit in the repository at the JasperServer. I put main.jrxml and "first" data source into the report unit. I pass "((net.sf.jasperreports.engine.data.JRDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/reports/Tests/second")" into Data Source Expression field. After running the report I have an error: Errors were encountered when compiling report expressions class file: 1. net.sf.jasperreports.engine.data.JRDataSource cannot be resolved to a type value = ((net.sf.jasperreports.engine.data.JRDataSource) //$JR_EXPR_ID=9$ <-------------------------------------------> 2. net.sf.jasperreports.engine.data.JRDataSource cannot be resolved to a type value = ((net.sf.jasperreports.engine.data.JRDataSource) //$JR_EXPR_ID=9$ <-------------------------------------------> 3. net.sf.jasperreports.engine.data.JRDataSource cannot be resolved to a type value = ((net.sf.jasperreports.engine.data.JRDataSource) //$JR_EXPR_ID=9$ <-------------------------------------------> 3 errors .[/code]What is the right way to create a report with a subreport?
×
×
  • Create New...