2fc0de2bc7056603ef28206347cabacd17b096bc
FAQ/ProcessDataSet.md
| ... | ... | @@ -142,4 +142,31 @@ Private Function GetLocalTime(utcTime As DateTime) As DateTime |
| 142 | 142 | End If |
| 143 | 143 | Return utcTime.AddMinutes(DirectCast(HttpContext.Current.Session("IZR_TimeZone"), Integer)) |
| 144 | 144 | End Function |
| 145 | +``` |
|
| 146 | + |
|
| 147 | +##Example: Fetching a Column Used in a Report |
|
| 148 | + |
|
| 149 | +Reports (report parts) can be referenced using the ReportSet.Reports collection. Here is a list of report parts: |
|
| 150 | +- Detail |
|
| 151 | +- Summary |
|
| 152 | +- Chart (Chart2, Chart3, Chart4, Chart5) |
|
| 153 | +- Gauges |
|
| 154 | +- Map |
|
| 155 | + |
|
| 156 | +``` csharp |
|
| 157 | + |
|
| 158 | +public override void ProcessDataSet(DataSet ds, string reportPart) |
|
| 159 | +{ |
|
| 160 | + string columnToDecrypt = "[dbo].[Orders].[CustomerID]"; |
|
| 161 | + if (reportPart == "Gauges" && ds != null && ds.Tables.Count > 0) |
|
| 162 | + { |
|
| 163 | + ReportSet crs = AdHocContext.CurrentReportSet; |
|
| 164 | + if (crs != null && crs.Reports.Contains("Gauges") && crs.Reports["Gauges"] != null && crs.Reports["Gauges"].Fields[0].ColumnName == columnToDecrypt) |
|
| 165 | + { |
|
| 166 | + // Decrypt ds.Tables[0].Columns[0] |
|
| 167 | + // ... |
|
| 168 | + } |
|
| 169 | + } |
|
| 170 | +} |
|
| 171 | + |
|
| 145 | 172 | ``` |
| ... | ... | \ No newline at end of file |