I have a ultrawinGrid which is populated after a search click. The results are exported to excel using UltraGridExcelExporter. User needs a row in the excel that would display the selected criteria in the search screen.
It is like., an excel report is generated and the last row (after some empty rows..) should read as,
Paramters Selected: <value1>, <value2> etc...
Is that possible?
Hi,
This should be possible, but there's no built-in way to do it automatically. You will have to code it.
I would do something like this:
private void ultraGridExcelExporter1_EndExport(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.EndExportEventArgs e) { StringBuilder sb =new StringBuilder(); sb.Append("Parameters Selected: "); UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0]; foreach (UltraGridColumn column in band.Columns) { foreach (FilterCondition filterCondition in band.ColumnFilters[column].FilterConditions) { if (sb.Length > "Parameters Selected: ".Length) sb.Append(", "); sb.Append(filterCondition.ToString()); } } e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = sb.ToString(); }
Kool stuff Mike., That worked like a charm. I'm using the excelexporter for the first time and i'm sure i can do lot more with ultraGridExcelExporter1_EndExport event.
Thanks,.