Question

Photo of Joey Mouton

0

printing reports

how are you printing reports?

For example, class lists for all small groups with page-break for each class(many classes). 

Use ReportBuilder? other tool?

disclaimer: new to Rock, getting prepared for migration from "A" software.

  • Photo of Michael Garrison

    1

    If you already have a list that you want printed, you should be able to print most things right from Rock- it has printing-specific CSS that works nicely and hides the navigation menus, etc.

     

    If you don't already have a page that you want, you can create it using a Dynamic Report (with an associated Data View and Report) block on a custom page you create that allows you to select one class at a time and then print directly from Rock (see http://www.rockrms.com/Rock/BookContent/6/77#dynamicreportblock for more information). Or use MailMerge from that dynamic report to have finer control over the formatting and output Word files.

     

    You can alternately use a Dynamic Data block with Formatted Output that groups the individuals by the class, inserting a "style="page-break-after:always" - formatted DIV when the "current" row has a different class identified in the data than the previous row- that should result in a page break between each class on a single print job.

    Try printing http://rock.rocksolidchurchdemo.com/page/5392 where I used the following Dynamic Data query:

    SELECT p.[NickName] + ' ' + p.[LastName] 'Person',g.[Name] 'GroupName'
        FROM [GroupMember] gm
            LEFT JOIN [Person] p ON p.[Id]=gm.[PersonId]
            LEFT JOIN [Group] g ON gm.[GroupId]= g.[Id]
        WHERE g.[GroupTypeId]=25 -- Small Group GroupTypeId
        ORDER BY g.[Id]

    and the following Formatted Output:

    {% assign CurrGroup='' %}
    {% for row in rows %}
        {% if CurrGroup <> row.GroupName %}
            {% if CurrGroup != '' %}
                <div style="page-break-after:always;">&nbsp;</div>
            {% endif %}
            {% assign CurrGroup=row.GroupName %}
            <h1>{{ row.GroupName }}</h1>
        {% endif %}
        <p>{{ row.Person }}</p>
    {% endfor %}

    You should see that even though it looks like one long list on the screen, when you print it starts a new page for each class. If you'd like checkboxes or anything else around the person's name, you can add it around {{ row.Person }}. If you need more information (such as their e-mail address, to take an easy example), you'd add something like ", p.[Email]" to the first line of the query, and then output something like <p>{{ row.Person }} - {{row.Email }}</p> in the Formatted Output instead of just their name. For other items you'll have to start pulling from the AttributeValue table which we can help with, but is somewhat beyond the scope of this initial question

     

    Let us know if you need other examples or options- Rock is super flexible so there's no "one right way" to do many things. =) 

  • Photo of Austin Spooner

    0

    Michael, thank you for sharing this information. I tried your example and ran into a small issue. As you can see in my screen shot it does not print each class on a separate row.  Do you have any other tips on making that happen?


    2016-08-09_08-48-32.png

    • Michael Garrison

      I'm assuming you meant "does not print each class on a separate PAGE". If I misunderstood please let me know. But it only does the page breaks when you actually print...since there's no such thing as a "page" on a webpage =) Have you tried printing the list?