Closed smittysmee closed 1 year ago
"TSV Export" renderer provide tab separated values which could be copy-pasted.
This is a functionality that isn't needed to be copy-pasted.
Interesting. How does this deal with very large output? My understanding was that data URIs had an upper limit on length?
Hi , I tried Export to excel and it is working even for large data.
<script>
$("#btnExportPivot").on('click', function (e) {
e.preventDefault();
var data = $('.pvtRendererArea>table').html();
$.ajax({
type: 'POST',
url: 'yourURL1',
data: { data: data },
success: function (result) {
window.location = 'yourURL2';
e.preventDefault();
},
error: function (xhr, textstatus, errorThrown) {
alert("An error has occured! Kindly contact administrator.");
e.preventDefault();
}
})
})
</script>
I used this js for my MVC application. So the code is: Controller
`[HttpPost]
[ValidateInput(false)]
public ActionResult yourURL1(string data)
{
TempData["ExportPivotResult"] = data;
return null;
}
public ActionResult yourURL2()
{
yourModel objVM = new yourModel();
objVM.pivotData = Convert.ToString(TempData["ExportPivotResult"]);
Response.AddHeader("content-disposition", "attachment; filename=PivotSheet.xls");
Response.ContentType = "application/ms-excel";
return PartialView(objVM);
}`
View
`@model yourModel()
<table id="pivot">
@Html.Raw(Model.pivotData)
</table>`
@nithishanf Can you please give me more details how you implemented this. I am using battatech excel export which have large data export issues.
Hello, i am working with dot net and angular. can you please explain how to use the above coding?
@MeriemBH are you asking me or @nithishanf?
Updated to account for multi-spanned columns and rows not beginning at location 0
Hello, could you please share with me how to code about accounting for multi-spanned columns and rows not beginning at location 0? @smittysmee
If you would, please implement an export option for exporting to CSV from the generated table.