thinking out loud…

…ramblings of Peter Amiri


All of the posts under the "PDF" tag.

Roster sorting bug fixed…

There was a bug that was causing the generated roster files to not be sorted in the proper order. In fact the records were being returned from the database in random order. The resulting pdf files looked pretty :-) but were not in phone directory order. This bug has now been fixed. The roster files now have two sort levels applied. Initially all Head of Household (HoH) records are selected from the database and sorted in Last Name order. Then for each HoH record, all family records are selected and ordered in descending age order.

Tutorial: Generating your first PDF roster

In this post, we’ll take a look at the process of generating a PDF roster. We will begin by logging into the eMembership system, generating the necessary export file, and uploading that file to the Roster Creator system. Then we will generate the PDF roster. So lets get started.

First thing we need to do is to log into the eMembership system. Once you have logged into the system you should see a screen that looks similar to the screen shot below:


Now that you are logged into the eMembership system. Scroll down to the bottom of the page and click on the “Download Excel Community List” button. This button will generate an export file that will begin to download to your computer.


Depending on which operating system you are on and what browser you use, you should be given a choice of where to save the file to. Remember where you save this file since we will need it to upload to the Roster Creator system.

One thing to note about this file. Although the button says that it is going to generate an Excel file, it is actually a simple text file in a special format that Excel can understand. If you double click on the file and have Microsoft Excel (or another software the understands .csv files) installed. The file will be opened and converted to a spreadsheet. Be careful that you do not do that. We need the file to remain in text format and don’t want to upload a spreadsheet to the Roster Creator system.

If you look at the content of the export file with a text editor you will see the file contents to be similar to the figure below:


Now lets, log into the Roster Creator system. If you haven’t already registered and validated your account, please follow the tutorial to do so. Once you are logged in you should see a screen like below:


If this is the first time you are logging in. You will not have any existing rosters in the system so the roster list is going to be empty and a warning message will let you know that there are no rosters in the list.


Now we will start the process of uploading the community roster file we exported from the National eMembership system. You can start the upload process by using two options. Either click on the ADD button which is to the right of the table labels or click on the menu option called “Add New Roster”. Once you click either of these two links you should see the upload screen that is pictured below:


On this screen you can give this roster a name, this name is used and printed in the header of the roster pages. You can also enter a community name which is also used in the header of the generated roster to complete the following statement “Spiritual Assembly of the Baha’is of {community name}”. The third item to be filled out on this screen is a file selector that you use to select the file you downloaded from the eMembership system. When all three fields are completed click on the “Upload Now” button.

The system will now process the upload file and if everything goes well will display the roster detail screen. You will also see some statistics information listed for the roster. This information could be useful when looking back to see how the community membership has changed over the coarse of several months or even years.


Now lets generate our PDF document. Select the roster you want to generate a PDF for and click on the “Full Community” link next to the Roster label. The system will generate the PDF document and open it in a new browser window. You can use your browsers Save As feature to save the PDF and use it how ever you like. The file could be emailed to community member or simply printed in order to make copies for the community. The PDF roster will look like the figure below with the each family grouped together, their address and phone number printed and each family member identified. If your community has sector feast the feast sector will also be identified on the printed roster. If however your community has not adopted feast sectors then this information will be left off the printed roster.


This formated PDF document can now be printed, saved, or emailed to the community members. Our community roster is always in a state of flux, due to the continuous stream of move ins and move outs. Using the Roster Creator we are able to generate formated rosters fairly quickly which means we can continuously keep our community members updated.

I hope you also find this system useful.

Begin Roster Creator

I had some time during the Memorial Weekend holiday and decided to sit down and do some coding. One of the projects on my list of things to do, has been to pull together some scripts that I’ve created over the years for generating nicely formated community rosters based on the National eMembership system.

Several years ago I took over the maintenance of our communities roster. As the time we had one list that was maintained for the printed roster, another that was used for the phone tree system, yet another that was used annually for printing ballots, and all these were separate from the list maintained by National. One of the first things I did was to standardize on the National list as the source for all the other lists we used.

This forced us to proactively clean up the National list and keep it clean. Once I made the decision to use the eMembership system as the source, I began to use export files from this system and write merge letters and form for generating our printed roster and annual ballots and such.

Eventually this process became streamlined enough that my scripts were not changing much and had become pretty stable. I eventually got the idea to try to pull my scripts together and create a site that others could use to benefit from my scripts. This weekend was when I finally got a chance to realize this dream.

I began coding a site using an open source project I’m involved with called CFWheels. It is a port of the Rails project to the CFML language and runs on the Adobe ColdFusion engine as well as the open source Railo engine.

Saturday and Sunday were spent building the framework of the application and creating the basic login, signup, password recovery systems. By Monday I was ready to start working on the actual PDF generation scripts. I pulled most of that together and wanted to get others into the system to kick the tires and get feedback. So I started to get ready to invite a handfull of users from the surrounding communities to test the system.

So I published the code on one of my domains and the eMembership Roster Creator system was born.

get_footer() ?>