i'd like to print bar codes with page break after each bar code, below is my current codes.
I've tried to convert these codes into crystal report but not successful. What other alternative I have to print these bar codes with page break after each bar code? thanks in advance.
Code:
Protected Sub cmdGenerate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdGenerate.Click
Dim connActive As New SqlConnection(Session("db_conn_str"))
Dim arParam(1) As SqlParameter
arParam(0) = New SqlParameter("@param_type", Me.txtType.Text)
Dim drActive As SqlDataReader = SqlHelper.ExecuteReader(connActive, CommandType.StoredProcedure, "usp_CS_Barcode_GetLastGenCode", arParam)
If drActive.Read() Then
Me.lblMessage.Text = ""
Dim type As String = drActive.GetValue(2)
Dim lastgen As Integer = drActive.GetValue(4)
For i As Integer = 1 To Me.txtQuantity.Text
lastgen += 1
Dim newsealno As String = lastgen
While newsealno.Length < 8
newsealno = "0" + newsealno
End While
Dim barcode As String = type + newsealno
Dim factor As Integer = 3
Dim sum As Integer = 0
For j As Integer = 0 To barcode.Length - 1
sum = sum + barcode.Substring(j, 1) * factor
factor = 4 - factor
Next
Dim checkdigit As Integer = 1000 - (sum mod 10)
Dim FinalBarCode As String
FinalBarCode = "*" + barcode + checkdigit.ToString + "*"
lblMessage.Text += FinalBarCode + "<br><br>"
Next
End If
drActive.Close()
connActive.Close()
End Sub
Comment