June 16, 20178 yr 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!
June 16, 20178 yr 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.
June 16, 20178 yr Author 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 June 16, 20178 yr by surgite71 Clarification purposes
June 16, 20178 yr Author 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!
June 16, 20178 yr If the output is all in one text Calc then use the char(9) or a tab then use tab stops on the field.
June 16, 20178 yr Author 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.
June 16, 20178 yr Something like this? http://www.briandunning.com/cf/1429 of http://www.briandunning.com/cf/776 Maybe
June 17, 20178 yr Author 2 hours ago, Lee Smith said: Something like this? http://www.briandunning.com/cf/1429 of http://www.briandunning.com/cf/776 Maybe 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
June 17, 20178 yr 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.
Create an account or sign in to comment