Public Function GET_DATA(destination As String, populateHeadings As Boolean, rnax As reportsdna.RNAExtension, _ Optional reportConfig) As Range 'Function called by ReportsDNA to return the data for the report 'Returns a Range indicating the resultant dataset (to include field names) 'Argument Description '==================================================================== 'destination starting cell of output range. e.g. if destination = "C5" then row 5 contains field names (w/the first field name in cell C5), _ ' row6+ contains data. 'populateHeadings IF true, THEN include field names in data set ELSE only include data 'reportConfig reserved for future use - a dictionary object that contains report settings
Dim numFields As Integer, numRows As Integer Dim interpretParameters As Boolean 'flag that specifies if the parameters in a property should be returned statically (not evaluated) or dynamically (evaluated) interpretParameters = True 'evaluate parameters in each property since we are generating the report
'range containing field names and dataset Dim resultsrange As Range Set resultsrange = Range(Range(destination), Range(destination).Offset(numRows, numFields - 1))
Dim fields 'array containing field names Dim dataset 'array containing field names and dataset dataset = retrieveData(numFields, numRows, fields) 'generate data for report
'copy data to excel worksheet resultsrange.Value = dataset
'MANDATORY: set number of records and array containing field (column) names rnax.RecordCount = UBound(dataset) - LBound(dataset) rnax.columnheadings = fields
'MANDATORY return range that contains field names and dataset Set GET_DATA = resultsrange End Function