This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# just to follow the pattern of using a table to print the report | |
# for this one a table is not really necessary but we use it anyway for a pattern | |
fmt0 = '<td><B>{0}</B></td>' | |
fmt1 = '<td>{0}</td>' | |
fmt2 = '{0}<br/>' | |
fmt3 = '<td>{0}/{1}</td>' | |
# define a shorthand function to make it easy to test for null or empty string | |
def HasValue(value): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Constants | |
#--------------------------------------------------- | |
StartingDate = "'1/4/15'" # Start date for contributions. Notice single quotes are important inside double quotes | |
EndDateOffset = '-7' #offset in days from current date to be used as endpoint. (example: '-7' would place the end date on this day last week) | |
#Column Header for Row 0 containing Dates | |
col0label = "{id: 'Date', label: 'Date', type: 'date'}" | |
#Column Headers for Row 1-10 value columns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GivingUnits = ''' | |
DECLARE | |
@startdt DATETIME | |
, @enddt DATETIME | |
, @campusid INT = 0 | |
, @pledges INT = 0 | |
, @nontaxded INT = 0 | |
, @includeUnclosed INT = 1; | |
SET @enddt = GETDATE(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
class AttendTrend(object): | |
pass | |
class ContributionTrend(object): | |
pass | |
Data.AttendTrendList = [] | |
Data.ContributionTrendList = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
D1 = datetime.date.today() | |
sqlscript = ''' | |
SELECT | |
p.PeopleId, | |
p.FamilyId, | |
p.Name2, | |
p.FirstName, | |
p.PreferredName, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GivingUnits = ''' | |
DECLARE | |
@startdt DATETIME | |
, @enddt DATETIME | |
, @campusid INT = 0 | |
, @pledges INT = 0 | |
, @nontaxded INT = 0 | |
, @includeUnclosed INT = 1; | |
SET @enddt = GETDATE(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GivingUnits = ''' | |
DECLARE | |
@startdt DATETIME | |
, @enddt DATETIME | |
, @campusid INT = 0 | |
, @pledges INT = 0 | |
, @nontaxded INT = 0 | |
, @includeUnclosed INT = 1; | |
SET @enddt = GETDATE(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
@startdt DATETIME = '1/1/15' | |
, @enddt DATETIME = '12/1/15' | |
, @campusid INT = 0 | |
, @pledges INT = 0 | |
, @nontaxded INT = 0 | |
, @includeUnclosed INT = 1 | |
;WITH givers AS ( | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlpeople = q.QuerySqltoList('GivingUnits',"") | |
print '<html>' | |
print '<head>' | |
print '<style>' | |
print 'table, th, td {' | |
print ' border: 1px solid black;' | |
print '}' | |
print 'th, td {' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template = ''' | |
<html> | |
<head> | |
<style> | |
table, th, td { | |
border: 1px solid black; | |
} | |
th, td { | |
padding: 2px; |
NewerOlder