Archie, it's in the DR8.0 help that is not on-line yet.

Code:
Object oReport is a cDRReport
    Set psReportName to 'MyReport.dr'
 
    Procedure LoadRDSData String sReportId Integer iSibling Integer iLevel
        Variant[][] vData
        Integer iElements iElement iSubReports iSubReport iChannel
        tDRTableName[] ReportTableNames
        String sSubReportId sFolder sFileName
        Handle hoWorkspace
        UChar[] ucTableData
 
        Get RDSTableNames sReportId to ReportTableNames
        Move (SizeOfArray (ReportTableNames)) to iElements
        If (iElements > 0) Begin
            Decrement iElements
            For iElement from 0 to iElements
                Get AddRDSData ReportTableNames[iElement].sTableName iSibling iLevel to vData
                Send TableData sReportId ReportTableNames[iElement].iTable vData
                Get ConvertTableDataToJsonSampleData vData to ucTableData
  If (SizeOfArray (ucTableData) > 0) Begin
                    Move (Seq_New_Channel ()) to iChannel
                    If (iChannel >= 0) Begin
                        Get phoWorkspace of ghoApplication to hoWorkspace
                        Get psHome of hoWorkspace to sFolder
                        If (Right (sFolder, 1) <> "\") Begin
                            Move (sFolder - "\") to sFolder
                        End
                        Move (sFolder - ReportTableNames[iElement].sTableName - '.json') to sFileName
                        Direct_Output channel iChannel sFileName
                        Write channel iChannel ucTableData
                        Close_Output channel iChannel
                        Send Seq_Release_Channel iChannel
                    End
                End
            Loop
        End
 
        Get SubReportCount sReportId to iSubReports
        If (iSubReports > 0) Begin
            Decrement iSubReports
            For iSubReport from 0 to iSubReports
                Get SubReportId sReportId iSubReport to sSubReportId
                Send LoadRDSData sSubReportId iSubReport (iLevel + 1)
            Loop
        End
    End_Procedure
End_Object
 
Object oRunReportButton is a Button
    Set Label to 'Run Report'
 
    Procedure OnClick
        Get RunReport of oReport
    End_Procedure
End_Object