How to put a letter on the right side of the page, showing the first letter of the last record?

2

How can I put a letter on the right side of the page, showing the first letter of the last record in JasperReports?

Another thing is that the letter must be from A-Z (like a phone book).

Here is an example of what I want:

    
asked by anonymous 06.12.2017 / 13:46

1 answer

0

Hello, you can mark in the component the Evaluation time, the component must display the data according to a selected time, the default value is now, but if you change Report, I think it's going to be the last one value, then to just get the first letter just use the subString (0,1) function of the String class.

NowforthelisttobeinalphabeticalorderIwouldrecommendusinggroupsandchangingyourLayoutabitforsomethinglikemyexamplewouldbeasimilarlayout.UseGroupstocreatethislistinlevels

Let'sgototheTutorialonhowtocreateanduseGroups,

  • rightclickonthereportandselectcreategroup.
  • Here you define the group name and decide whether to create the group by an expression or by an object in the report, in case I always use the second option and select the field that will be used to create my group.
  • Here you decide whether to use Bands in the Header and Footer (Yes each group creates a new band in the menu of your report.
  • In the image we see how it is after the insertion of the bands referring to the group.
  • By clicking on the band you can see the expression that creates it as well as some other extra settings for the band itself.
  • I hope the answer was helpful, and I can solve your problem. If so, do not miss the answer.

        
    07.12.2017 / 12:21