Jump to content
Changes to the Jaspersoft community edition download ×

"page a / b" w dynam. width at right margin


Recommended Posts

By: Ulf Heyder - olpp

"page a / b" w dynam. width at right margin

2003-02-11 00:54

This is probably an easy to solve thing for you wizards :-)

 

I use 3 <textelements> to generate a "page a / b" block aligned to the right margin .

 

The first is the actual PAGE_NUMBER evaluated every "page", the second is just the " / ", the third contains the PAGE_NUMBER with evaluationTime="Page".

 

Every element has a fixed width and the whole sticks to the right margin.

 

Since I don't know now, how wide the highest page number will be, I use a fixed width for the two pagenumbers so numbers from 1 to 999 would fit nicely. This leads to the fact, that with little pagenumbers there is some whitespace around the numbers, wich I don't really like.

 

Is there a possibility to give the textelements a dynamical width so they all stick to each other as slim as possible and as one stick to the right margin?

 

Thanks, Ulf

 

 

 

 

 

By: Thomas Richter - hornet_f4c

RE: "page a / b" w dynam. width at right margin

2003-02-13 15:04

Hum, don't think I can solve your problem 100 %...

 

At first it is possible to do it with only two textfields.

The first contains $V{PAGE_NUMBER}+" / "

The second conatins only $V{PAGE_NUMBER}

 

You position the textelemenst at the right edge without any space between them.

 

Now you simply align the text of the first to the right within the first textelement and the text within the second is aligned to the left.

 

Now you will have always excactly one space between the numbers and the slash(with the above example I added those spaces in the first textelement as you probably noticed).

However - the space between the second number and the border will still vary somewhat as it is beeing filled when the number of digits increases.

 

Sorry for beeing not more helpful - that's all I can think of.

Cya

 

 

 

 

By: Ulf Heyder - olpp

RE: "page a / b" w dynam. width at right margin

2003-02-14 14:21

Thanks or the message, these two care exactly what I do in moment.

 

I think I have to think about a more complicated or even impossible way to get the to parts of my "page 1/5" into one textelement.

 

Can I do it with an own counter/variable/...

 

Who knows?

 

Ulf

 

 

 

 

By: Chuck Deal - cdeal

RE: "page a / b" w dynam. width at right margin

2003-02-20 06:19

If you really want the text in one textfield, use a scriptlet to build a string to place in the textfield.

 

Then call the scriptlet method whenever you want to show the text "page x/y". You have access to all of the variables inside the scriptlet so it shouldn't be a problem.

 

 

 

 

By: Ulf Heyder - olpp

RE: "page a / b" w dynam. width at right margin

2003-02-21 02:51

My problem is that the variable PAGE_NUMBER has different values depending on the time of evaluation.

 

The only feature (haven't tried scriplets yet) that allows me to choose an evaluation time is the <textfield> tag.

 

So how to create a scriptlet that evaluates PAGE_NUMBER with evaluation time page and with evaluation time report at the same moment?

 

I will try, but I don't see this to be possible.

 

?

 

Ulf

 

 

 

 

By: Thomas Richter - hornet_f4c

RE: "page a / b" w dynam. width at right margin

2003-02-21 06:48

Hehe, lol. Good point, Ulf :)

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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