In the past I’ve blogged about how to generate dynamic HTML content based on the query string using the “HTML From Stored Procedure” module. With the latest release of Arena (v 2008.1) the “Advanced HTML Text” module also has some smarts built into it to render content specific to the query string.  We took advantage of this to provide an easy way for our finance department to produce a contribution statement for a member with any date range.  We added an instance of the HTML text module to the top of the contributions tab on the person detail page with input boxes that allow the user to enter a date range…

image 

If you look at the HTML, you can see that when the user clicks the “View Report” it is calling a Javascript function that opens a new window using the ReportPDFViewer page (this page renders a PDF version of any Reporting Services report, by passing parameters on the query string).

<script language="javascript">
   1:      
   2: function showGivingReport()    
   3: {
   4:     var sDate = document.frmMain.tbAttendStart.value;
   5:     var eDate = document.frmMain.tbAttendEnd.value;
   6:     window.open('/Arena/ReportPDFViewer.aspx?Report=/Arena/Contributions/ContributionStatements_ccv&OrganizationId=3&FromDate=' + 
   7:         sDate + '&ToDate=' + eDate + '&FundID1=34&FundID2=56&MinimumGift=0&IncludePledgeWithoutGift=True&Chapter=1&PersonGUID=##GUID##');
   8: }

</script>

<div class="normalText" style="padding-bottom: 5px;">
View contribution statement for the date range you specify below...
</div>
<table>
<tbody>
<tr>
<td class="formLabel">
Start Date/Time:
</td>
<td>
<input class="formItem" id="tbAttendStart" name="tbAttendStart">
</td>
<td class="smallText">
(mm/dd/yyy hh:mm am/pm)
</td>
</tr>
<tr>
<td class="formLabel">
End Date/Time:
</td>
<td>
<input class="formItem" id="tbAttendEnd" name="tbAttendEnd">
</td>
<td class="smallText">
(mm/dd/yyy hh:mm am/pm)
</td>
</tr>
<tr>
<td>
<br>
</td>
<td style="padding-left: 3px; padding-top: 4px;" colspan="2">
<button class="smallText" onclick="showGivingReport()">
View Report</button>
</td>
</tr>
</tbody>
</table>
<br>
<br>

We hard code some of the parameters like the report name, funds, etc., but the PersonGUID parameter needs to vary based on the person record that we’re currently viewing.  imageTo accomplish this, we include the “##GUID##” text.  The Advanced HTML Text module then evaluates the query string and looks for each of the query string parameters in the HTML content surrounded by the ## characters.  Because GUID is a query string parameter on the person detail page, the ##GUID## characters will be replaced with the person’s GUID value from the query string when rendering the HTML.

For this to work, you need to set a new setting on the Advanced HTML Text module…

image

Arena will only evaluate the query string when this setting is set to True (the default is False).

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>