Church Directory - List Children on Same Line

Moderators: Moderators, Tech Support

Zorak
Tech Support
Tech Support
Posts: 2617
Joined: Thu May 13, 2004 8:59 am
Location: PowerChurch Software
Contact:

Re: Church Directory - List Children on Same Line

Post by Zorak »

Create a variable to assemble the top line names and then output it as the top line in the family group footer.

hailescenterpoint
Posts: 12
Joined: Tue Jul 19, 2016 7:33 am

Re: Church Directory - List Children on Same Line

Post by hailescenterpoint »

Zorak wrote:Create a variable to assemble the top line names and then output it as the top line in the family group footer.
Ok.. I put this code in the variable. With this same set up as the m.children (initial value etc).

Code: Select all

ALLTRIM(lastname_a)+", "+IIF(pers_no==1, ALLTRIM(firstname_b), "error")+IIF(pers_no==2, " &1 "+ ALLTRIM(firstname_b), "")
I get:
"Smith, error"

I get (&1 is my checking thing):
"Smith, error &1 Kelly"

Why isn't the first spouse name showing up? They all have number 1 assigned to them.
Why are some of the names only showing "error" and not even showing the spouses name?
Is there any way you can tell me exactly how to write this? Or am I asking for something that is too complicated?

Zorak
Tech Support
Tech Support
Posts: 2617
Joined: Thu May 13, 2004 8:59 am
Location: PowerChurch Software
Contact:

Re: Church Directory - List Children on Same Line

Post by Zorak »

We have a service where we can create the report for you. Prices start at $120 and this report would probably be quoted at that price. At this point, I can't write any more of the report for you out of fairness to others who pay for the service, but I can offer support and guidance on the report that you are writing yourself.

In your quoted expression, you are overwriting the contents of the variable with every record. Remember to add your variable name + whatever expression is, so that you don't lose previous names in the family. You are coming up with "error" when there are people in the family that are not person number 1, which only the first person in the family is.

m.parents + alltrim(firstname_b)

hailescenterpoint
Posts: 12
Joined: Tue Jul 19, 2016 7:33 am

Re: Church Directory - List Children on Same Line

Post by hailescenterpoint »

Zorak wrote:We have a service where we can create the report for you. Prices start at $120 and this report would probably be quoted at that price. At this point, I can't write any more of the report for you out of fairness to others who pay for the service, but I can offer support and guidance on the report that you are writing yourself.

In your quoted expression, you are overwriting the contents of the variable with every record. Remember to add your variable name + whatever expression is, so that you don't lose previous names in the family. You are coming up with "error" when there are people in the family that are not person number 1, which only the first person in the family is.

m.parents + alltrim(firstname_b)
Oh ok. I'll keep that in mind. I wish I could find a list of what each function, field, and variable meant so I could understand what I was doing. I also wish I could just edit the half-page directory code to my own specifications. All I wanted was to swap the phone number and children lines. :?

Would creating two separate variables help in any way? Or would it be better to just use one?
m.headFN --> IIF(pers_no=1, m.headFN+ALLTRIM(firstname_b),"")
m.secondFN --> IIF(pers_no=2, m.secondFN+ALLTRIM(firstname_b),"")

From my understanding m.headFN would print the first record in the family. However, even after putting the variable in the expression as shown above it keeps printing the last record. Would m.children cause this problem?

Zorak
Tech Support
Tech Support
Posts: 2617
Joined: Thu May 13, 2004 8:59 am
Location: PowerChurch Software
Contact:

Re: Church Directory - List Children on Same Line

Post by Zorak »

You could have this:

Code: Select all

m.headFN = IIF(pers_no=1, ALLTRIM(firstname_b),m.headFN)
m.secondFN = IIF(pers_no=2, ALLTRIM(firstname_b),m.secondFN)

m.parents = m.headFN + m.secondFN
m.parents would be what is output onto the report

The problem you are having with your variables as you listed is you are adding m.headFN+firstname OR if the person is not #1, wiping out the value of m.headFN. That's the difference between those variables as I listed them and how you had them. The "keep this variable value" is in the ELSE of that IIF.

hailescenterpoint
Posts: 12
Joined: Tue Jul 19, 2016 7:33 am

Re: Church Directory - List Children on Same Line

Post by hailescenterpoint »

Zorak wrote:You could have this:

Code: Select all

m.headFN = IIF(pers_no=1, ALLTRIM(firstname_b),m.headFN)
m.secondFN = IIF(pers_no=2, ALLTRIM(firstname_b),m.secondFN)

m.parents = m.headFN + m.secondFN
m.parents would be what is output onto the report

The problem you are having with your variables as you listed is you are adding m.headFN+firstname OR if the person is not #1, wiping out the value of m.headFN. That's the difference between those variables as I listed them and how you had them. The "keep this variable value" is in the ELSE of that IIF.
Yipeee! It worked! Thank you!
One more question... for some reason the page setup won't let me set the margins. Any ideas as to why?

Zorak
Tech Support
Tech Support
Posts: 2617
Joined: Thu May 13, 2004 8:59 am
Location: PowerChurch Software
Contact:

Re: Church Directory - List Children on Same Line

Post by Zorak »

I'm not sure why that is, but it is the normal behavior of that Page Setup screen.

What I normally do is change the Print Area to "Whole Page" so that no margins are inherited at all, then manually set the fields and bands on the report layout to fit into the margins I choose.

Post Reply