Adding More Fields

We interrupt the scheduled subreport programming to bring you this important message about adding more fields to your export and report.

The next article will show how to add a linked subreport to your report. Let’s say, for some unknown reason, we want to add phone numbers and email addresses to the gift report we have created. We didn’t initially plan for this so we did not include the Phone Number field in our export. Go ahead and add the Phone Type and Phone Number fields to your export. (Also add Constituent ID, we will need that later.)

One quick side note, when you move the phone fields to the output window this window will appear:

Leave the “For each Constituent, enter the number of Phones to export” box blank. Unlike other export file formats (Excel, csv) this is not required. Leaving it blank it tells the Export to export all phones (and emails) for each constituent.

The Export Output screen should look like this:

Close the report in Crystal Reports then run the export and save the file, being sure to replace/overwrite the existing mdb file.

Open the report in Crystal Reports and click the Refresh button (or press the F5 key). When the report refreshes you should see messages like these:

As you will soon see the database structure changed when we added the two phone fields. The report recognizes this and updates the database. You might receive multiple messages similar to these. Just click the OK button until they are all cleared.

At this point it doesn’t look like anything has changed with the report. Let’s see what has changed by opening the Database menu (top toolbar) and select the Database Expert. This will open the Database Expert window.

Expand the Current Connections folder and then the MDB file path. There is a new table in the MDB file named GfCnPh_1. This contains the two fields we added to the export. Double-click the GfCnPh_1 table to move it to the Selected Tables window on the right. Open the Links tab and double-click on the link between the GfCnPh_1 table and the GfCn table. Change the link to Left Outer Join. Click the OK button to return to the report. Your field explorer should look something like this, which now includes the new table and fields.

We can now return to our regularly scheduled program on subreports.