Jump to content
We've recently updated our Privacy Statement, available here ×

Optional Columns


tieTYT

Recommended Posts

I have this form that lets you choose which columns show up on the report. Is there any way to make the columns slide over to take up space if adjacent columns are invisible? I don't want a big white gap on my reports. Note that I have to export this to Excel, so I don't want any blank columns

 

Thanks

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

There is no such feature built into JasperReports. The only solution would be to load the report as a JasperDesign object, to manually update it using the API and to recompile it.

 

If you're only exporting the report to XLS, you could leave the gaps in the report and set the IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS flag when exporting.

 

Regards,

Lucian

Link to comment
Share on other sites

  • 2 months later...

IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS only removes whitespace between elements, correct?

 

when exporting to XLS it will not remove the designated space for the element that is to be suppressed, say, based on a printWhenExpression, correct?

 

are there plans to implement such a feature?

i do not see it in the feature request list:

http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperreports/tracker.feature_requests

 

i would think this is a fairly common requirement.

 

thanks,

/mt

Link to comment
Share on other sites

mtaylor wrote:

IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS only removes whitespace between elements, correct?

when exporting to XLS it will not remove the designated space for the element that is to be suppressed, say, based on a printWhenExpression, correct?

 

If the elements on a column have prinWhenExpressions that suppress them, the resulting report would have empty space where the elements would have been positioned and IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS would remove that space when exporting to Excel (given that the entire column is empty).

 

are there plans to implement such a feature?

i do not see it in the feature request list:

http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperreports/tracker.feature_requests

i would think this is a fairly common requirement.

 

If there is no such feature request and you think this would be useful, please log a feature request yourself.

 

Regards,

Lucian

Link to comment
Share on other sites

  • 6 months later...

Thanks.

I thought this solved my issue, but it appears the IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS only 'hides' the empty columns in the resulting XLS document. I have attached an image as an example (xlsImage.png).  You can see the columns 'K' and 'L' have both been hidden.  The report didn't find values for those fields, and we set the property to remove the empty space on the XlsExporter.

 

This causes issues if the user wants to resort the data in the XLS document.

Is is possible to completely remove such columns?

 

thank you in advance!

Link to comment
Share on other sites

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...