I am trying to Include the Hidden Columns in the Exported Excel file in kendo 2022.1.119 But It is not working Exportable(true)

0 Answers 74 Views
Grid View
Mani
Top achievements
Rank 1
Iron
Mani asked on 21 Jul 2023, 10:13 AM | edited on 21 Jul 2023, 10:15 AM

<div>
                            @(Html.Kendo().Grid<FourCSQL.ContractorPortal.Model.Custom.WorkRequest.WorkRequestModel>()
                                .Name("gridTestrequest")
                                .Columns(columns =>
                                {
                                    columns.Bound(c => c.TestName).Title(ResourceManagerClass.GetResource("CarTest", languageID)).Width(200);
                                    columns.Bound(c => c.TestDescription).Title(ResourceManagerClass.GetResource("Car Description", languageID)).Width(460);
                                    columns.Bound(c => c.TestToComplete).Title(ResourceManagerClass.GetResource("Car Test to complete", languageID)).Width(150);
                                    columns.Bound(c => c.TestPriority).Title(ResourceManagerClass.GetResource("Carpriority", languageID)).Width(180);
                                    columns.Bound(c => c.TestCode).Title(ResourceManagerClass.GetResource("CarTestCode", languageID)).Width(200);
                                    columns.Bound(c => c.TestDepartment).Title(ResourceManagerClass.GetResource("Cardepartment", languageID)).Width(180);
                                    columns.Bound(c => c.TestLocation).Title(ResourceManagerClass.GetResource("CarLocation Description", languageID)).Width(240);
                                    columns.Bound(c => c.LocationDescription).Title(ResourceManagerClass.GetResource("Asset", languageID)).Width(240);
                                    columns.Bound(c => c.WorkDescription).Title(ResourceManagerClass.GetResource("Work ", languageID)).Width(180);
                                    columns.Bound(c => c.TestStatus).Title(ResourceManagerClass.GetResource("Status", languageID)).Width(180);
                                    columns.Bound(c => c.TestStore).Title(ResourceManagerClass.GetResource("Store", languageID)).Width(180).Hidden(true).Exportable(true);
                                })

            .ToolBar(toolBar =>
                        toolBar.Template("<a class='k-button k-button-icontext k-grid-excel btn btn-secondary btn-custom' style='float:right;margin-                      right:12px;color:white;' href='#'><span class='k-icon k-i-excel' style='margin-top:-1px;'></span>Export</a> "))
                .Excel(excel => excel
                .FileName("workrequest.xlsx")
                .Filterable(true).AllPages(true)
                .ProxyURL(Url.Action("AdminList", "Admin", new { @requestType = @ViewBag.RequestType }))
            )
        .Scrollable(scr => scr.Height(230))
        .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
        .Pageable(pageable => pageable.Refresh(false).PageSizes(true).ButtonCount(1))
        .Sortable()
        .Filterable(f => f.Extra(false)
        .Operators(op => { op.ForString(str => { str.Clear().Contains("Contains"); }); })
        .Messages(m => m.Info("Items with value contains:")))
        .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("AdminList", "Admin", new { @requestType = "pending" })))
        .Resizable(resize => resize.Columns(true))
        .Reorderable(reorderable => reorderable.Columns(true))
        .Events(events => events.ColumnReorder("saveColumnReorder").ColumnResize("saveColumnSize"))
        .HtmlAttributes(new { @class="KendoGrid"})
         )

</div>

1.How We can Export the Hidden columns in Excel...?

2. In the grid has one columns values like this  the user is seeing like this (volvo, benz, Audi, BMW, I20, MG,) But When user clicks on the Excel So we want show ('30lakhs',  '1crore' , '80lakhs', '30lakhs', '50lakhs')

 

So How We can do this I have not found any link anyone can you please help me out to find for this solution.

Thanks& Regards

No answers yet. Maybe you can help?

Tags
Grid View
Asked by
Mani
Top achievements
Rank 1
Iron
Share this question
or