xml - Jasper Report - Count nodes with particular value -


i have jasper report multiple subreports, using xml datasource.

i doing visual enhancements , stuck sub totals (column footer) on 1 sub report. parent report has group keeping linked records together. there sub report in detail band has individual records.

now comes tricky part, want sub total display on sub report, if group on parent report contains more 1 record.

i have tried using group count variable, problem count increments each record processed. count still 1 when 1st subreport generated.

i have tried using xpath count() function, have not got right. have got following in field on parent report (passing parameter subreport)

count(//currentnode[targetnode = '$f{targetnode}']) 

i have tried various things, seems cannot use parameter or field value in xpath of count() function. if explicitly set value instead of $f{targetnode}, correct count of nodes, need count change based on current group.

is there way count records in group, before generating 1st subreport?

after trying few different approaches, decided count records in each group, using xpath count function in xsl stylesheet. ordering records in way, made sense.

i added additional tag store record count.

the following expression counts records share common value between 2 different tags:

count(//name[text() = current()/name , ..//surname[text() = current()/surname]]) 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -