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

Asked

Viewed 174 times

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 lyrics need to be A-Z(like a phone book).

This is an example of what I want:

inserir a descrição da imagem aqui

  • The first letter of the last page entry?

  • Exact, as the figure above, the last record would be the "Laura Steel" and in this case, present the letter "L" on the page. With respect to the letter I can catch it through the substring. But I have no idea which component could be used to present in this way.

1 answer

0

Hello Voce can mark in the component the Evaluation time(Evaluation time) the component should display the data according to a selected time the default value is now(Now) but if you change Report(Report) I believe that would be the last value , ai to take only the first letter just use the substring(0.1) function of the String class.

inserir a descrição da imagem aqui

Now for the list to be in alphabetical order I would recommend using groups and changing their layout a little to something like my example would be a similar layout. I used Groups to create this list on levels

inserir a descrição da imagem aqui

Let’s go to the tutorial on how to create and use Groups,

  1. right-click the report and select create group.

Como Criar o group

  1. Here Cvoce defines the name of the group and decides 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.

inserir a descrição da imagem aqui

  1. Here you decide to use Bands in Header and Footer( Yes each group creates a new band in your report’s menu.

inserir a descrição da imagem aqui

  1. In the image we see how it looks after the insertion of bands referring to the group.

inserir a descrição da imagem aqui

  1. By clicking on the Voce band you can see the expression that creates it as well as some other extra settings for the band itself in question.

inserir a descrição da imagem aqui

I hope that the answer has been useful and can solve your problem. If yes be positive the answer.

  • Denis, thanks for the tip. Can you provide me an example?

  • How do you want the example ? a tutorial using groups ?

  • Using groups would help enough. Thanks!

  • See if it helps you

Browser other questions tagged

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