String parameter in iReport

Asked

Viewed 122 times

0

I have a Contract registration where has a text editor and the user can edit the text of the contract, but in this text will have information as Company and Plan Holder that are dynamic and as the text is passed complete to the report.

I need to know if it is possible to receive a string and inside it contain other variables that iReport already has.

Ex: The XYZ Contract with the Company $P{razaoSocial}, $P{cnpj}, resident $P{addresseEmpresa}, sign contract with the client $P{client name}...

As these text changes and the user who does the editing, I can not only use the variable, what I can and make available the options that it can use if you want to display inside your text, but I could not make it work yet.

  • Friend, this text: "The XYZ Contract with the Company $P{razaoSocial}, $P{cnpj}, resident $P{addresseeEmpresa}, signs contract with the client $P{customer name}." is always fixed? I mean, the only values that are different are $P{razaoSocial}, $P{cnpj}... ? If so, you can before generating the report, create a logic to filter these values based on their position (remembering that the text always has to be the same) and then send it to Ireport. Would not work ?

  • The whole is filled by the system user, has a text editor that he can change the time he wants, so I thought I’d leave an msg on the screen like: To use the user name add this: $P{client name} And that iReport could read, because there the only thing I get per parameter is $P{textContract} that comes all the text including these parameters inside, but it is printing as fixed string.]

1 answer

0

Solved Using:

Example 6.3. Using built-in functions

msg("Total cost is {0}", $F{TOTAL})
msg("Matched {0} products out of {1}", $F{MATCHED}, $P{TOTAL})

Browser other questions tagged

You are not signed in. Login or sign up in order to post.