CTO Blog

In this post I present an example add-in that adds a new report category and one new report to GiftWorks. Unfortunately there is way too much stuff going on here to explain everything, but the ambitious user should be able to make some headway with adding custom reports to GiftWorks. There are two files that are necessary to add a new report. You need to write an add-in file (newreport.xml) that defines the add-in and tells GiftWorks about the new report category and the new report. The other file (GRDF-donors-by-number.xml) tells GiftWorks what to display in the report. For this example to work, both files need to reside in the same directory.

newreport.xml 

   1:  <gml id="missionresearch_newreport">
   2:      <info>
   3:          <title>New Report</title>
   4:          <versions>
   5:              <version match="2.0" module="version2" />
   6:          </versions>
   7:      </info>
   8:      <module id="version2">
   9:          <objects>
  10:              <object id="Handler" type="vbscript">
  11:                  <![CDATA[
  12:                      Const CategoryKey = "my-reports"
  13:                      Sub AddNewReportCategory()
  14:                          Dim oCat
  15:                          Set oCat = App.Modules.GiftWorks.Reports.GetNewCategory
  16:                          oCat.Key = CategoryKey
  17:                          oCat.Name = "My Reports"
  18:                          oCat.Description = "These are my reports that I have built."
  19:                          App.Modules.GiftWorks.Reports.Categories.Add oCat
  20:                      End Sub
  21:                      Sub AddNewReport()
  22:                          Dim oReport, oCat
  23:                          For Each oCat In App.Modules.GiftWorks.Reports.Categories
  24:                              If oCat.Key = CategoryKey Then
  25:                                  Set oReport = App.Modules.GiftWorks.Reports.GetNewReport
  26:                                  oReport.Key = "donors-by-number"
  27:                                  oReport.Name = "Donors By Number Of Donations"
  28:                                  oReport.Description = "This report let's me filter my donors by the number of gifts they have given."
  29:                                  oReport.Path = App.Modules.missionresearch_newreport.Path
  30:                                  oCat.Reports.Add oReport
  31:                              End If
  32:                          Next
  33:                      End Sub
  34:                      Sub EventHandler(Ev)
  35:                          Select Case Ev.Key
  36:                              Case "reports-categories"
  37:                                  AddNewReportCategory
  38:                              Case "reports-categories-reports"
  39:                                  AddNewReport
  40:                          End Select
  41:                      End Sub
  42:                  ]]>
  43:              </object>
  44:          </objects>
  45:          <taskmenu/>
  46:          <handlers>
  47:              <handler id="reports-categories" object="Handler" />
  48:              <handler id="reports-categories-reports" object="Handler" />    
  49:          </handlers>
  50:      </module>
  51:  </gml>


This file should look familiar to those that have been following along with my blog. You can view previous posts to see how to install add-ins with GiftWorks. There are two lines that I'll explain. Line 26 assigns a key to the new report. This key corresponds to the filename of the GRDF report. Line 29 tells GiftWorks where to look for the report definition file. In this case it uses the Path property for the current module. "missionresearch_newreport" is the Id of this module as identified on Line 1.

download files

You can download both files: newreport.xml, GRDF-donors-by-number.xml

what's next

Like I said, I don't go into a lot of detail. The GRDF file can be very confusing so I'll wait for interest and/or feedback before I spend too much time describing its functionality. Please let me know if you want to see more about either file.

« Explaining GiftWorks Permissio... | GiftWorks On Windows Vista »

Related Posts:
GiftWorks 2008 Standard Ships
GiftWorks on TechSoup
November 14 2006
Comments [1]
Filed under:


tree cube are boy deliver right english you right
8/19/2008 1:17 PM UTC
Name
E-mail
Home page

Comment (HTML not allowed)  

Want More? Try browsing our other Mission Research developer blogs...
Steve Fafel, Mike Greineder, Jonny Leaman

Flickr Show

Past Articles


Ads



Other Links