Question

I have written a query in iReport 3.7.6 which works fine except when i added that instead of defining at.a = 'EXAMPLE' i tried to put it as a parameter at.a = $P!{at.a} but i am getting the error "Error:The parameter 'at.a' is not defined." not quite sure what i'm missing.

Code below.

SELECT
       at.a,
       TO_CHAR(TRUNC(at.b), 'DD/MM/YY'),
       at.c AS,
       at.d AS,
       at.e AS,
       at.f AS,
       at.g AS,
       trunc(sysdate) - trunc(at.b)
  FROM atable at
  LEFT outer join btable bt
    ON at.c = bt.h
  LEFT outer join ctable ct
    ON at.c = ct.h
 WHERE at.a = $P!{at.a}
 ORDER BY at.b, at.c, at.d
Was it helpful?

Solution

Missed out adding a parameter in iReport.

Pass parameters from main report to table's data source in iReport

Following steps help to pass parameters from main report to table data source in iReport (3.6.7 or 4.1.2)

  • Create required parameters in the main report

  • right clicking on the parameters section of main report

  • add parameter

  • set the properties (data type)

  • set default expression (optional)

  • Create parameters within the sub data source

  • Set name , data type as same as main report parameters

  • Map the parameters in main report and data set

  • Right click on the table and click on Edit Table Dataset

  • Select the parameters

  • Click on add

  • Choose the parameter (created in dataset) from upper combo

  • Assign value expression (parameter which added in step 1)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top