Custom Paper Size Printing in vb.net

Custom Paper Size Printing in VB.NET 

Advance Printing using Ms-Access Database Setting with Schemes






Here is the source code in vb.net

For Custom Paper Size

Vb.net Source Code Part One

 Dim PrtDbf As New ADODB.Recordset
    Public TotalPagesPrint As Long
    Sub Printingset(ByRef sender As System.Object, ByRef e As System.Drawing.Printing.PrintPageEventArgs, ByVal Transcode As Single, ByVal Vhtype As Byte, ByVal PrintingScheme As String, ByVal Dbitemsname As String, ByVal dbname As String)

        Static IsFirstOpen As Boolean = True
        Static pagerecords As Integer = 0
        Static PresentRecords As Integer = 0
        Static PageTop As Double = 0
        Static PageSpace As Double = 0
        Static RowHeight As Double = 0
        Static PageNos As Integer = 1
        Static PageNo As Integer = 1
        Static Pagenoformat As Byte = 0
        Static isPageNoyesno As Boolean = True
        Static PageTopConst As Double = 0
        Static FooterTop As Integer = 0
        Dim PageTotal As Double = 0
        Dim Dbf As New ADODB.Recordset
        If IsFirstOpen = True Then
            IsFirstOpen = False
            Dbf.Open("select * from PrintingSettings where schemename='" & PrintingScheme & "'", Conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
            If Dbf.RecordCount > 0 Then
                pagerecords = Dbf.Fields("maxrowsperpage").Value
                RowHeight = Dbf.Fields("rowheight").Value
            End If
            PresentRecords = 1
            Dbf.Close()

            Dbf.Open("select * from printrecords where schemename='" & PrintingScheme & "'", Conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
            If Dbf.RecordCount > 0 Then
                PageTop = Dbf.Fields("top").Value
                PageSpace = Dbf.Fields("space").Value
                FooterTop = Dbf.Fields("top").Value + Dbf.Fields("height").Value
            End If
            Dbf.Close()
            PageTopConst = PageTop
            PrtDbf.Open("select * from  " & Dbitemsname & " where transcode=" & Transcode, Conn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)
            PrtDbf.MoveFirst()
            If PrtDbf.RecordCount < pagerecords Then
                pagerecords = PrtDbf.RecordCount
            End If
            PageNos = Math.Ceiling(PrtDbf.RecordCount / pagerecords)
            PageNo = 1
        End If


For POS System in VB.NET Source Code

: Please Contact : 
Sureshjyothijv@gmail.com