I am not able to download more than 30k records into excel. Sometimes i am getting 500 error some time not but excel is not downloaded any time.
This is my code
@(Html.ReportsGrid
<apexportal.WebService.Models.AuditReportResult>()
.HtmlAttributes(new { @style = "height: 500px;" })
.Name("AuditReportGrid")
.Excel(e => { e.FileName("AuditReport.xlsx").AllPages(true); })
.Events(e => { e.ExcelExport("excelExportCheck"); })
.AutoBind(false)
.DataSource(datasource => datasource
.Custom()
.Type("aspnetmvc-ajax")
.Transport(t => t.Read(r => r.Action("Read", "AuditReport").Data("getAdditionalData")))
.Schema(s => s
.Data("Data")
.Model(model =>
{
model.Id(itm => itm.VR_Audit_LogID); //("VR_Audit_LogID");
model.Field("VendorID", typeof(string));
model.Field("ActionTime", typeof(DateTime));
model.Field("ReviewedDate", typeof(DateTime));
})
.Total("Total")
)
.ServerSorting(true)
.ServerPaging(true)
.ServerFiltering(true)
.ServerGrouping(false)
.ServerAggregates(false)
.Events(events => events.Error("error_handler"))
)
.Columns(columns =>
{
columns.Bound(portal => portal.VR_ID).Title("VR ID".Translate())
.HeaderHtmlAttributes(new { @class = "NumericHeaderAlign" }).HtmlAttributes(new { @class = "NumericRowAlign" }).Width(180)
.Filterable(x => x.Cell(y => y.Template("NumericFilter")));
if (userACL.IsRegistrationEnabled &&!userACL.IsCustomerRegistrationEnabled)
{
columns.Bound(portal => portal.VendorID).Title("Vendor ID".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
}
if (userACL.IsCustomerRegistrationEnabled)
{
columns.Bound(portal => portal.VendorID).Title("Entity ID".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
}
columns.Bound(portal => portal.CompanyName).Title("Company Name".Translate())
.ClientTemplate("#=buildCompanyNameLink(CompanyName, '" + @Url.Action("GetCompanyUrl") + "')#")
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(200);
columns.Bound(portal => portal.ModifiedFieldName).Title("Field Name".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(250);
columns.Bound(portal => portal.DecryptedOriginalValue).Title("Original Value".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
columns.Bound(portal => portal.DecryptedNewValue).Title("New Value".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
columns.Bound(portal => portal.ChangedBy).Title("Changed By".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
columns.Bound(portal => portal.ChangedByFirstName).Title("Changed By First Name".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
columns.Bound(portal => portal.ChangedByLastName).Title("Changed By Last Name".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
columns.Bound(portal => portal.RegistrationType).ClientTemplate("#= RegistrationType == null ? '' : TranslateText(RegistrationType) #").Title("Registration Type".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
if (userACL.IsCustomerRegistrationEnabled && userACL.IsRegistrationEnabled)
{
columns.Bound(portal => portal.ProfileType).ClientTemplate("#= ProfileType == null ? '' : TranslateText(ProfileType) #").Title("Profile Type".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(150);
}
columns.Bound(portal => portal.Action).ClientTemplate("#= Action == null ? '' : TranslateText(Action) #").Title("Action".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(110);
//columns.Bound(portal => portal.PRIMARY_KEY).Title("Primary Key".Translate()).HtmlAttributes(new { @style = "white-space: nowrap;" }).Width(110);
columns.Bound(portal => portal.DataSource).Title("Data Source".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(110);
columns.Bound(portal => portal.ActionTime).Title("Action Time".Translate()).Format("{0:G}")
.HeaderHtmlAttributes(new { @class = "DateHeaderAlign" }).HtmlAttributes(new { @class = "DateRowAlign" }).Width(150);
columns.Bound(portal => portal.ReviewMode).ClientTemplate("#= ReviewMode == null ? '' : TranslateText(ReviewMode) #").Title("Review Action".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(110);
columns.Bound(portal => portal.ReviewedBy).Title("Reviewed By".Translate())
.HeaderHtmlAttributes(new { @class = "StringHeaderAlign" }).HtmlAttributes(new { @class = "StringRowAlign" }).Width(110);
columns.Bound(portal => portal.ReviewedDate).Title("Reviewed Date".Translate()).Format("{0:G}")
.HeaderHtmlAttributes(new { @class = "DateHeaderAlign" }).HtmlAttributes(new { @class = "DateRowAlign" }).Width(150);
}
)
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForDate(str => str.Clear()
.IsNotEqualTo("Is not equal to".Translate())
.IsGreaterThanOrEqualTo("Is after or equal to".Translate())
.IsGreaterThan("Is after".Translate())
.IsLessThanOrEqualTo("Is before or equal to".Translate())
.IsLessThan("Is before".Translate())
.IsNull("Is Null".Translate())
.IsNotNull("Is Not Null".Translate()))))
)
}
@Html.GridErrorHandler()
@Html.GridResizeHandler("AuditReportGrid")
@CustomHtml.GridContextMenu(Html, "AuditReportGrid")
@CustomHtml.EnableFormValidation("SearchForm", "searchbtn")