<cc1:ModalPopupExtender ID="mpePrintBill" runat="server" PopupControlID="pnlPrintBill" TargetControlID="lnkDeleteFake" BehaviorID="mpeDeletCategory" CancelControlID="btnNo" BackgroundCssClass="modalBackground"> </cc1:ModalPopupExtender> <asp:LinkButton ID="lnkDeleteFake" runat="server"></asp:LinkButton> <asp:Panel ID="pnlPrintBill" runat="server" CssClass="modalPopupDelete" Style="display: none; width: 30%">
<div id="Div1" runat="server" class="header"> </div> <div style="overflow-y: auto; overflow-x: hidden; max-height: 450px;"> <div class="modal-header bg-danger" style="background-color: white"> <%--#d9534f--%> <div class="title" style="color: green; text-shadow: none"> <%--<i class="fa fa-trash"></i>--%> <center> Bill Saved Sucessfully.</center>
</div> </div> </div> <div align="right" class="modal-footer" style="margin-top: 0px"> <div class="row"> <div class="col-md-7 title" style="color: green; text-shadow: none; font-size: 13px"> <%--<i class="fa fa-trash"></i>--%> <b> <center> Do you Want to Print this Bill ?</b></center> </div> <div class="col-md-5"> <asp:HiddenField ID="hfBillID" runat="server" Value="0" /> <%--<asp:LinkButton ID="btnYesPrint" runat="server" Text="Yes" formtarget="_blank" class="btn btn-default btn-sm" CausesValidation="false" Style="text-shadow: none" OnClick="btnYesPrint_Click"><span class="glyphicon glyphicon-ok"> YES</span></asp:LinkButton>--%> <asp:Button ID="btnYesPrint" runat="server" Text="Yes" formtarget="_blank" class="btn btn-default btn-sm" CausesValidation="false" OnClick="btnYesPrint_Click1" /> <asp:Button ID="btnNo" runat="server" class="btn btn-danger btn-sm" Text="No" /> </div> </div> </div>
</asp:Panel>
<cc1:ModalPopupExtender ID="mpePrintBill" runat="server" PopupControlID="pnlPrintBill"
TargetControlID="lnkDeleteFake" BehaviorID="mpeDeletCategory" CancelControlID="btnNo"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:LinkButton ID="lnkDeleteFake" runat="server"></asp:LinkButton>
<asp:Panel ID="pnlPrintBill" runat="server" CssClass="modalPopupDelete" Style="display: none; width: 30%">
<div id="Div1" runat="server" class="header">
</div>
<div style="overflow-y: auto; overflow-x: hidden; max-height: 450px;">
<div class="modal-header bg-danger" style="background-color: white">
<%--#d9534f--%>
<div class="title" style="color: green; text-shadow: none">
<%--<i class="fa fa-trash"></i>--%>
<center> Bill Saved Sucessfully.</center>
</div>
</div>
</div>
<div align="right" class="modal-footer" style="margin-top: 0px">
<div class="row">
<div class="col-md-7 title" style="color: green; text-shadow: none; font-size: 13px">
<%--<i class="fa fa-trash"></i>--%>
<b>
<center>
Do you Want to Print this Bill ?</b></center>
</div>
<div class="col-md-5">
<asp:HiddenField ID="hfBillID" runat="server" Value="0" />
<%--<asp:LinkButton ID="btnYesPrint" runat="server" Text="Yes" formtarget="_blank" class="btn btn-default btn-sm" CausesValidation="false" Style="text-shadow: none" OnClick="btnYesPrint_Click"><span class="glyphicon glyphicon-ok"> YES</span></asp:LinkButton>--%>
<asp:Button ID="btnYesPrint" runat="server" Text="Yes" formtarget="_blank" class="btn btn-default btn-sm" CausesValidation="false" OnClick="btnYesPrint_Click1" />
<asp:Button ID="btnNo" runat="server" class="btn btn-danger btn-sm" Text="No" />
</div>
</div>
</div>
</asp:Panel>
protected void btnYesPrint_Click1(object sender, EventArgs e)
{
mpePrintBill.Hide();
PrintBill_WithOutBorder();
}
public void PrintBill_WithOutBorder()
{
// var BillNo = (Convert.ToInt64(txtBill.Text) + 1).ToString();
con.Close();
con.Open();
//select s.ID as BillNumber,s.Date as BillDate,s.DiscountRate as DiscountRate,s.DiscountAmt as DiscountAmount,s.GrossAmt as TotalAmount,s.VatRate as VatRate,s.VatAmt as VatAmount,s.GrandTotal as GrandTotal,s.PaidAmt as PaidAmount,sd.Quantity,sd.Box,sd.PcsPerBox,sd.Price,sd.Amount,p.Name as ProductName,p.Price as ProductPrice,p.BoxQty,c.FirmName as PartyName,c.PersonName,c.VATTin as BuyersVatTinNo,c.CSTTin as BuyersCstTinNo,m.Name from SalesDetails sd inner join SalesForm s on s.ID=sd.SalesForm inner join MstProduct p on p.ID=sd.Product inner join MstCustomer c on c.ID=s.Customer inner join MstMainCategory m on m.ID=p.MainCategory where s.ID=19
SqlCommand cmdSelect = new SqlCommand("select distinct s.ID as BillNumber,s.Date as BillDate,((select sum(sd.Amount) from SalesDetails sd where sd.SalesForm=" + hfBillID.Value + ")) as ItemTotalAmount ,s.DiscountRate as DiscountRate,s.DiscountAmt as DiscountAmount,s.GrossAmt as WithDicoount_TotalAmount,s.VatRate as VatRate,s.VatAmt as VatAmount,s.GrandTotal as WithVat_GrandTotal,s.PaidAmt as PaidAmount,((select sum(sd.Quantity) from SalesDetails sd where sd.SalesForm=" + hfBillID.Value + ")) as TotalQuantity ,((select sum(sd.Box) from SalesDetails sd where sd.SalesForm=" + hfBillID.Value + ")) as TotalBox ,c.FirmName as PartyName,c.VATTin as BuyersVatTinNo,c.CSTTin as BuyersCstTinNo from SalesDetails sd inner join SalesForm s on s.ID=sd.SalesForm inner join MstProduct p on p.ID=sd.Product inner join MstCustomer c on c.ID=s.Customer where s.ID=" + hfBillID.Value + "", con);//" + txtBill.Text + "
SqlDataReader drSelect = cmdSelect.ExecuteReader();
if (drSelect.Read())
{
BillNumber = drSelect["BillNumber"].ToString();
BillDate = drSelect["BillDate"].ToString();
PartyName = drSelect["PartyName"].ToString();
//TotalQuantity = drSelect["TotalQuantity"].ToString();
ItemTotalAmount = drSelect["ItemTotalAmount"].ToString();
//AmountInWords = "Wait".ToString();
DiscountRate = drSelect["DiscountRate"].ToString();
DiscountAmount = drSelect["DiscountAmount"].ToString();
WithDicoount_TotalAmount = drSelect["WithDicoount_TotalAmount"].ToString();
VatRate = drSelect["VatRate"].ToString();
VatAmount = drSelect["VatAmount"].ToString();
WithVat_GrandTotal = drSelect["WithVat_GrandTotal"].ToString();
string word = ConvertNumbertoWords(Convert.ToInt32(WithVat_GrandTotal));
AmountInWords = word;
TotalQuantity = drSelect["TotalQuantity"].ToString();
TotalBoxes = drSelect["TotalBox"].ToString();
BuyersVatTinNo = drSelect["BuyersVatTinNo"].ToString();
BuyersCstTinNo = drSelect["BuyersCstTinNo"].ToString();
SellerVatTinNo = "27461430348V";
SellerCstTinNo = "27461430348V";
}
drSelect.Close();
con.Close();
#region Without border print format maganlal
var FontTextColor = FontFactory.GetFont("Arial", 10, iTextSharp.text.BaseColor.WHITE);
var MainTextRegular = FontFactory.GetFont("Arial", 8, iTextSharp.text.BaseColor.BLACK);
var MainTextRegularSmall = FontFactory.GetFont("Arial", 7, iTextSharp.text.BaseColor.BLACK);
var MainTextRegularExtraSmall = FontFactory.GetFont("Arial", 6, iTextSharp.text.BaseColor.BLACK);
var MainTextRegularBold = FontFactory.GetFont("Arial", 8, iTextSharp.text.Font.BOLD);
var MainTextRegularSmallBold = FontFactory.GetFont("Arial", 7, iTextSharp.text.Font.BOLD);
var MainTextRegularHead = FontFactory.GetFont("Arial", 12, iTextSharp.text.BaseColor.BLACK);
var MainTextBold = FontFactory.GetFont("Arial", 10, iTextSharp.text.Font.BOLD);
var MainHeaderTextBold = FontFactory.GetFont("Arial", 15, iTextSharp.text.Font.BOLD);
var MainHeaderText = FontFactory.GetFont("Arial", 12, iTextSharp.text.BaseColor.BLACK);
// string imageURL = Server.MapPath(".") + "/image2.jpg";
string url = Server.MapPath(".") + "/img/Maganlal_Fevicon_logo.jpg";
//(@"~\Images\Photo2.jpg");
iTextSharp.text.Image jpg1 = iTextSharp.text.Image.GetInstance(new Uri(url));
jpg1.ScaleAbsolute(55f, 55f);
iTextSharp.text.Font Fonth1 = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.TIMES_ROMAN, 10f);
iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.B5, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, HttpContext.Current.Response.OutputStream);
pdfDoc.Open();
//created Master table
PdfPTable MasterMainTable = new PdfPTable(new float[] { 48f, 4f, 48f });
MasterMainTable.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
MasterMainTable.TotalWidth = 800f;
MasterMainTable.LockedWidth = true;
MasterMainTable.HorizontalAlignment = Element.ALIGN_LEFT;
PdfPCell MasterMainTable_Cell01 = new PdfPCell(new iTextSharp.text.Paragraph(""));
MasterMainTable_Cell01.HorizontalAlignment = 0;
MasterMainTable_Cell01.BorderWidth = 0;
PdfPCell MasterMainTable_SpaceCell = new PdfPCell(new iTextSharp.text.Paragraph(" "));
MasterMainTable_SpaceCell.HorizontalAlignment = 0;
MasterMainTable_SpaceCell.BorderWidth = 0;
PdfPCell MasterMainTable_Cell02 = new PdfPCell(new iTextSharp.text.Paragraph(""));
MasterMainTable_Cell02.HorizontalAlignment = 0;
MasterMainTable_Cell02.BorderWidth = 0;
//print data from here
PdfPTable MainTable = new PdfPTable(1);
MainTable.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
MainTable.TotalWidth = 474f;
MainTable.LockedWidth = true;
MainTable.HorizontalAlignment = Element.ALIGN_LEFT;
MainTable.SpacingBefore = 85;
//1st row
PdfPCell MainTableCell1 = new PdfPCell(new iTextSharp.text.Paragraph(" "));
MainTableCell1.HorizontalAlignment = 0;
MainTableCell1.BorderWidth = 0;
//created nested table
PdfPTable nestedTable = new PdfPTable(new float[] { 8f, 32f, 15f, 15f, 15f, 15f });
nestedTable.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
nestedTable.TotalWidth = 474f;
nestedTable.LockedWidth = true;
PdfPCell nestedTable_Cell01 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainHeaderTextBold));
nestedTable_Cell01.HorizontalAlignment = Element.ALIGN_TOP;
nestedTable_Cell01.VerticalAlignment = Element.ALIGN_TOP;
nestedTable_Cell01.BorderWidth = 0;
nestedTable_Cell01.Colspan = 1;
nestedTable_Cell01.Rowspan = 6;
nestedTable_Cell01.AddElement(jpg1);
PdfPCell nestedTableCell01 = new PdfPCell(new iTextSharp.text.Paragraph("MFP PRODUCTS", MainHeaderTextBold));
nestedTableCell01.HorizontalAlignment = 1;
nestedTableCell01.BorderWidth = 0;
nestedTableCell01.Colspan = 5;
PdfPCell nestedTableCell02 = new PdfPCell(new iTextSharp.text.Paragraph("MODI PLAZA, SHOP NO.101, OLD MUMBAI-PUNE HIGHWAY, ", MainTextRegular));
nestedTableCell02.HorizontalAlignment = 1;
nestedTableCell02.BorderWidth = 0;
nestedTableCell02.Colspan = 5;
PdfPCell nestedTableCell03 = new PdfPCell(new iTextSharp.text.Paragraph("BESIDES HARI INTERNATIONAL, LONAVALA 410401, DIST:PUNE INDIA", MainTextRegular));
nestedTableCell03.HorizontalAlignment = 1;
nestedTableCell03.BorderWidth = 0;
nestedTableCell03.Colspan = 5;
PdfPCell nestedTableCell04 = new PdfPCell(new iTextSharp.text.Paragraph("EMAIL:mfpproducts@gmail.com, (+91-9689-9689-01), (+91-9689-9689-02)\n\n", MainTextRegular));
nestedTableCell04.HorizontalAlignment = 1;
nestedTableCell04.BorderWidth = 0;
nestedTableCell04.Colspan = 5;
PdfPCell nestedTableCell05 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegular));
nestedTableCell05.HorizontalAlignment = 1;
nestedTableCell05.BorderWidth = 0;
nestedTableCell05.Colspan = 5;
PdfPCell nestedTableCell06 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegular));
nestedTableCell06.HorizontalAlignment = 1;
nestedTableCell06.BorderWidth = 0;
nestedTableCell06.Colspan = 5;
//nestedTable.AddCell(nestedTable_Cell01);
//nestedTable.AddCell(nestedTableCell01);
//nestedTable.AddCell(nestedTableCell02);
//nestedTable.AddCell(nestedTableCell03);
//nestedTable.AddCell(nestedTableCell04);
//nestedTable.AddCell(nestedTableCell05);
//nestedTable.AddCell(nestedTableCell06);
PdfPCell MainTableCell11 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegular));
MainTableCell11.HorizontalAlignment = 1;
MainTableCell11.BorderWidth = 0;
MainTableCell11.Colspan = 6;
PdfPTable nestedTableForCell11 = new PdfPTable(new float[] { 20f, 60f, 20f });
nestedTableForCell11.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
nestedTableForCell11.TotalWidth = 474f;
nestedTableForCell11.LockedWidth = true;
PdfPCell nestedTableForCell11_Cell01 = new PdfPCell(new iTextSharp.text.Paragraph("Bill No :" + BillNumber + "", MainTextRegular));
nestedTableForCell11_Cell01.HorizontalAlignment = 0;
nestedTableForCell11_Cell01.BorderWidth = 0;
PdfPCell nestedTableForCell11_Cell02 = new PdfPCell(new iTextSharp.text.Paragraph("TAX INVOICE", MainTextRegularBold));
nestedTableForCell11_Cell02.HorizontalAlignment = 1;
nestedTableForCell11_Cell02.BorderWidth = 0;
PdfPCell nestedTableForCell11_Cell03 = new PdfPCell(new iTextSharp.text.Paragraph("Date :" + BillDate + "", MainTextRegular));
nestedTableForCell11_Cell03.HorizontalAlignment = 2;
nestedTableForCell11_Cell03.BorderWidth = 0;
nestedTableForCell11.AddCell(nestedTableForCell11_Cell01);
nestedTableForCell11.AddCell(nestedTableForCell11_Cell02);
nestedTableForCell11.AddCell(nestedTableForCell11_Cell03);
MainTableCell11.AddElement(nestedTableForCell11);
nestedTable.AddCell(MainTableCell11);
//party name and address
//first column
PdfPCell nestedTableCell12 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegular));
nestedTableCell12.HorizontalAlignment = 0;
nestedTableCell12.BorderWidth = 0;
nestedTableCell12.Colspan = 6;
PdfPTable nestedTableForCell12 = new PdfPTable(new float[] { 100f });
nestedTableForCell11.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
nestedTableForCell11.TotalWidth = 100f;
nestedTableForCell11.LockedWidth = true;
nestedTableForCell12.HorizontalAlignment = Element.ALIGN_LEFT;
PdfPCell nestedTableForCell12_Cell01 = new PdfPCell(new iTextSharp.text.Paragraph("Party Name : " + PartyName + " ", MainTextRegular));
nestedTableForCell12_Cell01.HorizontalAlignment = 0;
nestedTableForCell12_Cell01.BorderWidth = 0;
nestedTableForCell12.AddCell(nestedTableForCell12_Cell01);
nestedTableCell12.AddElement(nestedTableForCell12);
nestedTable.AddCell(nestedTableCell12);
//2nd column
//PdfPCell nestedTableCell13 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegular));
//nestedTableCell13.HorizontalAlignment = 1;
//nestedTableCell13.BorderWidth = 0;
//nestedTableCell13.Colspan = 3;
//PdfPTable nestedTableForCell13 = new PdfPTable(new float[] { 30f,70f });
//nestedTableForCell13.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
//nestedTableForCell13.TotalWidth = 150f;
//nestedTableForCell13.LockedWidth = true;
//PdfPCell nestedTableForCell13_Cell01 = new PdfPCell(new iTextSharp.text.Paragraph("Date", MainTextRegular));
//nestedTableForCell13_Cell01.HorizontalAlignment = 0;
//nestedTableForCell13_Cell01.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell02 = new PdfPCell(new iTextSharp.text.Paragraph(": {Date}", MainTextRegular));
//nestedTableForCell13_Cell02.HorizontalAlignment = 0;
//nestedTableForCell13_Cell02.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell03 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegular));
//nestedTableForCell13_Cell03.HorizontalAlignment = 0;
//nestedTableForCell13_Cell03.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell04 = new PdfPCell(new iTextSharp.text.Paragraph(": {BillNo}", MainTextRegular));
//nestedTableForCell13_Cell04.HorizontalAlignment = 0;
//nestedTableForCell13_Cell04.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell05 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegular));
//nestedTableForCell13_Cell05.HorizontalAlignment = 0;
//nestedTableForCell13_Cell05.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell06 = new PdfPCell(new iTextSharp.text.Paragraph(": {Invoice No}", MainTextRegular));
//nestedTableForCell13_Cell06.HorizontalAlignment = 0;
//nestedTableForCell13_Cell06.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell07 = new PdfPCell(new iTextSharp.text.Paragraph("Challan No", MainTextRegular));
//nestedTableForCell13_Cell07.HorizontalAlignment = 0;
//nestedTableForCell13_Cell07.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell08 = new PdfPCell(new iTextSharp.text.Paragraph(": {Challan No}", MainTextRegular));
//nestedTableForCell13_Cell08.HorizontalAlignment = 0;
//nestedTableForCell13_Cell08.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell09 = new PdfPCell(new iTextSharp.text.Paragraph("P.O. No", MainTextRegular));
//nestedTableForCell13_Cell09.HorizontalAlignment = 0;
//nestedTableForCell13_Cell09.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell010 = new PdfPCell(new iTextSharp.text.Paragraph(": {PO_No}", MainTextRegular));
//nestedTableForCell13_Cell010.HorizontalAlignment = 0;
//nestedTableForCell13_Cell010.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell011 = new PdfPCell(new iTextSharp.text.Paragraph("Date", MainTextRegular));
//nestedTableForCell13_Cell011.HorizontalAlignment = 0;
//nestedTableForCell13_Cell011.BorderWidth = 0;
//PdfPCell nestedTableForCell13_Cell012 = new PdfPCell(new iTextSharp.text.Paragraph(": {PO_Date}", MainTextRegular));
//nestedTableForCell13_Cell012.HorizontalAlignment = 0;
//nestedTableForCell13_Cell012.BorderWidth = 0;
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell01);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell02);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell03);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell04);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell05);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell06);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell07);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell08);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell09);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell010);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell011);
//nestedTableForCell13.AddCell(nestedTableForCell13_Cell012);
//nestedTableCell13.AddElement(nestedTableForCell13);
//nestedTable.AddCell(nestedTableCell13);
//description
PdfPCell nestedTableCell14 = new PdfPCell(new iTextSharp.text.Paragraph("Sr.No", MainTextRegularBold));
nestedTableCell14.HorizontalAlignment = 1;
nestedTableCell14.BorderWidth = 0;
PdfPCell nestedTableCell15 = new PdfPCell(new iTextSharp.text.Paragraph("Product", MainTextRegularBold));
nestedTableCell15.HorizontalAlignment = 1;
nestedTableCell15.BorderWidth = 0;
PdfPCell nestedTableCell16 = new PdfPCell(new iTextSharp.text.Paragraph("Rate", MainTextRegularBold));
nestedTableCell16.HorizontalAlignment = 1;
nestedTableCell16.BorderWidth = 0;
PdfPCell nestedTableCell17 = new PdfPCell(new iTextSharp.text.Paragraph("Qantity", MainTextRegularBold));
nestedTableCell17.HorizontalAlignment = 2;
nestedTableCell17.BorderWidth = 0;
PdfPCell nestedTableCell18 = new PdfPCell(new iTextSharp.text.Paragraph("No OF Box ", MainTextRegularBold));
nestedTableCell18.HorizontalAlignment = 2;
nestedTableCell18.BorderWidth = 0;
PdfPCell nestedTableCell19 = new PdfPCell(new iTextSharp.text.Paragraph("Amount", MainTextRegularBold));
nestedTableCell19.HorizontalAlignment = 2;
nestedTableCell19.BorderWidth = 0;
nestedTable.AddCell(nestedTableCell14);
nestedTable.AddCell(nestedTableCell15);
nestedTable.AddCell(nestedTableCell16);
nestedTable.AddCell(nestedTableCell17);
nestedTable.AddCell(nestedTableCell18);
nestedTable.AddCell(nestedTableCell19);
SqlCommand cmdSelectItems = new SqlCommand("select s.ID as BillNumber,s.Date as BillDate,s.DiscountRate as DiscountRate,s.DiscountAmt as DiscountAmount,s.GrossAmt as TotalAmount,s.VatRate as VatRate,s.VatAmt as VatAmount,s.GrandTotal as GrandTotal,s.PaidAmt as PaidAmount,sd.Quantity,sd.Box,sd.PcsPerBox,sd.Price,sd.Amount,p.Name as ProductName,p.Price as ProductPrice,p.BoxQty,c.FirmName as PartyName,c.PersonName,c.VATTin as BuyersVatTinNo,c.CSTTin as BuyersCstTinNo,m.Name from SalesDetails sd inner join SalesForm s on s.ID=sd.SalesForm inner join MstProduct p on p.ID=sd.Product inner join MstCustomer c on c.ID=s.Customer inner join MstMainCategory m on m.ID=p.MainCategory where s.ID=" + hfBillID.Value + "", con);//"+txtBill.Text+"
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = cmdSelectItems;
DataTable dtItems = new DataTable();
sda.Fill(dtItems);
SrNo = 1;
for (int i = 0; i < dtItems.Rows.Count; i++)
{
ProductName = dtItems.Rows[i][14].ToString();
ProductRate = dtItems.Rows[i][15].ToString();
ProductQuantity = dtItems.Rows[i][09].ToString();
ProductNumberOfBox = dtItems.Rows[i][11].ToString();
ProductAmount = dtItems.Rows[i][13].ToString();
//description Data
PdfPCell nestedTableCell20 = new PdfPCell(new iTextSharp.text.Paragraph("" + SrNo + "", MainTextRegularSmall));
nestedTableCell20.HorizontalAlignment = 1;
nestedTableCell20.BorderWidthTop = 0;
nestedTableCell20.BorderWidthLeft = 0;
nestedTableCell20.BorderWidthRight = 0;
nestedTableCell20.BorderWidthBottom = 0;
PdfPCell nestedTableCell21 = new PdfPCell(new iTextSharp.text.Paragraph("" + ProductName + "", MainTextRegularSmall));
nestedTableCell21.HorizontalAlignment = 1;
nestedTableCell21.BorderWidthTop = 0;
nestedTableCell21.BorderWidthLeft = 0;
nestedTableCell21.BorderWidthRight = 0;
nestedTableCell21.BorderWidthBottom = 0;
PdfPCell nestedTableCell22 = new PdfPCell(new iTextSharp.text.Paragraph("" + ProductRate + "", MainTextRegularSmall));
nestedTableCell22.HorizontalAlignment = 1;
nestedTableCell22.BorderWidthTop = 0;
nestedTableCell22.BorderWidthLeft = 0;
nestedTableCell22.BorderWidthRight = 0;
nestedTableCell22.BorderWidthBottom = 0;
PdfPCell nestedTableCell23 = new PdfPCell(new iTextSharp.text.Paragraph("" + ProductQuantity + "", MainTextRegularSmall));
nestedTableCell23.HorizontalAlignment = 2;
nestedTableCell23.BorderWidthTop = 0;
nestedTableCell23.BorderWidthLeft = 0;
nestedTableCell23.BorderWidthRight = 0;
nestedTableCell23.BorderWidthBottom = 0;
PdfPCell nestedTableCell24 = new PdfPCell(new iTextSharp.text.Paragraph("" + ProductNumberOfBox + "", MainTextRegularSmall));
nestedTableCell24.HorizontalAlignment = 2;
nestedTableCell24.BorderWidthTop = 0;
nestedTableCell24.BorderWidthLeft = 0;
nestedTableCell24.BorderWidthRight = 0;
nestedTableCell24.BorderWidthBottom = 0;
PdfPCell nestedTableCell25 = new PdfPCell(new iTextSharp.text.Paragraph("" + ProductAmount + "", MainTextRegularSmall));
nestedTableCell25.HorizontalAlignment = 2;
nestedTableCell25.BorderWidthTop = 0;
nestedTableCell25.BorderWidthLeft = 0;
nestedTableCell25.BorderWidthRight = 0;
nestedTableCell25.BorderWidthBottom = 0;
nestedTable.AddCell(nestedTableCell20);
nestedTable.AddCell(nestedTableCell21);
nestedTable.AddCell(nestedTableCell22);
nestedTable.AddCell(nestedTableCell23);
nestedTable.AddCell(nestedTableCell24);
nestedTable.AddCell(nestedTableCell25);
SrNo++;
}
PdfPCell nestedTableCell_20 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell_20.HorizontalAlignment = 1;
nestedTableCell_20.BorderWidthTop = 0;
nestedTableCell_20.BorderWidthLeft = 0;
nestedTableCell_20.BorderWidthRight = 0;
nestedTableCell_20.BorderWidthBottom = 0;
PdfPCell nestedTableCell_21 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell_21.HorizontalAlignment = 1;
nestedTableCell_21.BorderWidthTop = 0;
nestedTableCell_21.BorderWidthLeft = 0;
nestedTableCell_21.BorderWidthRight = 0;
nestedTableCell_21.BorderWidthBottom = 0;
PdfPCell nestedTableCell_22 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell_22.HorizontalAlignment = 1;
nestedTableCell_22.BorderWidthTop = 0;
nestedTableCell_22.BorderWidthLeft = 0;
nestedTableCell_22.BorderWidthRight = 0;
nestedTableCell_22.BorderWidthBottom = 0;
PdfPCell nestedTableCell_23 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell_23.HorizontalAlignment = 2;
nestedTableCell_23.BorderWidthTop = 0;
nestedTableCell_23.BorderWidthLeft = 0;
nestedTableCell_23.BorderWidthRight = 0;
nestedTableCell_23.BorderWidthBottom = 0;
PdfPCell nestedTableCell_24 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell_24.HorizontalAlignment = 2;
nestedTableCell_24.BorderWidthTop = 0;
nestedTableCell_24.BorderWidthLeft = 0;
nestedTableCell_24.BorderWidthRight = 0;
nestedTableCell_24.BorderWidthBottom = 0;
PdfPCell nestedTableCell_25 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell_25.HorizontalAlignment = 2;
nestedTableCell_25.BorderWidthTop = 0;
nestedTableCell_25.BorderWidthLeft = 0;
nestedTableCell_25.BorderWidthRight = 0;
nestedTableCell_25.BorderWidthBottom = 0;
nestedTable.AddCell(nestedTableCell_20);
nestedTable.AddCell(nestedTableCell_21);
nestedTable.AddCell(nestedTableCell_22);
nestedTable.AddCell(nestedTableCell_23);
nestedTable.AddCell(nestedTableCell_24);
nestedTable.AddCell(nestedTableCell_25);
//calculation i.e discount, vat ***********************
PdfPCell nestedTableCell20_1 = new PdfPCell(new iTextSharp.text.Paragraph("\nTOTAL\n\n", MainTextRegularBold));
nestedTableCell20_1.HorizontalAlignment = 1;
nestedTableCell20_1.Colspan = 3;
nestedTableCell20_1.BorderWidthTop = 0;
nestedTableCell20_1.BorderWidthLeft = 0;
nestedTableCell20_1.BorderWidthRight = 0;
nestedTableCell20_1.BorderWidthBottom = 0;
PdfPCell nestedTableCell23_1 = new PdfPCell(new iTextSharp.text.Paragraph("\n" + TotalQuantity + "\n\n", MainTextRegularSmall));
nestedTableCell23_1.HorizontalAlignment = 2;
nestedTableCell23_1.BorderWidthBottom = 0;
nestedTableCell23_1.BorderWidthTop = 0;
nestedTableCell23_1.BorderWidthLeft = 0;
nestedTableCell23_1.BorderWidthRight = 0;
PdfPCell nestedTableCell24_1 = new PdfPCell(new iTextSharp.text.Paragraph("\n" + TotalBoxes + "\n\n", MainTextRegularSmall));
nestedTableCell24_1.HorizontalAlignment = 2;
nestedTableCell24_1.BorderWidth = 0;
nestedTableCell24_1.BorderWidthTop = 0;
nestedTableCell24_1.BorderWidthLeft = 0;
nestedTableCell24_1.BorderWidthRight = 0;
nestedTableCell24_1.BorderWidthBottom = 0;
PdfPCell nestedTableCell25_1 = new PdfPCell(new iTextSharp.text.Paragraph("\n" + ItemTotalAmount + "\n\n", MainTextRegularSmall));
nestedTableCell25_1.HorizontalAlignment = 2;
nestedTableCell25_1.BorderWidth = 0;
nestedTableCell25_1.BorderWidthTop = 0;
nestedTableCell25_1.BorderWidthLeft = 0;
nestedTableCell25_1.BorderWidthBottom = 0;
nestedTable.AddCell(nestedTableCell20_1);
nestedTable.AddCell(nestedTableCell23_1);
nestedTable.AddCell(nestedTableCell24_1);
nestedTable.AddCell(nestedTableCell25_1);
string rupee = "One Thousand Only";
PdfPCell nestedTableCell26 = new PdfPCell(new iTextSharp.text.Paragraph("Total Amount in words:" + AmountInWords + "", MainTextRegularSmall));
nestedTableCell26.HorizontalAlignment = Element.ALIGN_LEFT;
nestedTableCell26.Colspan = 4;
//nestedTableCell26.Rowspan = 4;
nestedTableCell26.BorderWidthTop = 0;
nestedTableCell26.BorderWidthLeft = 0;
nestedTableCell26.BorderWidthRight = 0;
nestedTableCell26.BorderWidthBottom = 0;
PdfPCell nestedTableCell28 = new PdfPCell(new iTextSharp.text.Paragraph("\n(-)Discount " + DiscountRate + "%\n\n", MainTextRegularSmall));
nestedTableCell28.HorizontalAlignment = 2;
nestedTableCell28.BorderWidthLeft = 0;
nestedTableCell28.BorderWidthRight = 0;
nestedTableCell28.BorderWidthBottom = 0;
nestedTableCell28.BorderWidthTop = 0;
PdfPCell nestedTableCell29 = new PdfPCell(new iTextSharp.text.Paragraph("\n" + DiscountAmount + "\n\n", MainTextRegularSmall));
nestedTableCell29.HorizontalAlignment = 2;
nestedTableCell29.BorderWidth = 0;
nestedTableCell29.BorderWidthRight = 0;
nestedTableCell29.BorderWidthBottom = 0;
nestedTableCell29.BorderWidthLeft = 0;
nestedTable.AddCell(nestedTableCell26);
nestedTable.AddCell(nestedTableCell28);
nestedTable.AddCell(nestedTableCell29);
PdfPCell nestedTable_Cell30 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegularSmall));
nestedTable_Cell30.HorizontalAlignment = 2;
nestedTable_Cell30.BorderWidthTop = 0;
nestedTable_Cell30.BorderWidthRight = 0;
nestedTable_Cell30.BorderWidthBottom = 0;
nestedTable_Cell30.BorderWidthLeft = 0;
nestedTable_Cell30.Colspan = 4;
nestedTable_Cell30.Rowspan = 2;
PdfPTable nestedTableFornestedTable_Cell30 = new PdfPTable(new float[] { 50f, 50f });
nestedTableFornestedTable_Cell30.TotalWidth = 329f;
nestedTableFornestedTable_Cell30.LockedWidth = true;
nestedTableFornestedTable_Cell30.HorizontalAlignment = Element.ALIGN_LEFT;
nestedTableFornestedTable_Cell30.SpacingBefore = 2f;
nestedTableFornestedTable_Cell30.SpacingAfter = 4f;
Phrase pBVatTin = new Phrase();
Chunk c1 = new Chunk("Buyer's VAT Tin", MainTextRegularSmallBold);
Chunk c2 = new Chunk(": " + BuyersVatTinNo + "\n", MainTextRegularSmall);
pBVatTin.Add(c1);
pBVatTin.Add(c2);
PdfPCell nestedTableFornestedTable_Cell30_Cell01 = new PdfPCell(new iTextSharp.text.Paragraph(""));
nestedTableFornestedTable_Cell30_Cell01.HorizontalAlignment = 0;
nestedTableFornestedTable_Cell30_Cell01.BorderWidthTop = 0;
nestedTableFornestedTable_Cell30_Cell01.BorderWidthRight = 0;
nestedTableFornestedTable_Cell30_Cell01.BorderWidthBottom = 0;
nestedTableFornestedTable_Cell30_Cell01.BorderWidthLeft = 0;
nestedTableFornestedTable_Cell30_Cell01.AddElement(pBVatTin);
Phrase pBCstTin = new Phrase();
Chunk c3 = new Chunk("Buyer's CST Tin", MainTextRegularSmallBold);
Chunk c4 = new Chunk(": " + BuyersCstTinNo + "", MainTextRegularSmall);
pBCstTin.Add(c3);
pBCstTin.Add(c4);
PdfPCell nestedTableFornestedTable_Cell30_Cell02 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegularSmall));
nestedTableFornestedTable_Cell30_Cell02.HorizontalAlignment = 0;
nestedTableFornestedTable_Cell30_Cell02.BorderWidth = 0;
nestedTableFornestedTable_Cell30_Cell02.BorderWidthRight = 0;
nestedTableFornestedTable_Cell30_Cell02.BorderWidthBottom = 0;
nestedTableFornestedTable_Cell30_Cell02.BorderWidthLeft = 0;
nestedTableFornestedTable_Cell30_Cell02.AddElement(pBCstTin);
Phrase pSVatTin = new Phrase();
Chunk c5 = new Chunk("Seller's CST Tin", MainTextRegularSmallBold);
Chunk c6 = new Chunk(": " + SellerVatTinNo + "", MainTextRegularSmall);
pSVatTin.Add(c5);
pSVatTin.Add(c6);
PdfPCell nestedTableFornestedTable_Cell30_Cell03 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableFornestedTable_Cell30_Cell03.HorizontalAlignment = 0;
nestedTableFornestedTable_Cell30_Cell03.BorderWidthTop = 0;
nestedTableFornestedTable_Cell30_Cell03.BorderWidthRight = 0;
nestedTableFornestedTable_Cell30_Cell03.BorderWidthBottom = 0;
nestedTableFornestedTable_Cell30_Cell03.BorderWidthLeft = 0;
nestedTableFornestedTable_Cell30_Cell03.AddElement(pSVatTin);
Phrase pSCstTin = new Phrase();
Chunk c7 = new Chunk("Seller's CST Tin", MainTextRegularSmallBold);
Chunk c8 = new Chunk(": " + SellerCstTinNo + "", MainTextRegularSmall);
pSCstTin.Add(c7);
pSCstTin.Add(c8);
PdfPCell nestedTableFornestedTable_Cell30_Cell04 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableFornestedTable_Cell30_Cell04.HorizontalAlignment = 0;
nestedTableFornestedTable_Cell30_Cell04.BorderWidthTop = 0;
nestedTableFornestedTable_Cell30_Cell04.BorderWidthRight = 0;
nestedTableFornestedTable_Cell30_Cell04.BorderWidthBottom = 0;
nestedTableFornestedTable_Cell30_Cell04.BorderWidthLeft = 0;
nestedTableFornestedTable_Cell30_Cell04.AddElement(pSCstTin);
nestedTableFornestedTable_Cell30.AddCell(nestedTableFornestedTable_Cell30_Cell01);
nestedTableFornestedTable_Cell30.AddCell(nestedTableFornestedTable_Cell30_Cell02);
nestedTableFornestedTable_Cell30.AddCell(nestedTableFornestedTable_Cell30_Cell03);
nestedTableFornestedTable_Cell30.AddCell(nestedTableFornestedTable_Cell30_Cell04);
nestedTable_Cell30.AddElement(nestedTableFornestedTable_Cell30);
PdfPCell nestedTableCell30 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell30.HorizontalAlignment = 2;
nestedTableCell30.BorderWidthTop = 0;
nestedTableCell30.BorderWidthRight = 0;
nestedTableCell30.BorderWidthBottom = 0;
nestedTableCell30.BorderWidthLeft = 0;
PdfPCell nestedTableCell31 = new PdfPCell(new iTextSharp.text.Paragraph("\n" + WithDicoount_TotalAmount + "\n\n", MainTextRegularSmall));
nestedTableCell31.HorizontalAlignment = 2;
nestedTableCell31.BorderWidthTop = 0;
nestedTableCell31.BorderWidthRight = 0;
nestedTableCell31.BorderWidthBottom = 0;
nestedTableCell31.BorderWidthLeft = 0;
nestedTable.AddCell(nestedTable_Cell30);
nestedTable.AddCell(nestedTableCell30);
nestedTable.AddCell(nestedTableCell31);
PdfPCell nestedTable_Cell32 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));// I/We hereby certify that my/our registration certificate under the Maharashtra Value Addess Tax Act.2002 is in force on the date on which the sale of goods specified in this 'Tax Invoice' is made by me/us and that the transaction of sale covered by this 'Tax Invoice' has been effected by me/us and it shall be accounted for in the turn over of sales while fililng return and due tax, if any payable on the sales has been paid shall be paid.\n\n\n\n\n*T&c apply
nestedTable_Cell32.HorizontalAlignment = Element.ALIGN_JUSTIFIED;
nestedTable_Cell32.VerticalAlignment = Element.ALIGN_TOP;
nestedTable_Cell32.BorderWidthTop = 0;
nestedTable_Cell32.BorderWidthRight = 0;
nestedTable_Cell32.BorderWidthBottom = 0;
nestedTable_Cell32.BorderWidthLeft = 0;
nestedTable_Cell32.Colspan = 4;
nestedTable_Cell32.Rowspan = 5;
PdfPCell nestedTableCell32 = new PdfPCell(new iTextSharp.text.Paragraph("\n(+)Vat " + VatRate + "%\n\n", MainTextRegularSmall));
nestedTableCell32.HorizontalAlignment = 2;
nestedTableCell32.BorderWidthTop = 0;
nestedTableCell32.BorderWidthRight = 0;
nestedTableCell32.BorderWidthBottom = 0;
nestedTableCell32.BorderWidthLeft = 0;
PdfPCell nestedTableCell33 = new PdfPCell(new iTextSharp.text.Paragraph("\n" + VatAmount + "\n\n", MainTextRegularSmall));
nestedTableCell33.HorizontalAlignment = 2;
nestedTableCell33.BorderWidthTop = 0;
nestedTableCell33.BorderWidthRight = 0;
nestedTableCell33.BorderWidthBottom = 0;
nestedTableCell33.BorderWidthLeft = 0;
//nestedTable.AddCell(nestedTable_Cell32);
nestedTable.AddCell(nestedTableCell32);
nestedTable.AddCell(nestedTableCell33);
//PdfPCell nestedTable_Cell34 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
//nestedTable_Cell34.HorizontalAlignment = 2;
//nestedTable_Cell34.BorderWidthTop = 0;
//nestedTable_Cell34.BorderWidthRight = 0;
//nestedTable_Cell34.BorderWidthBottom = 0;
//nestedTable_Cell34.BorderWidthLeft= 0;
//nestedTable_Cell34.Colspan = 4;
PdfPCell nestedTableCell34 = new PdfPCell(new iTextSharp.text.Paragraph("\n\nGrand Total", MainTextRegularSmall));
nestedTableCell34.HorizontalAlignment = 2;
nestedTableCell34.BorderWidthTop = 0;
nestedTableCell34.BorderWidthRight = 0;
nestedTableCell34.BorderWidthBottom = 0;
nestedTableCell34.BorderWidthLeft = 0;
PdfPCell nestedTableCell35 = new PdfPCell(new iTextSharp.text.Paragraph("{Rounded Value}\n\n" + WithVat_GrandTotal + "\n\n", MainTextRegularSmall));
nestedTableCell35.HorizontalAlignment = 2;
nestedTableCell35.BorderWidthTop = 0;
nestedTableCell35.BorderWidthRight = 0;
nestedTableCell35.BorderWidthBottom = 0;
nestedTableCell35.BorderWidthLeft = 0;
nestedTable.AddCell(nestedTable_Cell32);
nestedTable.AddCell(nestedTableCell34);
nestedTable.AddCell(nestedTableCell35);
//created row for vattin no
//PdfPCell nestedTableCell36 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
//nestedTableCell36.HorizontalAlignment = 2;
//nestedTableCell36.BorderWidth = 0;
//nestedTableCell36.Colspan = 3;
//PdfPTable nestedTableForCell36 = new PdfPTable(new float[] { 44f,56f });
//nestedTableForCell36.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
//nestedTableForCell36.TotalWidth = 170f;
//nestedTableForCell36.LockedWidth = true;
//nestedTableForCell36.HorizontalAlignment = Element.ALIGN_LEFT;
//nestedTableForCell36.SpacingBefore = 0f;
//PdfPCell nestedTableForCell36Cell01 = new PdfPCell(new iTextSharp.text.Paragraph("Buyer's VATtin No", MainTextRegularBold));
//nestedTableForCell36Cell01.HorizontalAlignment = 0;
//nestedTableForCell36Cell01.BorderWidth = 0;
//PdfPCell nestedTableForCell36Cell02 = new PdfPCell(new iTextSharp.text.Paragraph(": ", MainTextRegularSmall));
//nestedTableForCell36Cell02.HorizontalAlignment = 1;
//nestedTableForCell36Cell02.BorderWidth = 0;
//PdfPCell nestedTableForCell36Cell03 = new PdfPCell(new iTextSharp.text.Paragraph("Seller's VATtin No", MainTextRegularBold));
//nestedTableForCell36Cell03.HorizontalAlignment = 0;
//nestedTableForCell36Cell03.BorderWidth = 0;
//PdfPCell nestedTableForCell36Cell04 = new PdfPCell(new iTextSharp.text.Paragraph(": ", MainTextRegularSmall));
//nestedTableForCell36Cell04.HorizontalAlignment = 1;
//nestedTableForCell36Cell04.BorderWidth = 0;
//PdfPCell nestedTableForCell36Cell05 = new PdfPCell(new iTextSharp.text.Paragraph("CST TIN No", MainTextRegularBold));
//nestedTableForCell36Cell05.HorizontalAlignment = 0;
//nestedTableForCell36Cell05.BorderWidth = 0;
//PdfPCell nestedTableForCell36Cell06 = new PdfPCell(new iTextSharp.text.Paragraph(": ", MainTextRegularSmall));
//nestedTableForCell36Cell06.HorizontalAlignment = 1;
//nestedTableForCell36Cell06.BorderWidth = 0;
//nestedTableForCell36.AddCell(nestedTableForCell36Cell01);
//nestedTableForCell36.AddCell(nestedTableForCell36Cell02);
//nestedTableForCell36.AddCell(nestedTableForCell36Cell03);
//nestedTableForCell36.AddCell(nestedTableForCell36Cell04);
//nestedTableForCell36.AddCell(nestedTableForCell36Cell05);
//nestedTableForCell36.AddCell(nestedTableForCell36Cell06);
//nestedTableCell36.AddElement(nestedTableForCell36);
//nestedTable.AddCell(nestedTableCell36);
PdfPCell nestedTableCell37 = new PdfPCell(new iTextSharp.text.Paragraph("", MainTextRegularBold));
nestedTableCell37.HorizontalAlignment = 0;
nestedTableCell37.BorderWidth = 0;
nestedTableCell37.Colspan = 3;
//nestedTable.AddCell(nestedTableCell37);
//Terms and conditions
//created row for vattin no
PdfPCell nestedTableCell38 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularSmall));
nestedTableCell38.HorizontalAlignment = 2;
nestedTableCell38.BorderWidth = 0;
nestedTableCell38.Colspan = 4;
PdfPTable nestedTableForCell38 = new PdfPTable(new float[] { 100f });
nestedTableForCell38.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
nestedTableForCell38.TotalWidth = 400f;
nestedTableForCell38.LockedWidth = true;
nestedTableForCell38.HorizontalAlignment = Element.ALIGN_LEFT;
PdfPCell nestedTableForCell38Cell01 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularBold));
nestedTableForCell38Cell01.HorizontalAlignment = 0;
nestedTableForCell38Cell01.BorderWidth = 0;
PdfPCell nestedTableForCell38Cell02 = new PdfPCell(new iTextSharp.text.Paragraph(" ", MainTextRegularExtraSmall));//terms 1. RATES ARE QUOTED EX-FACTORY BASIS.
nestedTableForCell38Cell02.HorizontalAlignment = 0;
nestedTableForCell38Cell02.BorderWidth = 0;
PdfPCell nestedTableForCell38Cell03 = new PdfPCell(new iTextSharp.text.Paragraph("2. VAT TAX 5%, TRANSPORT AND OCTROI WILL BE CHARGED EXTRA IF APPLICABLE.", MainTextRegularExtraSmall));
nestedTableForCell38Cell03.HorizontalAlignment = 0;
nestedTableForCell38Cell03.BorderWidth = 0;
PdfPCell nestedTableForCell38Cell04 = new PdfPCell(new iTextSharp.text.Paragraph("3. GOODS WILL BE DISPATCHED WITHIN 8 DAYS AFTER RECEIVING COMPLETE PAYMENT WITH PO.", MainTextRegularExtraSmall));
nestedTableForCell38Cell04.HorizontalAlignment = 0;
nestedTableForCell38Cell04.BorderWidth = 0;
PdfPCell nestedTableForCell38Cell05 = new PdfPCell(new iTextSharp.text.Paragraph("4. REPLACEMENT AND UNSOLD MATERIAL WILL NOT BE TAKEN BACK OR INTERTAINED.", MainTextRegularExtraSmall));
nestedTableForCell38Cell05.HorizontalAlignment = 0;
nestedTableForCell38Cell05.BorderWidth = 0;
PdfPCell nestedTableForCell38Cell06 = new PdfPCell(new iTextSharp.text.Paragraph("5. CHANGES IN PRICE LIST RESERVED WITH THE COMPANY.", MainTextRegularExtraSmall));
nestedTableForCell38Cell06.HorizontalAlignment = 0;
nestedTableForCell38Cell06.BorderWidth = 0;
nestedTableForCell38.AddCell(nestedTableForCell38Cell01);
//nestedTableForCell38.AddCell(nestedTableForCell38Cell02);
//nestedTableForCell38.AddCell(nestedTableForCell38Cell03);
//nestedTableForCell38.AddCell(nestedTableForCell38Cell04);
//nestedTableForCell38.AddCell(nestedTableForCell38Cell05);
//nestedTableForCell38.AddCell(nestedTableForCell38Cell06);
//nestedTableCell38.AddElement(nestedTableForCell38);
nestedTable.AddCell(nestedTableCell38);
PdfPCell nestedTableCell39 = new PdfPCell(new iTextSharp.text.Paragraph("FOR MAGANLAL CHIKKI", MainTextRegularSmallBold));
nestedTableCell39.HorizontalAlignment = 2;
nestedTableCell39.BorderWidth = 0;
nestedTableCell39.Colspan = 2;
nestedTable.AddCell(nestedTableCell39);
PdfPCell nestedTableCell40 = new PdfPCell(new iTextSharp.text.Paragraph("\n\n\n(Propritor/Auth. Signature)", MainTextRegularSmallBold));
nestedTableCell40.HorizontalAlignment = 2;
nestedTableCell40.BorderWidth = 0;
nestedTableCell40.Colspan = 2;
nestedTable.AddCell(nestedTableCell40);
MainTableCell1.AddElement(nestedTable);
MainTable.AddCell(MainTableCell1);
//print main data is over
MasterMainTable_Cell01.AddElement(MainTable);
//MasterMainTable_Cell02.AddElement(MainTable);
MasterMainTable.AddCell(MasterMainTable_Cell01);
MasterMainTable.AddCell(MasterMainTable_SpaceCell);
MasterMainTable.AddCell(MasterMainTable_Cell02);
pdfDoc.Add(MasterMainTable);
pdfDoc.Close();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Write(pdfDoc);
HttpContext.Current.Response.End();
#endregion
}