IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Page 1 of 2 1 2 >
Topic Options
#39218 - 04/16/12 10:57 AM Snapping to a group (with dynamic data lines)
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
OK - this will hopefully make sense to someone who knows presstalk well.

The formula below (which is within the .y box of a text box) tells my text box where to sit vertically depending on the size of grouped categorys(4, 5, & 6) and when they appear. (its a disclaimer footer text that should sit at the bottom of the account details (about 0.3cm))

Briefly, there is a group of dynamic data boxes which hold information about a clients account. These boxes sit neatly above each other on an A4 page. The client may have all 3 types of account, in which case all three groups appear. They may have any 1 of the accounts, in which case just the 1 account appears - (so if its account types 5 & 6 only that appears, it shows where account type 4 would have done. If its just 6 then that moves to where 4 would have been). As snapping groups is not an option, then the following formula below (at its maximum) appears in the .y location of the group boxes. The formula tells each group how to behave depending on if the group above it displays.


=if((&Condition4 and &Condition5),&GlobalVariable1,if((&Condition4 and not(&Condition5)),&group_height1,if((not(&Condition4) and (&Condition5)),&group_height2,if((not(&Condition4) and (&Condition5) and(&Condition6)),&group_height3,if((not(&Condition4) and ((not(&Condition5) and(&Condition6)))),&group_height4,1.6505)))))

This formula works well for all variations except for where '4' doesn't appear but '5' & '6' do....

As I am no expert I am struggling to find the final piece of this jigsaw!

Top
#39221 - 04/16/12 01:02 PM Re: Snapping to a group (with dynamic data lines) [Re: DeanB]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Dean,

This looks like a very complex expression, and difficult to tell what's wrong without seeing the conditions themselves.

However, it sounds as if if you were able to snap groups together, it would work, instead of having to use this complex expression. If that's the case, then there may be a simpler way to simulate the snapping of groups.

What you can do is create a global variable of type measure. Then, in your first group, in the PressTalk After of the last object inside the group(but not the group itself!), give the global variable the value of &physical.y, with an expression like this one:

&MyGlobalVariable := &physical.y

This will store the y position where PlanetPress is currently at. Then, in the second group's Top property, instead of a fixed value, you will give it:

=&MyGlobalVariable

To move it to the position that you've stored. It's possible that the position will be off a little, so you may have to add a bit to the value. For example, if you wanted to move the second group 0.1 inch further down:

=&MyGlobalVariable + 0.1

And that will put the second group in place. Then, you can repeat the same logic for group 2, go in the last object of group 2 and put &MyGlobalVariable := &physical.y in it's PressTalk After, then go into group 3, adjust the top position to &MyGlobalVariable plus whatever value you want to give, and then repeat for any other groups.

In my opinion, this is much easier than trying to conditionally place them with a huge condition that is quite difficult to follow.

Regards,
Raphaël Lalonde Lefebvre

Top
#39229 - 04/17/12 03:16 AM Re: Snapping to a group (with dynamic data lines) [Re: Raphael Lalonde Lefebvre]
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
Hi Raphael,

That works great - but only if all three boxes are there or box 1 or 2. If box 1 and/or box 2 are not there (because the condition states that there is no value in the data) then everything disappears as there is nothing to anchor it to. (hence the complex items)...

Top
#39230 - 04/17/12 03:59 AM Re: Snapping to a group (with dynamic data lines) [Re: DeanB]
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
Thinking about it, If i use another dynamic box in each of my groups and create GroupVariable1, GroupVariable2 and GroupVariable3. Is there a command that can do a AND/OR i.e. 1 AND/OR 2 AND/OR 3? Or is this just wishful thinking?

Top
#39231 - 04/17/12 10:24 AM Re: Snapping to a group (with dynamic data lines) [Re: DeanB]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
DeanB,

If the boxes inside the group are conditional, what you can do is simply put &MyGlobalVariable := &physical.y in the PressTalk After of all the boxes. This way, even if one of them is false, the others will just move up(I assume they are snapped) and the &physical.y will still get the proper value.

Here, I have uploaded a small example on an FTP that I've just created:

Host : ftp.ca.objectiflune.com
Folder : app-ftp-users/OL28/
Username : OL28
Password : LVjpd52D

Feel free to check it out(it will remain open for 10 days), it will show you three groups snapped together, each containing three conditional boxes. On the first page, they all show up, but on the subsequent pages, different combinations of boxes appears, yet the snapping is always done correctly.

Regards,
Raphaël Lalonde Lefebvre

Top
#39233 - 04/17/12 11:39 AM Re: Snapping to a group (with dynamic data lines) [Re: Raphael Lalonde Lefebvre]
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
I shall have a look at your file, thankyou.

My boxes are conditional, but its the actual group that has the condition set to it: All the internal boxes (variable data) is grouped and then the condition is set to that group.

Top
#39234 - 04/17/12 11:48 AM Re: Snapping to a group (with dynamic data lines) [Re: DeanB]
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
Thanks for your help, that's almost it - the only difference is that the entire group on my work must be true or false, so My group 1, 2 & 3 are conditioned to appear/not appear and when the top one is not there, i.e. Group1 then it doesnt work - Does this make sense?

Top
#39236 - 04/17/12 01:25 PM Re: Snapping to a group (with dynamic data lines) [Re: DeanB]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
This can be worked around by creating a PressTalk object on your page that will give an initial value to the &YPosition variable(or however you called it). This object should ideally be the first object in the list of objects for the page. This way, if group1 is skipped, group2 will still have a default value to put it's top position at.

I have uploaded an example, using the same form, that makes Group1 conditional. On the last data page, the condition becomes false and Group1 disappears, yet Group2 will move up to the proper place. Try using a similar logic in your own form.

Regards,
Raphaël Lalonde Lefebvre

Top
#39246 - 04/18/12 04:10 AM Re: Snapping to a group (with dynamic data lines) [Re: Raphael Lalonde Lefebvre]
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
Genius - Thank you very, very much. :-)

Top
#39256 - 04/19/12 03:05 AM Re: Snapping to a group (with dynamic data lines) [Re: DeanB]
DeanB Offline
OL Toddler

Registered: 04/05/12
Posts: 37
Loc: Harrogate, UK
Oh - Quick question - Why does the manipulation become uneditable on my bottom box once I apply the formula into the position Top box?

Top
Page 1 of 2 1 2 >