FrankelStein
FrankelStein

Reputation: 1010

How to concatenate a Variable and a Subreport in JasperReport?

As the title says I need to concatenate a variable and a subreport using Jasper Report Studio.

Let's say I have the variable $F{var1} and a subreport, both generates Strings of variable length, so putting one beside another in the design view is not a sollution.

If they were two variables I would have chosen a Text field whose expression would simply be $F{var1} + $F{var2}

But since I want to concatenate a variable with a subreport, I don't know how to proceed. Any Ideas?

Upvotes: 0

Views: 2695

Answers (1)

Viki888
Viki888

Reputation: 2774

Try to pass the variable $V{var1} as a parameter say $P{Para1} to the subreport and print that parameter in the subreport by concatenating with the subreport variable as

$P{Para1} + $V{var2}

Note: $F{} is not a variable. It is a field, which is the result of the query.

Hope this should solve your question.

Upvotes: 1

Related Questions