#DeleteReportSet()

##Preface

The DeleteReportSet method is used to delete reports from your storage system. This method can be overridden in your CustomAdHocConfig class.

##Usage If you have overwritten SaveReportSet() to change the location where reports are saved, it is necessary to use this override to indicate where the deletion will occur.

##Examples The code samples below demonstrate method of overriding the method to implement custom functionality using both DatabaseAdHocConfig and FileSystemAdHocConfig.

###DatabaseAdHocConfig Sample

/* BEGIN Database Mode Code Sample */
public override void DeleteReportSet() {
    string sql = string.Format(@"DELETE FROM {1} WHERE Name='{0}'", reportName.Trim(), SavedReportsTable);
    System.Data.IDbCommand command = Izenda.AdHoc.AdHocContext.Driver.CreateCommand(sql);
    try
    {
        command.ExecuteNonQuery();
    }
    finally
    {
        if (command.Connection.State == System.Data.ConnectionState.Open)
        command.Connection.Close();
    }
}
/* END Database Mode Code Sample */

###FileSystemAdHocConfig Sample

/* BEGIN Filesystem Mode Code Sample */
public override void DeleteReportSet() {
    string filePath = Path.Combine(ReportPath, reportName);
    File.Delete(filePath + ".xml");
}
/* END Filesystem Mode Code Sample */