Jump to content

Print Two Columns, No Blank Spaces, Field Label and Date (if any) AND centered


surgite71

This topic is 2499 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Greetings and thanks for giving this a look!

I am rebuilding a client's database that was done formerly in PHP. I'm now using FM 16 Pro Advanced. There is one print layout I'm having trouble recreating.

There are a number of data fields the realtors fill out...some get filled in, other times some don't. In addition it needs to print the name of the data field then the data itself, so for instance "Construction  Stick Built". I've figured out how to go through and print only the fields (and their labels) that have data. The issue I have is with the spacing in the columns.

In the attached photo, you can see that each label/data line is neatly organized in a column so that the space between the label and the data is consistent all the way down the column. It's not centered, and it's not justified...it calculates for each row of data, how much space is needed in that row to line everything up.

Would I need to determine how wide the column is, and then calculate how long the combo of the field name and data is (with that nice separator space in between them) and then use that to space everything? Seems like a lot of calculations going on but maybe that's what needs done?

I also need to figure out if the data will require it being in 1 column or using a 2 column like the one in the picture. I believe I can figure that out...it's this 2-column alignment/spacing that's got me tied up.

 

Thanks!

fullsizeoutput_1a3a.jpeg

Link to comment
Share on other sites

Filemaker has a built-in capability to print data in columns - however, the items must be individual records, not fields:
http://www.filemaker.com/help/16/fmp/en/#page/FMP_Help%2Fprint-records-columns.html 

 

15 minutes ago, surgite71 said:

I've figured out how to go through and print only the fields (and their labels) that have data. The issue I have is with the spacing in the columns.

I am not sure that's a direction worth pursuing. In any case, we don''t know how you "figured out" what you have now, so it's difficult to say how to improve on it.

 

Link to comment
Share on other sites

7 minutes ago, comment said:

Filemaker has a built-in capability to print data in columns - however, the items must be individual records, not fields:
http://www.filemaker.com/help/16/fmp/en/#page/FMP_Help%2Fprint-records-columns.html 

 

I am not sure that's a direction worth pursuing. In any case, we don''t know how you "figured out" what you have now, so it's difficult to say how to improve on it.

 

Thanks!

For each field I need to check to see if there's data, I created a subsequent calculation field. I used If and IsEmpty combination, such as:

c_StyleAge_Property = If ( IsEmpty ( StyleAge_Property ) ; "" ; "Style/Age: " & StyleAge_Property )

Then using the merge fields on the layout, it'll bump up lines that do not have any values. So on the layout, I'm using the calculation field I created (c_StyleAge_Property), not the original field (StyleAge_Property). 

After thinking about it further, my columns can hold 44 characters. In the first instance with the "Construction  Stick Built", that is 25 characters. So if I take 44-25, that tells me I need to add 19 spaces on that row so it's lined up. I'd need 10 in front and 9 in back since 19/2 doesn't come out as a round number.

Does that help?

 

Edited by surgite71
Clarification purposes
Link to comment
Share on other sites

Ok...actually I realized what I only need to do is add spaces on the left hand side...the rest of it takes care of itself.

So I guess my question really is...how do I add X amount of spaces to the front of a text string I'm creating with a calculation. My calculation will tell me how many spaces I need for each row...I just can't find a Filemaker script step that lets me add X number of spaces. Thanks!

 

Link to comment
Share on other sites

4 minutes ago, Ocean West said:

If the output is all in one text Calc then use the char(9) or a tab then use tab stops on the field. 

Thanks! Since each line is different for the number of characters to add...there's no way to do a loop/if-then in a Calculation is there?

So let's say for line 1, I need 5 spaces added to the front of my text...then line 2 needs 12....line 3 needs only 1. I can't think of a way to tell the calculation to loop through and add X number of spaces per line.

Link to comment
Share on other sites

2 hours ago, Lee Smith said:

I believe the second one will do the trick! And I'm embarrassed to say...this will be my first use/install of a custom function...I've always just used scripts! Time for something new! I'll give it a try tomorrow as I honestly have to refer to YouTube to see how to make use of/call it.

Thanks @Lee Smith!!!

Link to comment
Share on other sites

If this one works for you, you will wonder why you resisted for so long.

BTW. most custom functions can be put into a regular calculation, unless they are recursive.

Link to comment
Share on other sites

This topic is 2499 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.