Search code examples
jasper-reportsclarity

Unexpected type (File) of the resource with URI with JasperReports


I have a main report, and need one of the fields to be a hyperlink to another report (using that field as the parameter of the second report).

  • I right clicked, and clicked Hyperlink
  • Link Target - Blank
  • Link Type - ReportExecution

Parameters:

  1. Name: _report Expression: /ca_ppm/resources/PSR_MilestoneReportV2.jrxml
  2. Name: program Expression: $F{name}

The parameter program is used in the sub-report to pull the information.

The expression for _report is the correct path for the .jrxml file of the sub-report, and I also have that .jrxml file marked as a resource in Controls and Resources for the main report...

Yet I am getting this error:

Unexpected type (File) of the resource with URI/ca_ppm/resources/PSR_MilestoneReportV2.jrxml

This seems to be a path issue.

Am i missing something?


Solution

  • _report needs to be a report unit with data source and son on (same type of resource/entity as the main report) and not a JRXML file resource.

    And if you want to pass "program" as a parameter, you'll need to define an input control for it (in addition to the JRXML report parameter) in the target report unit.