Vous êtes sur la page 1sur 34

Private Sub outerRpt(ByVal sparkcode As String)

Dim deptcd As String = ""


Dim offcd As String = ""
Dim offnam As String = ""
Dim sdo As String = ""
Dim billcd As String = ""
Dim mnth As String = ""
Dim yr As String = ""
Dim billgross As String = ""
Dim billded As String = ""
Dim billnet As String = ""
Dim EFBASIC As String = ""
Dim EFDA As String = ""
Dim EFHRA As String = ""
Dim EFCCA As String = ""
Dim SPLVSAL As String = ""
Dim netPay As String = ""
Dim EGPAY As String = ""
Dim totded As String = ""
Dim empcd As String = ""
Dim empnam As String = ""
Dim pan As String = ""
Dim desig As String = ""
Dim deptnam As String = ""
Dim address As String = ""
Dim headacc As String = ""
Dim entno As String = ""
Dim planOrNot As String = ""
Dim voteOrCharge As String = ""
Dim treasury_nam As String = ""
Dim fa_instAmt As String = ""
Dim bankname As String = ""
Dim bankcd As String = ""
Dim accno As String = ""
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Dim fntHead_1 As Font = FontFactory.GetFont("Arial", 9, 1, Color.BLA
CK)
Dim fntHead_2 As Font = FontFactory.GetFont("Arial", 9, 1, Color.BLA
CK)
Dim fntHead_3 As Font = FontFactory.GetFont("Arial", 9, 1, Color.BLA
CK)
Dim fntValue As Font = FontFactory.GetFont("Arial", 9, Color.BLACK)
Dim fntValue_1 As Font = FontFactory.GetFont("Arial", 10, Color.BLAC
K)
Dim fntValueW As Font = FontFactory.GetFont("Arial", 9, Color.WHITE)
'===================================================================
=
Dim document As Document = New Document(PageSize.A4, 20, 20, 10, 1)
Dim msReport As System.IO.MemoryStream = New System.IO.MemoryStream
Dim writer As PdfWriter = PdfWriter.GetInstance(document, msReport)
Dim footerr As HeaderFooter = New HeaderFooter(New Phrase(""), True)
footerr.Alignment = Element.ALIGN_CENTER
footerr.BorderWidth = 0
document.Footer = footerr
document.AddAuthor("NIC")
document.Open()
document.NewPage()
Try
'============================ values - begin====================
======================
Dim BillControl_query As String
BillControl_query = "select billcontrol.deptcd,department.deptna
me,billcontrol.offcd,offices.offname, "
BillControl_query += "offices.address,billcontrol.sdo_ddo,billco
ntrol.ddo_sdo_code,billcontrol.billcode, "
BillControl_query += "billcontrol.mnth,billcontrol.yr,billcontro
l.billgross,billcontrol.billded, "
BillControl_query += "billcontrol.billnet,billdate=billcontrol.p
reparedon from billcontrol "
BillControl_query += "inner join department on department.deptcd
=billcontrol.deptcd "
BillControl_query += "inner join offices on offices.offcd=billco
ntrol.offcd and offices.deptcd=billcontrol.deptcd "
BillControl_query += "where billcontrol.billcontrollcode='" & sp
arkcode & "' "
con = New SqlConnection(strconrpt)
If con.State = ConnectionState.Closed Then
con.Open()
End If
Dim sqlcmd_BillControl As SqlCommand
sqlcmd_BillControl = New SqlCommand(BillControl_query, con)
sqlcmd_BillControl.CommandTimeout = 0
Dim da_BillControl As New SqlDataAdapter(sqlcmd_BillControl)
Dim ds_BillControl As DataSet
Try
ds_BillControl = New DataSet
ds_BillControl.Clear()
da_BillControl.Fill(ds_BillControl, "BillControl")
da_BillControl.Dispose()
ds_BillControl.Dispose()
sqlcmd_BillControl.Dispose()
con.Close()
con.Dispose()
Dim i_bc As Integer
If ds_BillControl.Tables("BillControl").Rows.Count > 0 Then
For i_bc = 0 To ds_BillControl.Tables("BillControl").Row
s.Count - 1
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(0)) = False Then
deptcd = CStr(ds_BillControl.Tables("BillControl
").Rows(i_bc).Item(0)).Trim()
Else
deptcd = ""
End If

If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(2)) = False Then
offcd = CStr(ds_BillControl.Tables("BillControl"
).Rows(i_bc).Item(2)).Trim()
Else
offcd = ""
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(3)) = False Then
offnam = CStr(ds_BillControl.Tables("BillControl
").Rows(i_bc).Item(3)).Trim()
Else
offnam = ""
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(6)) = False Then
sdo = CStr(ds_BillControl.Tables("BillControl").
Rows(i_bc).Item(6)).Trim()
Else
sdo = ""
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(7)) = False Then
billcd = CStr(ds_BillControl.Tables("BillControl
").Rows(i_bc).Item(7)).Trim()
Else
billcd = ""
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(8)) = False Then
mnth = CStr(ds_BillControl.Tables("BillControl")
.Rows(i_bc).Item(8)).Trim()
Else
mnth = ""
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(9)) = False Then
yr = CStr(ds_BillControl.Tables("BillControl").R
ows(i_bc).Item(9)).Trim()
Else
yr = ""
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(10)) = False Then
billgross = CStr(ds_BillControl.Tables("BillCont
rol").Rows(i_bc).Item(10)).Trim()
Else
billgross = "0"
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(11)) = False Then
billded = CStr(ds_BillControl.Tables("BillContro
l").Rows(i_bc).Item(11)).Trim()
Else
billded = "0"
End If
If IsDBNull(ds_BillControl.Tables("BillControl").Row
s(i_bc).Item(12)) = False Then
billnet = CStr(ds_BillControl.Tables("BillContro
l").Rows(i_bc).Item(12)).Trim()
Else
billnet = "0"
End If
Next
End If
Catch ex As Exception
Message_box(Me, "Error in retrieving Bill Control values !")
Dim ermsg As String = ex.Message
Exit Sub
Finally
da_BillControl.Dispose()
End Try
'***************************************************************
**********************
Dim empDetails_query As String
empDetails_query = "select employeepersonneldetails.empcd,employ
eepersonneldetails.name, "
empDetails_query += "employeepersonneldetails.PAN,desig=designat
ions.description, "
empDetails_query += "deptname=department.deptname,offices.addres
s,offname=offices.offname from sdo "
empDetails_query += "inner join employeepersonneldetails on empl
oyeepersonneldetails.empcd=sdo.empcd "
empDetails_query += "left outer join department on employeeperso
nneldetails.presentdept=department.deptcd "
empDetails_query += "left outer join offices on employeepersonne
ldetails.presentdept=offices.deptcd and "
empDetails_query += "employeepersonneldetails.presentoff = offic
es.offcd "
empDetails_query += "left outer join designations on employeeper
sonneldetails.presentdept=designations.deptcd "
empDetails_query += "and employeepersonneldetails.designation=de
signations.desigcd "
empDetails_query += "inner join billcontrol on sdo.sdocd=billcon
trol.ddo_sdo_code and "
empDetails_query += "billcontrol.billcontrollcode='" & sparkcode
& "' "
con = New SqlConnection(strconrpt)
If con.State = ConnectionState.Closed Then
con.Open()
End If
Dim sqlcmd_empDetails As SqlCommand
sqlcmd_empDetails = New SqlCommand(empDetails_query, con)
sqlcmd_empDetails.CommandTimeout = 0
Dim da_empDetails As New SqlDataAdapter(sqlcmd_empDetails)
Dim ds_empDetails As DataSet
Try
ds_empDetails = New DataSet
ds_empDetails.Clear()
da_empDetails.Fill(ds_empDetails, "empDetails")
da_empDetails.Dispose()
ds_empDetails.Dispose()
sqlcmd_empDetails.Dispose()
con.Close()
con.Dispose()
Dim i_empDetails As Integer
If ds_empDetails.Tables("empDetails").Rows.Count > 0 Then
For i_empDetails = 0 To ds_empDetails.Tables("empDetails
").Rows.Count - 1
If IsDBNull(ds_empDetails.Tables("empDetails").Rows(
i_empDetails).Item(0)) = False Then
empcd = CStr(ds_empDetails.Tables("empDetails").
Rows(i_empDetails).Item(0)).Trim()
Else
empcd = ""
End If
If IsDBNull(ds_empDetails.Tables("empDetails").Rows(
i_empDetails).Item(1)) = False Then
empnam = CStr(ds_empDetails.Tables("empDetails")
.Rows(i_empDetails).Item(1)).Trim()
Else
empnam = ""
End If
If IsDBNull(ds_empDetails.Tables("empDetails").Rows(
i_empDetails).Item(2)) = False Then
pan = CStr(ds_empDetails.Tables("empDetails").Ro
ws(i_empDetails).Item(2)).Trim()
Else
pan = ""
End If
If IsDBNull(ds_empDetails.Tables("empDetails").Rows(
i_empDetails).Item(3)) = False Then
desig = CStr(ds_empDetails.Tables("empDetails").
Rows(i_empDetails).Item(3)).Trim()
Else
desig = ""
End If
If IsDBNull(ds_empDetails.Tables("empDetails").Rows(
i_empDetails).Item(4)) = False Then
deptnam = CStr(ds_empDetails.Tables("empDetails"
).Rows(i_empDetails).Item(4)).Trim()
Else
deptnam = ""
End If
If IsDBNull(ds_empDetails.Tables("empDetails").Rows(
i_empDetails).Item(5)) = False Then
address = CStr(ds_empDetails.Tables("empDetails"
).Rows(i_empDetails).Item(5)).Trim()
Else
address = ""
End If
Next
End If
Catch ex As Exception
Message_box(Me, "Error in retrieving Employee Details !")
Dim ermsg As String = ex.Message
Exit Sub
End Try

'***************************************************************
**********************
Dim BillDet_query As String
BillDet_query = "select entno,mh+'-'+smh+'-'+minh+'-'+sh+'-'+ssh
+'-'+deth+'-'+objh as headacc,pn,vc "
BillDet_query += "from sdo where empcd='" & empcd & "' and sdocd
='" & sdo & "' "
con = New SqlConnection(strconrpt)
If con.State = ConnectionState.Closed Then
con.Open()
End If
Dim sqlcmd_BillDet As SqlCommand
sqlcmd_BillDet = New SqlCommand(BillDet_query, con)
sqlcmd_BillDet.CommandTimeout = 0
Dim da_BillDet As New SqlDataAdapter(sqlcmd_BillDet)
Dim ds_BillDet As DataSet
Try
ds_BillDet = New DataSet
ds_BillDet.Clear()
da_BillDet.Fill(ds_BillDet, "BillDet")
da_BillDet.Dispose()
ds_BillDet.Dispose()
sqlcmd_BillDet.Dispose()
con.Close()
con.Dispose()
Dim i_bd As Integer
If ds_BillDet.Tables("BillDet").Rows.Count > 0 Then
For i_bd = 0 To ds_BillDet.Tables("BillDet").Rows.Count
- 1

If IsDBNull(ds_BillDet.Tables("BillDet").Rows(i_bd).
Item(0)) = False Then
entno = CStr(ds_BillDet.Tables("BillDet").Rows(i
_bd).Item(0)).Trim()
Else
entno = ""
End If
If IsDBNull(ds_BillDet.Tables("BillDet").Rows(i_bd).
Item(1)) = False Then
headacc = CStr(ds_BillDet.Tables("BillDet").Rows
(i_bd).Item(1)).Trim()
Else
headacc = ""
End If
If IsDBNull(ds_BillDet.Tables("BillDet").Rows(i_bd).
Item(2)) = False Then
planOrNot = CStr(ds_BillDet.Tables("BillDet").Ro
ws(i_bd).Item(2)).Trim()
Else
planOrNot = ""
End If
If IsDBNull(ds_BillDet.Tables("BillDet").Rows(i_bd).
Item(3)) = False Then
voteOrCharge = CStr(ds_BillDet.Tables("BillDet")
.Rows(i_bd).Item(3)).Trim()
Else
voteOrCharge = ""
End If
Next
End If
Catch ex As Exception
Message_box(Me, "Error in retrieving Bill Details !")
Dim ermsg As String = ex.Message
Exit Sub
Finally
da_BillDet.Dispose()
End Try
'***************************************************************
**********************
Dim Treasury_query As String
Treasury_query = "select treasury.treasurycd,treasury.treasuryn
ame from treasury,offices "
Treasury_query += "where treasury.treasurycd=offices.treasurycd
and offices.deptcd='" & deptcd & "' "
Treasury_query += "and offices.offcd='" & offcd & "' "
con = New SqlConnection(strconrpt)
If con.State = ConnectionState.Closed Then
con.Open()
End If
Dim sqlcmd_Treasury As SqlCommand
sqlcmd_Treasury = New SqlCommand(Treasury_query, con)
sqlcmd_Treasury.CommandTimeout = 0
Dim da_Treasury As New SqlDataAdapter(sqlcmd_Treasury)
Dim ds_Treasury As DataSet
Try
ds_Treasury = New DataSet
ds_Treasury.Clear()
da_Treasury.Fill(ds_Treasury, "Treasury")
da_Treasury.Dispose()
ds_Treasury.Dispose()
sqlcmd_Treasury.Dispose()
con.Close()
con.Dispose()
Dim i_t As Integer
If ds_Treasury.Tables("Treasury").Rows.Count > 0 Then
For i_t = 0 To ds_Treasury.Tables("Treasury").Rows.Count
- 1
If IsDBNull(ds_Treasury.Tables("Treasury").Rows(i_t)
.Item(1)) = False Then
treasury_nam = CStr(ds_Treasury.Tables("Treasury
").Rows(i_t).Item(1)).Trim()
Else
treasury_nam = ""
End If
Next
End If

Catch ex As Exception
Message_box(Me, "Error in retrieving Treasury Name !")
Dim ermsg As String = ex.Message
Exit Sub
Finally
da_Treasury.Dispose()
End Try
'***************************************************************
**********************
'***************************************************************
**********************
Dim bank_query As String
bank_query = "SELECT b.bankname,b.bankcd,pp.accno FROM bankdet
ails b "
bank_query += "inner join offices o on o.deptcd=b.deptcd and o.o
ffcd=b.offcd and o.salaryoffice=b.offcd "
bank_query += "inner join employeepersonneldetails e on e.presen
tdept=b.deptcd and e.presentoff=b.offcd and e.empcd='" & empcd & "' "
bank_query += "inner join presentsalarydetails pp on b.bankcd=p
p.bankcd and pp.empcd=e.empcd "
bank_query += "where right(b.bankcd,4)='0001' "
con = New SqlConnection(strconrpt)
If con.State = ConnectionState.Closed Then
con.Open()
End If
Dim sqlcmd_bank As SqlCommand
sqlcmd_bank = New SqlCommand(bank_query, con)
sqlcmd_bank.CommandTimeout = 0
Dim da_bank As New SqlDataAdapter(sqlcmd_bank)
Dim ds_bank As DataSet
Try
ds_bank = New DataSet
ds_bank.Clear()
da_bank.Fill(ds_bank, "bank")
da_bank.Dispose()
ds_bank.Dispose()
sqlcmd_bank.Dispose()
con.Close()
con.Dispose()
Dim i_bnk As Integer
If ds_bank.Tables("bank").Rows.Count > 0 Then
For i_bnk = 0 To ds_bank.Tables("bank").Rows.Count - 1
If IsDBNull(ds_bank.Tables("bank").Rows(i_bnk).Item(
0)) = False Then
bankname = CStr(ds_bank.Tables("bank").Rows(i_bn
k).Item(0)).Trim()
Else
bankname = ""
End If
If IsDBNull(ds_bank.Tables("bank").Rows(i_bnk).Item(
1)) = False Then
bankcd = CStr(ds_bank.Tables("bank").Rows(i_bnk)
.Item(1)).Trim()
Else
bankcd = ""
End If
If IsDBNull(ds_bank.Tables("bank").Rows(i_bnk).Item(
2)) = False Then
accno = CStr(ds_bank.Tables("bank").Rows(i_bnk).
Item(2)).Trim()
Else
accno = ""
End If
Next
End If

Catch ex As Exception
Message_box(Me, "Error in retrieving Bank Details !")
Dim ermsg As String = ex.Message
Exit Sub
Finally
da_bank.Dispose()
End Try
'***************************************************************
**********************
'============================ values - end======================
======================

'***************************************************************
********
'--------------------------- first page -- begin ---------------
--------
'===============================================================
========
'***************************************************************
********
'=========================== right side == begin ===============
========
Dim lin As String
lin = "_________________________________________________________
____________________________________________________"
Dim rightMasterTableWidth() As Integer = {300}
'---------------------------------------------------------------
---------
Dim rightMasterTable As PdfPTable = New PdfPTable(1)
rightMasterTable.TotalWidth = 500.0F
rightMasterTable.WidthPercentage = 100
rightMasterTable.SetWidths(rightMasterTableWidth)
rightMasterTable.DefaultCell.BorderColor = Color.WHITE
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
'---------------------------------------------------------------
-------
'===============================================================
=======
Dim rightHeader1TableWidth() As Integer = {40, 150}
'---------------------------------------------------------------
---------
Dim rightHeader1Table As PdfPTable = New PdfPTable(2)
rightHeader1Table.TotalWidth = 500.0F
rightHeader1Table.WidthPercentage = 100
rightHeader1Table.SetWidths(rightHeader1TableWidth)
rightHeader1Table.DefaultCell.BorderColor = Color.WHITE
rightHeader1Table.DefaultCell.HorizontalAlignment = Element.ALIG
N_LEFT
'---------------------------------------------------------------
-------
'===============================================================
=======
Dim amt As Integer = CInt(billnet) + 1
Dim amtDisp1, amtDisp2 As String
amtDisp1 = "Below Rs: " + CStr(amt)
amtDisp2 = "Rs: " + figuretowords(amt)
rightHeader1Table.AddCell(New Phrase(amtDisp1, fntHead_1))
rightHeader1Table.AddCell(New Phrase(amtDisp2, fntHead_1))
'===============================================================
=======
rightMasterTable.AddCell(rightHeader1Table)
'===============================================================
=======
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_CENTER
rightMasterTable.AddCell(New Phrase("Form TR 46", fntHead_2))
rightMasterTable.AddCell(New Phrase("[See Rule 164(a) of KTC Vol
1]", fntValue))
rightMasterTable.AddCell(New Phrase("BILL FOR PAY AND ALLOWANCES
/LEAVE SALARY OF A GAZETTED OFFICER", fntHead_2))
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
Dim namTrsy As String
namTrsy = "Name Of Treasury: " + treasury_nam
rightMasterTable.AddCell(New Phrase(namTrsy, fntValue))
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_CENTER
rightMasterTable.AddCell(New Phrase("FOR TREASURY USE", fntValue
_1))
Dim BoxHeadTableWidth() As Integer = {100, 100, 10, 30, 50}
'---------------------------------------------------------------
---------
Dim BoxHeadTable As PdfPTable = New PdfPTable(5)
BoxHeadTable.TotalWidth = 500.0F
BoxHeadTable.WidthPercentage = 50
BoxHeadTable.SetWidths(BoxHeadTableWidth)
BoxHeadTable.DefaultCell.BorderColor = Color.WHITE
BoxHeadTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
'----------------------
BoxHeadTable.AddCell(New Phrase("Computer Sequence No./Token No.
", fntValue))
'----------------------
Dim boxWidth() As Integer = {100}
'---------------------------------------------------------------
---------
Dim boxTable As PdfPTable = New PdfPTable(1)
boxTable.TotalWidth = 500.0F
boxTable.WidthPercentage = 50
boxTable.SetWidths(boxWidth)
boxTable.DefaultCell.BorderColor = Color.BLACK
boxTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
Dim dot As String = ". ."
boxTable.AddCell(New Phrase(dot, fntValueW))
'----------------------
BoxHeadTable.AddCell(boxTable)
BoxHeadTable.AddCell(New Phrase("", fntValue))
BoxHeadTable.AddCell(New Phrase("Date", fntValue))
Dim dateTableWidth() As Integer = {20, 20, 25}
'---------------------------------------------------------------
---------
Dim dateTable As PdfPTable = New PdfPTable(3)
dateTable.TotalWidth = 500.0F
dateTable.WidthPercentage = 50
dateTable.SetWidths(dateTableWidth)
dateTable.DefaultCell.BorderColor = Color.BLACK
dateTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
'----------------------
Dim dot2 As String
dot2 = ". ."
dateTable.AddCell(New Phrase(dot2, fntValueW))
dateTable.AddCell(New Phrase(dot2, fntValueW))
dateTable.AddCell(New Phrase(dot2, fntValueW))
BoxHeadTable.AddCell(dateTable)
'---------------------------------------------------------------
-------
rightMasterTable.AddCell(BoxHeadTable)
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
rightMasterTable.AddCell(New Phrase("Scroll No:", fntValue))
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
'===============================================================
=======
Dim rightHeader3TableWidth() As Integer = {100, 100}
'---------------------------------------------------------------
---------
Dim rightHeader3Table As PdfPTable = New PdfPTable(2)
rightHeader3Table.TotalWidth = 500.0F
rightHeader3Table.WidthPercentage = 100
rightHeader3Table.SetWidths(rightHeader3TableWidth)
rightHeader3Table.DefaultCell.BorderColor = Color.WHITE
rightHeader3Table.DefaultCell.HorizontalAlignment = Element.ALIG
N_LEFT
'---------------------------------------------------------------
-------
Dim deptDisp, ddoDisp, desigDisp, gennoDisp, offNamDisp, panDisp
As String
deptDisp = "SDO Code : " + sdo
ddoDisp = "Name : " + empnam
rightHeader3Table.AddCell(New Phrase(deptDisp, fntValue))
rightHeader3Table.AddCell(New Phrase(ddoDisp, fntValue))

desigDisp = "Designation : " + desig


gennoDisp = "G.E.No : " + entno
rightHeader3Table.AddCell(New Phrase(desigDisp, fntValue))
rightHeader3Table.AddCell(New Phrase(gennoDisp, fntValue))
offNamDisp = "Name of Office: " + offnam
panDisp = "PAN/GIR : " + pan
rightHeader3Table.AddCell(New Phrase(offNamDisp, fntValue))
rightHeader3Table.AddCell(New Phrase(panDisp, fntValue))
'===============================================================
=======
rightMasterTable.AddCell(rightHeader3Table)
'===============================================================
=======
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
'===============================================================
=======
Dim rightHeader4TableWidth() As Integer = {50, 90, 60, 25, 60, 1
5}
'---------------------------------------------------------------
---------
Dim rightHeader4Table As PdfPTable = New PdfPTable(6)
rightHeader4Table.TotalWidth = 500.0F
rightHeader4Table.WidthPercentage = 100
rightHeader4Table.SetWidths(rightHeader4TableWidth)
rightHeader4Table.DefaultCell.BorderColor = Color.WHITE
rightHeader4Table.DefaultCell.HorizontalAlignment = Element.ALIG
N_LEFT
'---------------------------------------------------------------
-------
rightHeader4Table.AddCell(New Phrase("Head of Account", fntValue
))
rightHeader4Table.AddCell(New Phrase(headacc, fntValue))
rightHeader4Table.AddCell(New Phrase("Plan(P)/Non-Plan(N)", fntV
alue))
'Dim planCell As PdfPCell = New PdfPCell(New Phrase(planOrNot, f
ntValue))
'planCell.HorizontalAlignment = Element.ALIGN_CENTER
'planCell.BorderColor = Color.BLACK
'planCell.Colspan = 1
Dim planTableWidth() As Integer = {20}
'---------------------------------------------------------------
---------
Dim planTable As PdfPTable = New PdfPTable(1)
planTable.TotalWidth = 500.0F
planTable.WidthPercentage = 25
planTable.SetWidths(planTableWidth)
planTable.DefaultCell.BorderColor = Color.BLACK
planTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER
'---------------------------------------------------------------
-------
If planOrNot = "" Then
planTable.AddCell(New Phrase(". .", fntValueW))
Else
planTable.AddCell(New Phrase(planOrNot, fntValue))
End If
rightHeader4Table.AddCell(planTable)
rightHeader4Table.AddCell(New Phrase("Voted(v)/Charged(c)", fntV
alue))
'Dim voteCell As PdfPCell = New PdfPCell(New Phrase(voteOrCharge
, fntValue))
'voteCell.HorizontalAlignment = Element.ALIGN_CENTER
'voteCell.BorderColor = Color.BLACK
'voteCell.Colspan = 1
Dim voteTableWidth() As Integer = {20}
'---------------------------------------------------------------
---------
Dim voteTable As PdfPTable = New PdfPTable(1)
voteTable.TotalWidth = 500.0F
voteTable.WidthPercentage = 25
voteTable.SetWidths(voteTableWidth)
voteTable.DefaultCell.BorderColor = Color.BLACK
voteTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER
'---------------------------------------------------------------
-------
If voteOrCharge = "" Then
voteTable.AddCell(New Phrase(". .", fntValueW))
Else
voteTable.AddCell(New Phrase(voteOrCharge, fntValue))
End If
rightHeader4Table.AddCell(voteTable)

'------------------------------------------
Dim rightHeader5TableWidth() As Integer = {50, 90, 40, 60, 30, 4
0}
'---------------------------------------------------------------
---------
Dim rightHeader5Table As PdfPTable = New PdfPTable(6)
rightHeader5Table.TotalWidth = 500.0F
rightHeader5Table.WidthPercentage = 100
rightHeader5Table.SetWidths(rightHeader5TableWidth)
rightHeader5Table.DefaultCell.BorderColor = Color.WHITE
rightHeader5Table.DefaultCell.HorizontalAlignment = Element.ALIG
N_LEFT
'---------------------------------------------------------------
-------
rightHeader5Table.AddCell(New Phrase("", fntValue))
rightHeader5Table.AddCell(New Phrase("MAJ-SMJ-MIN-SUB-SSUB", fnt
Head_1))
rightHeader5Table.DefaultCell.HorizontalAlignment = Element.ALIG
N_CENTER
rightHeader5Table.AddCell(New Phrase("CPS/CSS:", fntValue))
Dim cpsTableWidth() As Integer = {20, 20, 20}
'---------------------------------------------------------------
---------
Dim cpsTable As PdfPTable = New PdfPTable(3)
cpsTable.TotalWidth = 500.0F
cpsTable.WidthPercentage = 100
cpsTable.SetWidths(cpsTableWidth)
cpsTable.DefaultCell.BorderColor = Color.BLACK
cpsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER
'---------------------------------------------------------------
-------
Dim dot3 As String
dot3 = ". ."
cpsTable.AddCell(New Phrase(dot3, fntValueW))
cpsTable.AddCell(New Phrase(dot3, fntValueW))
cpsTable.AddCell(New Phrase(dot3, fntValueW))
rightHeader5Table.AddCell(cpsTable)
rightHeader5Table.AddCell(New Phrase("Ratio:", fntValue))
Dim ratioTableWidth() As Integer = {20}
'---------------------------------------------------------------
---------
Dim ratioTable As PdfPTable = New PdfPTable(1)
ratioTable.TotalWidth = 500.0F
ratioTable.WidthPercentage = 100
ratioTable.SetWidths(ratioTableWidth)
ratioTable.DefaultCell.BorderColor = Color.BLACK
ratioTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTE
R
'---------------------------------------------------------------
-------
ratioTable.AddCell(New Phrase(dot3, fntValueW))
rightHeader5Table.AddCell(ratioTable)
'===============================================================
=======
rightMasterTable.AddCell(rightHeader4Table)
rightMasterTable.AddCell(rightHeader5Table)
'===============================================================
=======
Dim recPrd As String
recPrd = "Festival Advance for the month of " + MonthName(CInt(d
dlMnth.SelectedValue.Trim)) + " " + txtYr.Text.Trim
rightMasterTable.AddCell(New Phrase(recPrd, fntValue))
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_CENTER
rightMasterTable.AddCell(New Phrase("ABSTRACT OF THE BILL", fntH
ead_2))
'===============================================================
=======
Dim dueDeductTableWidth() As Integer = {100, 100}
'---------------------------------------------------------------
---------
Dim dueDeductTable As PdfPTable = New PdfPTable(2)
dueDeductTable.TotalWidth = 500.0F
dueDeductTable.WidthPercentage = 100
dueDeductTable.SetWidths(dueDeductTableWidth)
dueDeductTable.DefaultCell.BorderColor = Color.WHITE
dueDeductTable.DefaultCell.HorizontalAlignment = Element.ALIGN_L
EFT
'===============================================================
=======
'===============================================================
=======
Dim duesTableWidth() As Integer = {30, 80, 60}
'---------------------------------------------------------------
---------
Dim duesTable As PdfPTable = New PdfPTable(3)
duesTable.TotalWidth = 500.0F
duesTable.WidthPercentage = 50
duesTable.SetWidths(duesTableWidth)
duesTable.DefaultCell.BorderColor = Color.WHITE
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
'---------------------------------------------------------------
-------
duesTable.AddCell(New Phrase("CODE", fntHead_1))
duesTable.AddCell(New Phrase("A. DUES", fntHead_1))
duesTable.AddCell(New Phrase("Total in Rs.", fntHead_1))
duesTable.DefaultCell.BorderColor = Color.BLACK
'------------------
duesTable.AddCell(New Phrase("", fntValue))
duesTable.AddCell(New Phrase("Festival Advance", fntValue))
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
If CInt(billgross) > 0 Then
duesTable.AddCell(New Phrase(CInt(billgross), fntValue_1))
Else
duesTable.AddCell(New Phrase("", fntValue_1))
End If
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
duesTable.AddCell(New Phrase("01", fntValue))
duesTable.AddCell(New Phrase("Pay/LS/SP/Wages/TP", fntValue))
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
duesTable.AddCell(New Phrase("", fntValue_1))
'-------------------------
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
duesTable.AddCell(New Phrase("22", fntValue))
duesTable.AddCell(New Phrase("DA/ADA", fntValue))
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
duesTable.AddCell(New Phrase("", fntValue_1))
'-------------------------
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
duesTable.AddCell(New Phrase("23", fntValue))
duesTable.AddCell(New Phrase("House Rent Allowance", fntValue))
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
duesTable.AddCell(New Phrase("", fntValue_1))
'-------------------------
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
duesTable.AddCell(New Phrase("24", fntValue))
duesTable.AddCell(New Phrase("CCA", fntValue))
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
duesTable.AddCell(New Phrase("", fntValue_1))
'-------------------------
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
duesTable.AddCell(New Phrase("", fntValue))
duesTable.AddCell(New Phrase("Special Leave Salary", fntValue))
duesTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
duesTable.AddCell(New Phrase("", fntValue_1))
'==========================================

'===============================================================
=======
Dim dedctTableWidth() As Integer = {30, 100, 60}
'---------------------------------------------------------------
---------
Dim dedctTable As PdfPTable = New PdfPTable(3)
dedctTable.TotalWidth = 500.0F
dedctTable.WidthPercentage = 50
dedctTable.SetWidths(dedctTableWidth)
dedctTable.DefaultCell.BorderColor = Color.WHITE
dedctTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
'---------------------------------------------------------------
-------
dedctTable.AddCell(New Phrase("CODE", fntHead_1))
dedctTable.AddCell(New Phrase("B. DEDUCTIONS", fntHead_1))
dedctTable.AddCell(New Phrase("Total in Rs.", fntHead_1))
dedctTable.DefaultCell.BorderColor = Color.BLACK

'-------------------------
dedctTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTE
R
dedctTable.AddCell(New Phrase("", fntHead_1))
dedctTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
dedctTable.AddCell(New Phrase("", fntHead_1))
dedctTable.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT
dedctTable.AddCell(New Phrase("", fntHead_1))
'-------------------------
'---------------------------------------------------------------
-----------
dedctTable.DefaultCell.BorderColor = Color.LIGHT_GRAY
dedctTable.DefaultCell.BackgroundColor = Color.LIGHT_GRAY
dedctTable.AddCell(New Phrase("", fntValue))
dedctTable.AddCell(New Phrase("", fntValue))
dedctTable.AddCell(New Phrase("", fntValue))
duesTable.DefaultCell.BorderColor = Color.LIGHT_GRAY
duesTable.DefaultCell.BackgroundColor = Color.LIGHT_GRAY
duesTable.AddCell(New Phrase("", fntValue))
duesTable.AddCell(New Phrase("", fntValue))
duesTable.AddCell(New Phrase("", fntValue))
'===============================================================
=======
Dim cnt1, cnt2 As Integer
cnt1 = duesTable.Rows.Count
cnt2 = dedctTable.Rows.Count
If cnt1 <> cnt2 Then
If cnt1 > cnt2 Then
dedctTable.DefaultCell.BorderColor = Color.WHITE
dedctTable.DefaultCell.BackgroundColor = Color.WHITE
dedctTable.DefaultCell.Padding = 0
dedctTable.AddCell(New Phrase("", fntValue))
dedctTable.AddCell(New Phrase("", fntValue))
dedctTable.AddCell(New Phrase("", fntValue))
ElseIf cnt2 > cnt1 Then
duesTable.DefaultCell.BorderColor = Color.WHITE
duesTable.DefaultCell.BackgroundColor = Color.WHITE
duesTable.DefaultCell.Padding = 0
duesTable.AddCell(New Phrase("", fntValue))
duesTable.AddCell(New Phrase("", fntValue))
duesTable.AddCell(New Phrase("", fntValue))
End If
End If

'===============================================================
=======
dueDeductTable.AddCell(duesTable)
dueDeductTable.AddCell(dedctTable)
'==================
dueDeductTable.AddCell(New Phrase("", fntHead_1))
dueDeductTable.AddCell(New Phrase("", fntHead_1))
'---------------------------------------------------------------
---
Dim tot1TableWidth() As Integer = {30, 80, 60}
'---------------------------------------------------------------
---------
Dim tot1Table As PdfPTable = New PdfPTable(3)
tot1Table.TotalWidth = 500.0F
tot1Table.WidthPercentage = 25
tot1Table.SetWidths(tot1TableWidth)
tot1Table.DefaultCell.BorderColor = Color.WHITE
tot1Table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
'---------------------------------------------------------------
-------
Dim tot2TableWidth() As Integer = {30, 100, 60}
'---------------------------------------------------------------
---------
Dim tot2Table As PdfPTable = New PdfPTable(3)
tot2Table.TotalWidth = 500.0F
tot2Table.WidthPercentage = 25
tot2Table.SetWidths(tot2TableWidth)
tot2Table.DefaultCell.BorderColor = Color.WHITE
tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
'---------------------------------------------------------------
-------
'-------------------------
tot1Table.AddCell(New Phrase(" ", fntValue))
tot1Table.AddCell(New Phrase("Total A Gross ", fntValue))
Dim TotA As Integer = CInt(billgross)
tot1Table.AddCell(New Phrase(TotA, fntHead_1))
'---------------------------------------------------------------
---
tot1Table.AddCell(New Phrase(" ", fntValue))
tot1Table.AddCell(New Phrase("Total B ", fntValue))
tot1Table.AddCell(New Phrase("", fntHead_1))
'---------------------------------------------------------------
---
' tot1Table.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGH
T
tot1Table.AddCell(New Phrase(" ", fntValue))
tot1Table.AddCell(New Phrase("Total = A - B ", fntValue))
' tot1Table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
Dim totAB As Integer = CInt(billgross)
tot1Table.AddCell(New Phrase(totAB, fntHead_1))
'---------------------------------------------------------------
---
'---------------------------------------------------------------
---
'----------------------------
' tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGH
T
tot2Table.AddCell(New Phrase(" ", fntValue))
tot2Table.AddCell(New Phrase("Tot B ", fntValue))
' tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
tot2Table.AddCell(New Phrase("", fntHead_1))
'----------------------------
'----------------------------
' tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_RIG
HT
tot2Table.AddCell(New Phrase(" ", fntValue))
tot2Table.AddCell(New Phrase("", fntValue))
' tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
tot2Table.AddCell(New Phrase("", fntHead_1))
'----------------------------
' tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_RIG
HT
tot2Table.AddCell(New Phrase(" ", fntValue))
tot2Table.AddCell(New Phrase("Received Rs: ", fntValue))
' tot2Table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
tot2Table.AddCell(New Phrase("", fntHead_1))
'---------------------------------------------------------------
---

dueDeductTable.AddCell(tot1Table)
dueDeductTable.AddCell(tot2Table)
'===============================================================
=======
rightMasterTable.AddCell(dueDeductTable)
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
Dim ttl As String
ttl = "Rupees " + figuretowords(CInt(billnet))
rightMasterTable.AddCell(New Phrase(ttl, fntHead_1))
'rightMasterTable.AddCell(New Phrase("", fntHead_1))
'rightMasterTable.AddCell(New Phrase("", fntHead_1))
'rightMasterTable.AddCell(New Phrase("", fntHead_1))
'rightMasterTable.AddCell(New Phrase("", fntHead_1))
Dim stampMasterTableWidth() As Integer = {240, 30}
'---------------------------------------------------------------
---------
Dim stampMasterTable As PdfPTable = New PdfPTable(2)
stampMasterTable.TotalWidth = 500.0F
stampMasterTable.WidthPercentage = 50
stampMasterTable.SetWidths(stampMasterTableWidth)
stampMasterTable.DefaultCell.BorderColor = Color.WHITE
stampMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
'---------------------------------------------------------------
-------
Dim stampTable1Width() As Integer = {150, 90}
'---------------------------------------------------------------
---------
Dim stampTable1 As PdfPTable = New PdfPTable(2)
stampTable1.TotalWidth = 500.0F
stampTable1.WidthPercentage = 50
stampTable1.SetWidths(stampTable1Width)
stampTable1.DefaultCell.BorderColor = Color.WHITE
stampTable1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
'---------------------------------------------------------------
-------
Dim inCashBank, bnk, spc As String
spc = "
"
bnk = bankname + " / " + accno
inCashBank = "in CASH/TC to TSB:" + spc + bnk
stampTable1.AddCell(New Phrase(inCashBank, fntValue))
stampTable1.AddCell(New Phrase("Certified that the Statement of
claims drawn during the previous month has been furnished to the C.O/ DDO", fntH
ead_3))
'--------------------
'Dim bankCell As PdfPCell = New PdfPCell(New Phrase("*** Bank Na
me ***", fntValue))
'bankCell.HorizontalAlignment = Element.ALIGN_LEFT
'bankCell.BorderColor = Color.WHITE
'bankCell.Colspan = 2
'stampTable1.AddCell(bankCell)
'--------------------
stampTable1.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGH
T
stampTable1.AddCell(New Phrase("Signature:", fntValue))
stampTable1.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT
stampTable1.AddCell(New Phrase(empnam, fntHead_3))
'--------------------
stampTable1.AddCell(New Phrase("Station : " + address, fntValue)
)
stampTable1.AddCell(New Phrase(desig, fntHead_3))
'--------------------
stampTable1.AddCell(New Phrase("Date : " + CStr(System.DateTime.
Now.Date.ToString("dd/MM/yyyy")), fntValue))
stampTable1.AddCell(New Phrase(deptnam, fntHead_3))
'--------------------
Dim stampTableWidth() As Integer = {30}
'---------------------------------------------------------------
---------
Dim stampTable As PdfPTable = New PdfPTable(1)
stampTable.TotalWidth = 500.0F
stampTable.WidthPercentage = 50
stampTable.SetWidths(stampTableWidth)
stampTable.DefaultCell.BorderColor = Color.LIGHT_GRAY
stampTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTE
R
Dim sdot As String = ".
."
stampTable.AddCell(New Phrase(sdot, fntValueW))
stampTable.AddCell(New Phrase("Stamp", fntHead_1))
stampTable.AddCell(New Phrase(sdot, fntValueW))
'---------------------------------------------------------------
-------
stampMasterTable.AddCell(stampTable1)
stampMasterTable.AddCell(stampTable)
'---------------------------------------------------------------
-------
rightMasterTable.AddCell(stampMasterTable)
'---------------------------------------------------------------
-------
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_CENTER
rightMasterTable.AddCell(New Phrase("FOR TREASURY USE ONLY", fnt
Head_1))
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_LEFT
rightMasterTable.AddCell(New Phrase("Pay Rs.....................
.............(Rupees............................................................
................................................................................
........only)", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("In Cash/Cheque.............
................(Rupees.........................................................
................................................................................
..only)", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("by RBR and Rs..............
.................(Rupees........................................................
........................................................................only)by
TC", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("POC No.....................
....................................................................... Date ..
........../............/...............", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
Dim st2 As String
st2 = "Accountant
Treasury Officer"
rightMasterTable.AddCell(New Phrase(st2, fntValue))
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
Dim st3 As String
st3 = "Received Pay Order Cheque
Pay Order Cheque issued by"
rightMasterTable.AddCell(New Phrase(st3, fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
rightMasterTable.AddCell(New Phrase("", fntValue))
Dim st4 As String
st4 = "Signature of Recipient
Accountant"
rightMasterTable.AddCell(New Phrase(st4, fntValue))
rightMasterTable.AddCell(New Phrase(lin, fntHead_1))
rightMasterTable.DefaultCell.HorizontalAlignment = Element.ALIGN
_RIGHT
rightMasterTable.AddCell(New Phrase("Spark Code : " + sparkcode
, fntValue))
'=========================== right side == end =================
=======

'***************************************************************
******
'--------------------------- first page -- end -----------------
------
'***************************************************************
******
document.Add(rightMasterTable)
document.SetMargins(20, 20, 40, 1)
document.NewPage()
'***************************************************************
******
'------------------------- second page -- begin ----------------
------
'***************************************************************
******
Dim sndPageTableWidth() As Integer = {150, 150}
'---------------------------------------------------------------
---------
Dim sndPageTable As PdfPTable = New PdfPTable(2)
sndPageTable.TotalWidth = 500.0F
sndPageTable.WidthPercentage = 100
sndPageTable.SetWidths(sndPageTableWidth)
sndPageTable.DefaultCell.BorderColor = Color.WHITE
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
'---------------------------------------------------------------
-------
Dim sndPgSpace_cell As PdfPCell = New PdfPCell(New Phrase("", fn
tValue))
sndPgSpace_cell.HorizontalAlignment = Element.ALIGN_LEFT
sndPgSpace_cell.BorderColor = Color.WHITE
sndPgSpace_cell.Colspan = 2
'---------
Dim stt As String
stt = "Note: Govt. accept no responsibility for any fraud or mis
appropriation in respect of money or draft made over to messenger."
Dim sndPg_cell As PdfPCell = New PdfPCell(New Phrase(stt, fntVal
ue))
sndPg_cell.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell.BorderColor = Color.WHITE
sndPg_cell.Colspan = 2
sndPageTable.AddCell(sndPg_cell)
'---------
sndPageTable.AddCell(sndPgSpace_cell)
'---------
Dim stt1 As String
stt1 = "CERTIFICATE FOR CLAIMING HRA: I certify that I did not o
ccupy Govt. quarters during the period for which HRA is claimed in this bill."
Dim sndPg_cell1 As PdfPCell = New PdfPCell(New Phrase(stt1, fntV
alue))
sndPg_cell1.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell1.BorderColor = Color.WHITE
sndPg_cell1.Colspan = 2
sndPageTable.AddCell(sndPg_cell1)
'---------
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(New Phrase("Date : ", fntValue))
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CEN
TER
sndPageTable.AddCell(New Phrase("Signature : ................
..........................", fntValue))
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
'---------
Dim sndPgLine_cell As PdfPCell = New PdfPCell(New Phrase(lin, fn
tHead_1))
sndPgLine_cell.HorizontalAlignment = Element.ALIGN_LEFT
sndPgLine_cell.BorderColor = Color.WHITE
sndPgLine_cell.Colspan = 2
sndPageTable.AddCell(sndPgLine_cell)
'---------
Dim stt2 As String
stt2 = "LIFE CERTIFICATE referred in No.7: Sri/Smt ............
...............................................................................
is alive on this ......................................... (date)"
Dim sndPg_cell2 As PdfPCell = New PdfPCell(New Phrase(stt2, fntV
alue))
sndPg_cell2.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell2.BorderColor = Color.WHITE
sndPg_cell2.Colspan = 2
sndPageTable.AddCell(sndPg_cell2)
'---------
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
'---------
sndPageTable.AddCell(New Phrase("Station: ......................
........................................", fntValue))
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CEN
TER
sndPageTable.AddCell(New Phrase("Signature : ................
..........................", fntValue))
'---------
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
'---------
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
sndPageTable.AddCell(New Phrase("Date: .........................
.........................................", fntValue))
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CEN
TER
sndPageTable.AddCell(New Phrase("Designation : .................
........................", fntValue))
sndPageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEF
T
'---------
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
'---------
sndPageTable.AddCell(New Phrase("Space for Additional certificat
es", fntValue))
sndPageTable.AddCell(New Phrase("", fntValue))
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
sndPageTable.AddCell(sndPgSpace_cell)
'---------
sndPageTable.AddCell(sndPgLine_cell)
'---------
Dim sndPageTable1Width() As Integer = {100, 200}
'---------------------------------------------------------------
---------
Dim sndPageTable1 As PdfPTable = New PdfPTable(2)
sndPageTable1.TotalWidth = 500.0F
sndPageTable1.WidthPercentage = 100
sndPageTable1.SetWidths(sndPageTable1Width)
sndPageTable1.DefaultCell.BorderColor = Color.WHITE
sndPageTable1.DefaultCell.HorizontalAlignment = Element.ALIGN_LE
FT
sndPageTable1.SpacingAfter = 2
'---------------------------------------------------------------
-------
sndPageTable1.AddCell(New Phrase("Allotment Details(For wages cl
aim)", fntValue))
sndPageTable1.AddCell(New Phrase("", fntValue))
sndPageTable1.AddCell(sndPgSpace_cell)
'---------
sndPageTable1.AddCell(New Phrase("Appropriation for curent year
:", fntValue))
sndPageTable1.AddCell(New Phrase("Rs............................
................................................................................
", fntValue))
'---------
'---------
sndPageTable1.AddCell(New Phrase("Expenditure excluding the bill
:", fntValue))
sndPageTable1.AddCell(New Phrase("Rs............................
................................................................................
", fntValue))
'---------
'---------
sndPageTable1.AddCell(New Phrase("Expenditure including the bill
:", fntValue))
sndPageTable1.AddCell(New Phrase("Rs............................
................................................................................
", fntValue))
'---------
'---------
sndPageTable1.AddCell(New Phrase("Balance :", fntValue))
sndPageTable1.AddCell(New Phrase("Rs............................
................................................................................
", fntValue))
'---------
'---------
sndPageTable1.AddCell(sndPgSpace_cell)
sndPageTable1.AddCell(sndPgSpace_cell)
sndPageTable1.AddCell(sndPgSpace_cell)
sndPageTable1.AddCell(sndPgSpace_cell)
'---------
'---------
sndPageTable1.AddCell(New Phrase("", fntValue))
sndPageTable1.DefaultCell.HorizontalAlignment = Element.ALIGN_RI
GHT
sndPageTable1.AddCell(New Phrase("Signature of Drawing Officer."
, fntValue))
'---------
Dim directionsTableWidth() As Integer = {10, 20, 250}
'---------------------------------------------------------------
---------
Dim directionsTable As PdfPTable = New PdfPTable(3)
directionsTable.TotalWidth = 500.0F
directionsTable.WidthPercentage = 100
directionsTable.SetWidths(directionsTableWidth)
directionsTable.DefaultCell.BorderColor = Color.WHITE
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
'---------
Dim dirctn_cell As PdfPCell = New PdfPCell(New Phrase("DIRECTION
S FOR USE", fntValue))
dirctn_cell.HorizontalAlignment = Element.ALIGN_LEFT
dirctn_cell.BorderColor = Color.WHITE
dirctn_cell.Colspan = 3
'---------
directionsTable.AddCell(dirctn_cell)
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("1", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("A salary bill may be endorse
d to a banker or other recognised agent and submitted for collection through suc
h Banker or Agent if the Officer desires so.", fntValue))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("2", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("An Officer appointed to the
Govt. service must furnish a certificate that he has submitted proposals for SLI
(Official Branch), and applied for admission to the GPF as per rules.", fntValu
e))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("3", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("Income Tax should be deducte
d as per rules.", fntValue))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("4", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("Leave salary/transit pay sho
uld be claimed after getting pay slip from the AG", fntValue))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("5", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("Copy of LPC/Pay slip should
attached with the bills as per rules.", fntValue))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("6", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("The details of salary encash
ed should be informed to the head of office with copy of FBS shedule.", fntValue
))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("7", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("An Officer who signs his own
bills while abscent on leave must either present it in person or furnish the ab
ove life certificate,signed by a responsible officer of Government or some other
well known and tustworthy person known to the Treasury Off.", fntValue))
'---------
'---------
directionsTable.AddCell(New Phrase("", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
CENTER
directionsTable.AddCell(New Phrase("8", fntValue))
directionsTable.DefaultCell.HorizontalAlignment = Element.ALIGN_
LEFT
directionsTable.AddCell(New Phrase("If conveyance allowance is c
laimed in this bill, a certificate as per rules should be furnished.", fntValue)
)
'---------

Dim sndPageTableWidth2() As Integer = {150, 150}


'---------------------------------------------------------------
---------
Dim sndPageTable2 As PdfPTable = New PdfPTable(2)
sndPageTable2.TotalWidth = 500.0F
sndPageTable2.WidthPercentage = 100
sndPageTable2.SetWidths(sndPageTableWidth)
sndPageTable2.DefaultCell.BorderColor = Color.WHITE
sndPageTable2.DefaultCell.HorizontalAlignment = Element.ALIGN_LE
FT
'---------------------------------------------------------------
-------
sndPageTable2.AddCell(sndPgLine_cell)
'---------
Dim sndPg_cell3 As PdfPCell = New PdfPCell(New Phrase("FOR THE U
SE OF AG'S OFFICE ", fntValue))
sndPg_cell3.HorizontalAlignment = Element.ALIGN_CENTER
sndPg_cell3.BorderColor = Color.WHITE
sndPg_cell3.Colspan = 2
sndPageTable2.AddCell(sndPg_cell3)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Classifications", fntValue))
sndPageTable2.AddCell(New Phrase("Details of objection", fntValu
e))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Debit", fntValue))
sndPageTable2.AddCell(New Phrase("Chargeable:", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Credit", fntValue))
sndPageTable2.AddCell(New Phrase("Head of Account", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Total amount of Bill", fntValu
e))
sndPageTable2.AddCell(New Phrase("Payable.......................
.................................. Treasury", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Admitted", fntValue))
sndPageTable2.AddCell(New Phrase("Passed for Rs ................
..................", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Disallowed", fntValue))
sndPageTable2.AddCell(New Phrase("(Rupees.......................
................................................)", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("Objected, See details of objec
tion", fntValue))
sndPageTable2.AddCell(New Phrase("", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell4 As PdfPCell = New PdfPCell(New Phrase("Retrechme
nts slip No. GA ............................................... dated ..........
.............", fntValue))
sndPg_cell4.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell4.BorderColor = Color.WHITE
sndPg_cell4.Colspan = 2
sndPageTable2.AddCell(sndPg_cell4)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell5 As PdfPCell = New PdfPCell(New Phrase("Or object
ion slip No. ........................................................ dated ....
...................", fntValue))
sndPg_cell5.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell5.BorderColor = Color.WHITE
sndPg_cell5.Colspan = 2
sndPageTable2.AddCell(sndPg_cell5)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell6 As PdfPCell = New PdfPCell(New Phrase("Accountan
t/CT", fntValue))
sndPg_cell6.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell6.BorderColor = Color.WHITE
sndPg_cell6.Colspan = 2
sndPageTable2.AddCell(sndPg_cell6)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell7 As PdfPCell = New PdfPCell(New Phrase("AAG", fnt
Value))
sndPg_cell7.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell7.BorderColor = Color.WHITE
sndPg_cell7.Colspan = 2
sndPageTable2.AddCell(sndPg_cell7)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell8 As PdfPCell = New PdfPCell(New Phrase("Sr.AO/AO"
, fntValue))
sndPg_cell8.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell8.BorderColor = Color.WHITE
sndPg_cell8.Colspan = 2
sndPageTable2.AddCell(sndPg_cell8)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell9 As PdfPCell = New PdfPCell(New Phrase("AAO/SO",
fntValue))
sndPg_cell9.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell9.BorderColor = Color.WHITE
sndPg_cell8.Colspan = 2
sndPageTable2.AddCell(sndPg_cell9)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell10 As PdfPCell = New PdfPCell(New Phrase("AA", fnt
Value))
sndPg_cell10.HorizontalAlignment = Element.ALIGN_LEFT
sndPg_cell10.BorderColor = Color.WHITE
sndPg_cell10.Colspan = 2
sndPageTable2.AddCell(sndPg_cell10)
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
sndPageTable2.AddCell(New Phrase("", fntValue))
sndPageTable2.DefaultCell.HorizontalAlignment = Element.ALIGN_CE
NTER
sndPageTable2.AddCell(New Phrase("Dated:", fntValue))
'---------
sndPageTable2.AddCell(sndPgSpace_cell)
'---------
Dim sndPg_cell11 As PdfPCell = New PdfPCell(New Phrase("AAG", fn
tValue))
sndPg_cell11.HorizontalAlignment = Element.ALIGN_CENTER
sndPg_cell11.BorderColor = Color.WHITE
sndPg_cell11.Colspan = 2
sndPageTable2.AddCell(sndPg_cell11)
'---------
'---------------------------------------------------------------
-------
'***************************************************************
******
'-------------------------- second page -- end -----------------
------
'***************************************************************
******

document.Add(sndPageTable)
document.Add(sndPageTable1)
document.Add(directionsTable)
document.Add(sndPageTable2)
document.Close()
Response.Clear()
'Response.AddHeader("content-disposition", "attachment;filename=
Export.pdf")
Dim fileName As String = "SDOPayBillOuter"
Response.AddHeader("content-disposition", "attachment;filename="
+ fileName + ".pdf")
Response.ContentType = "application/pdf"
Response.BinaryWrite(msReport.ToArray())
Response.End()
Catch ex As Exception
Dim ermsg As String = ex.Message
Message_box(Me, "Error !! Report Generation Failed")
Exit Sub
End Try
End Sub

Vous aimerez peut-être aussi