$(".gridview td").each(function () {
var value = $(this).html();
doc.setFontSize(8);
if (count == 1) {
if (height > 278) {
doc.rect(10, inc, 24, 8);
doc.rect(34, inc, 111, 8);
doc.rect(145, inc, 15, 8);
doc.rect(160, inc, 20, 8);
doc.rect(180, inc, 23, 8);
doc.addPage(focus);
doc.setLineWidth(0.5);
inc = 15;
height = 18;
}
doc.rect(10, inc, 24, 8);
doc.text(value, 11, height);
}
if (count == 2) {
doc.rect(34, inc, 111, 8);
var splitdesc = doc.splitTextToSize(value, 100);
doc.text(splitdesc, 35, height);
}
if (count == 3) {
doc.rect(145, inc, 15, 8);
doc.text(value, 147, height);
qty = value;
}
if (count == 4) {
doc.rect(160, inc, 20, 8);
doc.text(value, 163, height);
amt = value;
}
if (count == 5) {
doc.rect(180, inc, 23, 8);
tot = parseInt(qty) * parseFloat(amt);
doc.text("" + tot, 182, height);
count = 0;
height = height + 8;
netamt = netamt + parseFloat(tot);
inc = parseInt(inc) + 8;
doc.rect(10, inc, 24, 8);
doc.rect(34, inc, 111, 8);
doc.rect(145, inc, 15, 8);
doc.rect(160, inc, 20, 8);
doc.rect(180, inc, 23, 8);
}
count = count + 1;
});