I want to write a class for creating Excel files from Datagridviews. I want to add a bottom line with Subtotals for selected columns and the number of those columns change from 1 to 3. I want my function work like this
exportToExcel(string title, DataGridView dgv, int colId1, int colId2, int colId3); //for with 3 sub total
//Example:
exportToExcel("Some Title",mygridview, 3); //for 1 sub total
exportToExcel("Another Titme", othergridview, 5,6,7); //for 3 sub totals
Do I have to create functions for different variations or is there a way to make 2nd and 3rd column numbers optional ?