mmchugh Posted November 28, 2001 Posted November 28, 2001 Is it possible to allow a field to slide or not slide on the basis of a calculation (in this case, of character length)? I have a columnar report with fixed column sizes. Most of my data fits in the column nicely, but a few entries are longer, and I would like only these to slide, so that my report would look like this :- xxxx xxx xxxxx xxx xxxxxx xxxx xxx xxxxx xxx xxxxxx xx xxx xxxxxxxx xxx xxxxxx xxxx xxx xxxxx xxx xxxxxx xxxx xxx xxxxx xxx xxxxxx xxxx xx xxxx xxxxxxxxxxxxx Only entries 3 and 6 would slide because they have data which is longer than the "default" field width. Thanks, Mike McHugh
mmchugh Posted November 28, 2001 Author Posted November 28, 2001 Sorry, the spacings didn't show up properly in my post - I'm re-posting with underscores instead of spaces. xxxx___xxx___xxxx___xxx___xxxxx xxxx___xxx___xxxx___xxx___xxxxx xx_xxx_xxxxxxxx_xxx_xxxxxx xxxx___xxx___xxxx___xxx___xxxxx xxxx___xxx___xxxx___xxx___xxxxx xxxx_xx_xxxx_xxxxxxxxxxxxx
Vaughan Posted November 28, 2001 Posted November 28, 2001 "Is it possible to allow a field to slide or not slide on the basis of a calculation (in this case, of character length)?" -- No. Of course, you could possibly display the record data using a calculation field that works out where to put the spaces. It might need to be in monospace font though.
tlsparker Posted November 28, 2001 Posted November 28, 2001 Yes. Because sliding is specific to a layout, you could duplicate your report layout and have a sliding and a non-sliding version. Create your calculation If (FieldLength > x, 1, 2) where FieldLength is a calculation field that returns the number of characters, x is the threshold beyond which you need to slide, and 1 and 2 are categorical variables. Make calculation result be text (you can use any other value or character besides 1 and 2, I just used them as an example). In your navigation script, assuming you are viewing or printing one record at a time, if the result is 1, go to the sliding layout. If the result is 2, go to the non-sliding layout.
Vaughan Posted November 28, 2001 Posted November 28, 2001 I think Mike wanted to slide specific fields, not all of them, based on a calculation. Slide fields 5 and 6 across but not 1 to 4. Sliding fields in a columnar report makes a mess! I think he wants a "column auto-resize" feature like Excel. [ November 28, 2001: Message edited by: Vaughan ]
mmchugh Posted November 28, 2001 Author Posted November 28, 2001 Thanks for the replies. I only want to slide a row when one field is more than a set size - otherwise they should stay in their columns (which is why an excel auto-size feature won't work either). I also realise that it would be much easier if I could just make the text wrap to a second line, but since this isn't for me, but for a friend, I don't have the final say ! Thanks again, Mike
Thom Posted November 29, 2001 Posted November 29, 2001 You can have fields slide conditionally, but only in Preview mode. Is that what you want?
mmchugh Posted November 29, 2001 Author Posted November 29, 2001 No, I need a hard copy, but I'd be interested in knowing how to do this, just for my edification ! Mike
Thom Posted November 30, 2001 Posted November 30, 2001 quote: Originally posted by Mike McHugh: No, I need a hard copy As in printed on paper? No problem. Use calc fields to specify width of columns and width between columns. You can use a different calc for each column, if you need each to be a different width. I used one calc field, making all columns the same width. Make 3 calc fields: columnWidth, spaceWidth, columnWidthSliding. The first two are fixed: columnWidth(calc,text) = "XXXXXXXXXX" spaceWidth(calc,text) = "X" columnWidthSliding depends on the character count of the data fields: columnWidthSliding(calc,text)= If( (Length(field1) > 10) or (Length(field2) > 10) or (Length(field3) > 10) or (Length(field4) > 10) or (Length(field5) > 10), "",columnWidth ) On your report layout, make as many copies of columnWidth as you have data fields, in this case 5. Make each one wide enough to show all the data that might appear in a data field. Spread them out across the header with gaps between them. In the gaps, place copies of spaceWidth, at least wide enough to show an "X". Tighten it up so that each field just touches its neighbor. Copy all the fields and move them straight down to the body, perfectly lined up with the originals. In the body, change each occurance of columnWidth to columnWidthSliding. Change the background and text colors of all the fields to the background color of the parts they're on. Place your header labels directly on top of corresponding columnWidth's, lined up on the left. Make copies of each columnWidthSliding. Place the copies directly on top of the originals. Change the copies to your data fields. Give the data fields appropriate text colors. Select everything and make it slide left. I used 10 X's for the field widths, but you would adjust them to suit your needs. The report should both preview and print the way you want it. I can send you a demo, if this is too confusing to follow.
mmchugh Posted December 1, 2001 Author Posted December 1, 2001 Thanks a lot for this, Thom - I'll certainly give it a try ! It looks fairly straightforward to me, but if it's not too much trouble could you send a demo, for reference ? Thanks again Mike [email protected]
mmchugh Posted December 3, 2001 Author Posted December 3, 2001 Sorry for the public posting ... Thom, Thanks for the demo. I tried to send this to your return email address, but it kept bouncing ... Mike
Recommended Posts
This topic is 8462 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now