Jump to content
Changes to the Jaspersoft community edition download ×

Pass the Visible Columns from a query result to


xantia95d

Recommended Posts

Is there a way to pass the visible column(s) of a query or list  from a input control back to the jrxml file so that they can be displayed in the report heading.  I have no problem passing back the value column (which is for the most part an id) however, I need to be able to provide the description on the id'ed object for it to be meaningful to the user.

 

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Nothing directly.

 

With a query input control, you look up the visible columns in your report query with the ID parameter.

 

With a list of values input control, you will need some logic in your report to work out what was visible. This could be in a scriplet, or a parameter expression, like:

    <parameter name="idParameter" class="java.lang.String"/>
    <parameter name="visibleParameter" class="java.lang.String">

        <defaultExpression>some expression using $P{idParameter} as an argument</defaultExpression>

    </parameter>

 

Sherman

Jaspersoft

Link to comment
Share on other sites

Sherman,

Thanks for your answer, sort of what I expected but not what I was hoping for. 

The problem with using the report query is that it may not return any values, so the user would not see the full selection criteria used. Hence this means putting in place a set of sub reports to fill in the selection criterial used for the report.

As we want to use the same jrxml file both in our base web application and the jasperserver this would lead to the two of them going their own way.

Is there any chance that we could convince your development team to add an additional parameter e.g. ParameterNameDesc for the selected values in both select and multiselect input controls.

Thanks

Terry

 

 

Link to comment
Share on other sites

  • 5 months later...
  • 11 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...