Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
620
WebGrid Excel Export
posted

I am using the WebGrid and exporting to excel, everything works fine except I am tring to add some text at the top of the report.

I have the folowing in the BeginExport event

 

 

e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value =

 

 

"Sales Comparison - Daily"

;

e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].CellFormat.Font.Height = 400;

e.CurrentRowIndex++;

e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value =

 

 

"Date: "

+ dateRange;

 

 

 

 

 

 

 

The issue is when the CellExported event is called the CurrentRowIndex is at 0 even after I have changed it. This works fine in the WinGrid (which I also use in another project).

Am I doing something wrong or do I need to do this another way with the WebGrid object model.

Thanks

David