We, like many churches have used Registrations for camps and things, that often require us to give the campground our camper registration forms (for medical info, liability, etc.)  In the past, what I've been having to do is take the Registrants tab for a registration instance, export it to Excel, then create a Word Mail Merge that pulls in the registrant info that I need.  For each registration, it was kind of a pain.  Using some Lava that our partner DTS had created for Workflow Forms, I adjusted it so that it would work for Event Registrations.

I'm still planning on adding adjustments (such as the ability to choose how to sort the registrants), but I was able, with some help from DTS on some of the CSS stuff, to create a page that pulls a Registration Instance, and spits out all of the "ShowOnGrid" registrant attributes for each registrant in a nice, 1-page format.  It also adds a page break at each registrant so everything is nice and clean.

First thing I did was I created a page.  You can put this page wherever your heart desires that makes the most sense for your Rock Instance.  I have mine under Internal Page - > Support Pages.  I'm using the Blank Layout, because I wanted to ensure that only the pieces I wanted would be printed.1-PageSettings.png

I've set the page route to RegistrationForms/{RegistrationInstanceId} so that I am able to use the same page and just pull different Instances in (which will be useful in Phase 2 when I add a button the Registration Instance Page)

The only thing I have on this block is an HTML block.  I've given it Sql Lava and RockEntity Lava Commands.

2-PageBlockSettings.png

Next up is the fun part!  The HTML content itself!

{% stylesheet %}

@page { size: portrait; 
}
@media print {
    
.grid-table tfoot,
tr[id$=gTransactions_actionHeaderRow],
.panel-heading,
.panel-drawer,
.actions,
.alert{
    display:none !important;   
}
 #filterPrintDetails{display:block !important;}
 #filterPrintDetails h4{ display: none !important; }
div[id$=printArea]{
    break-inside: avoid;
}
.main-content .page-title {
    display:none;
}
  
.hidden-title{
    display:block !important;
}
  .no-printme  {
		display: none;
	}
  body {
    margin: 0;
    color: #000;
    background-color: #fff;
  }
 
  header, footer {
  display: none;
  }
  
  div.divHeader {
      position: fixed;
      top: 0;
    }
  div.wrapper {
    width: 75%; /* of body width */
    }
  div.pagebreak { page-break-before: always; } /* page-break-after works, as well */
}

  @media screen {
  
   div.wrapper {
    width: 75%; /* of body width */
    }
  }
 
 #filterPrintDetails{display:none;}

{% endstylesheet %}

{% if PageParameter.RegistrationInstanceId %}
    {% assign instanceId = PageParameter.RegistrationInstanceId %}
{% endif %}

{% sql %}SELECT  RegistrationRegistrant.Id AS RegistrantId, dbo.Person.NickName, dbo.Person.LastName, dbo.Person.Gender, dbo.Person.GraduationYear
FROM            dbo.RegistrationRegistrant INNER JOIN
                         dbo.Registration ON dbo.RegistrationRegistrant.RegistrationId = dbo.Registration.Id INNER JOIN
                         dbo.PersonAlias ON dbo.RegistrationRegistrant.PersonAliasId = dbo.PersonAlias.Id INNER JOIN
                         dbo.Person ON dbo.PersonAlias.PersonId = dbo.Person.Id
WHERE dbo.Registration.RegistrationInstanceId = {{PageParameter.RegistrationInstanceId}} AND dbo.RegistrationRegistrant.OnWaitList = 'False'
ORDER BY dbo.Person.LastName, dbo.Person.NickName
{% endsql %}


{% for item in results %}
{% assign id = item.RegistrantId | Remove:'{ Id = ' | Remove:' }' %}
{% registrationregistrant Where:'Id == {{id}}' %}

{% for registrationregistrant in registrationregistrantItems %}
{% assign registration = registrationregistrant.Registration %}
{% assign registrar = registration.PersonAliasId | PersonByAliasId %}
{% assign registrantPerson = registrationregistrant.PersonAliasId | PersonByAliasId %}
{% assign registrationInstance = registration.RegistrationInstance %}

        {% assign attributeCount = registrationregistrant.AttributeValues | Size | Minus:1 %}
        

{{registrationInstance.Name}}

{{registrantPerson.FullName}} (Submitted on: {{ registrationregistrant.CreatedDateTime }} by {{registrar.FullName}})

Address: {{registrantPerson | Address:'Home'}}
Gender: {{registrantPerson.Gender}}
Birthdate: {{registrantPerson.BirthDate | Date:'M/d/yyyy'}}
{% for i in (0..attributeCount) %}
{% if registrationregistrant.AttributeValues[i].AttributeIsGridColumn %} {{ registrationregistrant.AttributeValues[i].AttributeName }} {% if registrationregistrant.AttributeValues[i].ValueFormatted != "" %}{{ registrationregistrant.AttributeValues[i].ValueFormatted }}{% else %}No Value Entered{% endif %}
{% endif %} {% endfor %}
{% assign feeCount = registrationregistrant.Fees | Size %} {% if feeCount > 0 %}
{{ registrationInstance.RegistrationTemplate.FeeTerm | PluralizeForQuantity:registrantCount }}:
    {% for fee in registrationregistrant.Fees %}
  • {{ fee.RegistrationTemplateFee.Name }} {% if fee.Quantity > 1 %} ({{ fee.Quantity }} @ {{ fee.Cost | FormatAsCurrency }}){% endif %}: {{ fee.TotalCost | FormatAsCurrency }}
  • {% endfor %}
{% endif %} {% endfor %}
{% endregistrationregistrant %} {% endfor %}

RegistrationForms.txt

Basically, it starts out with a bunch of CSS stuff, required to make the page breaks work.

Next, it pulls in the RegistrationInstanceId from the page parameter, and pulls all the registrants via a SQL statement, using RegistrationRegistrant, Registration, PersonAlias, and Person, filtering to make sure that they aren't on the wait list.  Then it sorts them by LastName, NickName.

Then, via lava, for each Registrant, I pull the registration, the registrar, and the registrant as a person.  I start by giving each registration a header of the Registrants name, submitted by the Registrar's name, and give the Date/Time registered.  I also include several person attributes for the Registrant across all registrations: Address, Gender, and Birthdate (since these are Person attributes and not Registrant Attributes.  Then, we cycle through each Registrant Attribute for this registration instance that is marked "Show on Grid".  It lays them out into a nice two-column table.

RegistrationForms.png

After we get all the Registrant Attributes, we also want to pull any fees, optional or otherwise.  So we cycle through all of the fees in a similar way, laying them out with each registrant, formatted in a nice easy-to-read way.

Fees.png

At the very end, before the final {% endregistrationregistrant %} entity loop, we add a div class=pagebreak /div This lets the page know when to break the page, right after each registrant.