1. Document title means what you expect to display?
2. Are you using Single export/ Multiple export.
3. What kind of footer information you need to display in the excel sheet.
4. Please share us the screenshot of your requirement.
The provided information will help us to analyze the issue and provide you the response as early as possible.
Regards,
Gowthami V.
GridFeatures.cshtml @(Html.EJ().Grid<MvcApplication12.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) . . . . . . . . .ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.ExcelExport); })) )
GridController.cs
public void ExportToExcel(string GridModel) { ExcelExport exp = new ExcelExport(); ExcelEngine excel = new ExcelEngine(); IApplication application = excel.Excel; var DataSource = new NorthwindDataContext().OrdersViews.ToList(); GridProperties obj = ConvertGridObject(GridModel); IWorkbook workbook = application.Workbooks.Create(2); //Setting multiExport as true and export the document and assigned to workbook workbook = exp.Export(obj, DataSource, "Export.xlsx", ExcelVersion.Excel2010, false, false, "default-theme",true); //Inserted new row for adding title workbook.ActiveSheet.InsertRow(1); //Merging the sheet from Range A1 to D1 for adding title space workbook.ActiveSheet.Range["A1:D1"].Merge(); //Adding the title using Text property workbook.ActiveSheet.Range["A1"].Text = "Methodologies for the Typical Unification of Access Points and Redundancy"; //Adding the footer information using SetValue method of the ActiveSheet workbook.ActiveSheet.SetValue(workbook.ActiveSheet.Rows.Length + 2, workbook.ActiveSheet.Columns.Length - 3, "This report is for the Deputy Senior VP in charge of things that don't really matter. If this is not you, please destroy and notify the intended recipient immediately"); //Downloading the document workbook.SaveAs("Export.xls", HttpContext.ApplicationInstance.Response,ExcelDownloadType.PromptDialog, ExcelHttpContentType.Excel2010); } |