FAQ/DeleteReportSet.md
... ...
@@ -0,0 +1,38 @@
1
+#DeleteReportSet()
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+The DeleteReportSet method is used to delete reports from your storage system. This method can be overridden in your [[CustomAdHocConfig|http://wiki.izenda.us/Integration/Tutorials/Customizing-Izenda-Settings]] class. The code samples below demonstrate method of overriding the method to implement custom functionality using both [[DatabaseAdHocConfig|http://wiki.izenda.us/FAQ/Storing-Reports#Database-Mode]] and [[FileSystemAdHocConfig|http://wiki.izenda.us/FAQ/Storing-Reports#File-System-Mode]].
8
+
9
+##DatabaseAdHocConfig Sample
10
+
11
+```csharp
12
+/* BEGIN Database Mode Code Sample */
13
+ string sql = string.Format(@"
14
+ DELETE FROM {1}
15
+ WHERE Name='{0}'",
16
+ reportName.Trim(),
17
+ SavedReportsTable);
18
+ System.Data.IDbCommand command = Izenda.AdHoc.AdHocContext.Driver.CreateCommand(sql);
19
+ try
20
+ {
21
+ command.ExecuteNonQuery();
22
+ }
23
+ finally
24
+ {
25
+ if (command.Connection.State == System.Data.ConnectionState.Open)
26
+ command.Connection.Close();
27
+ }
28
+/* END Database Mode Code Sample */
29
+```
30
+
31
+##FileSystemAdHocConfig Sample
32
+
33
+```csharp
34
+/* BEGIN Filesystem Mode Code Sample */
35
+ string filePath = Path.Combine(ReportPath, reportName);
36
+ File.Delete(filePath + ".xml");
37
+/* END Filesystem Mode Code Sample */
38
+```
... ...
\ No newline at end of file