How can I use jqxGrid / iTextSharp export to PDF ?
I get data by 'json'.
How can ('jqxGridResult') export to PDF using iTextSharp?
What I have tried:
function GetTestReportResult()
{
$.ajax({
type: "POST",
url: "wsMethodDbData.asmx/getData",
contentType: "application/json; charset=utf-8",
data: "{}",
dataType: "json",
success: OnSuccess,
error: function (type)
{
$('#jqxLoader').jqxLoader('close');
$("#errMsg").text("ERROR!!" + type.responseText);
$("#messageNotification").jqxNotification("open");
}
});
function OnSuccess(response)
{
var items;
items = response.d;
if(items.length == 0)
{
$("#errMsg").text("No Data");
$("#messageNotification").jqxNotification("open");
}
else
{
$('#jqxTabs').show();
$('#jqxExpDesc').show();
GenerateGrid(items);
}
$('#jqxLoader').jqxLoader('close');
}
}
function GenerateGrid(data)
{
var source =
{
datatype: "json",
datafields: [
{name:'Data0',type:'string'},
{name:'Data1',type:'string'}
],
localdata: data
};
var localdataAdapter = new $.jqx.dataAdapter(source);
$("#jqxGridResult").jqxGrid(
{
width: '99%',
height: '400px',
autoheight: true,
source: localdataAdapter,
pageable: false,
autoheight: false,
sortable: false,
altrows: false,
enabletooltips: false,
editable: false,
autorowheight: false,
showgroupaggregates: false,
showaggregates: false,
groupable: false,
showstatusbar: false,
sortable: true,
showfilterrow: false,
filterable: true,
selectionmode: 'multiplecellsextended',
columns:
[
{
text: '#', align: 'center', sortable: false, filterable: false, editable: false, groupable: false, draggable: false, resizable: false, datafield: null, columntype: 'number', width: 60,
cellsrenderer: function (row, column, value)
{
return "<div style='margin:4px;'>" + (value + 1) + "</div>";
}
},
{text:"Data0",width:200,align:'center',datafield:"Data0"},
{text:"Data1",width:200,align:'center',datafield:"Data1"}
],
theme: 'fresh'
});
}