how to rename file after export from filename sequential based on expression datatable in VB.NET

I’m Trying to to rename file image after export with datatable in VB.NET

I use library control LabelControl for .NET from BaiqiSoft

I have also asked Baiqisoft support and then he replied “this is the design behavior of our product.” so the results of the export filename from the library are sequential .is there a solution I can rename after export image and also without mistakes I rename the filename based on expression datatable ?

Please Guide me

for more detailed documentation refer below link.

https://www.mysofttool.com/help/labeldesign/

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Imports System.IO
Imports BaiqiSoft.LabelControl
Public Class Form1
Private m_DataTable As DataTable
Private Sub CreateDataTable()
If m_DataTable IsNot Nothing Then Return
m_DataTable = New DataTable
'Columns
m_DataTable.Columns.Add("ProductName", GetType(String))
m_DataTable.Columns.Add("Barcode", GetType(String))
m_DataTable.Columns.Add("Price", GetType(Single))
m_DataTable.Columns.Add("LabelNumber", GetType(Integer))
m_DataTable.Columns.Add("QTY", GetType(Integer))
m_DataTable.Columns.Add("Filename", GetType(String), "ProductName +','+ Barcode")
'Rows
m_DataTable.Rows.Add("Mishi Kobe Niku", "845723054943", 96.0, 2, 1)
m_DataTable.Rows.Add("Carnarvon Tigers", "246321456231", 61.5, 1, 1)
m_DataTable.Rows.Add("Ipoh Coffee", "589412354786", 46.0, 3, 1)
m_DataTable.Rows.Add("Aniseed Syrup", "457125463254", 10.0, 1, 1)
m_DataTable.Rows.Add("Teatime Chocolate Biscuits", "232145674321", 9.2, 5, 1)
End Sub
Private Sub Btnexport_Click(sender As Object, e As EventArgs) Handles Btnexport.Click
Dim theLabel As New LabelPrinting()
theLabel.LicenseKey = ""
theLabel.OpenLabel(Application.StartupPath & "test.blf")
Dim selectedRows As DataTable = m_DataTable.Clone
selectedRows.Columns("Filename").Expression = Nothing : selectedRows.Columns("Filename").ReadOnly = False
For Each row2 As DataGridViewRow In DataGridView1.Rows
Dim isselect As Boolean = Convert.ToBoolean(row2.Cells("checkboxcolumn").Value)
If isselect Then
Dim newRow As DataRow = selectedRows.NewRow()
newRow("ProductName") = m_DataTable.Rows(row2.Index)("ProductName")
newRow("Barcode") = m_DataTable.Rows(row2.Index)("Barcode")
newRow("Price") = m_DataTable.Rows(row2.Index)("Price")
newRow("LabelNumber") = m_DataTable.Rows(row2.Index)("LabelNumber")
newRow("QTY") = m_DataTable.Rows(row2.Index)("QTY")
newRow("Filename") = m_DataTable.Rows(row2.Index)("ProductName") + "," + m_DataTable.Rows(row2.Index)("Barcode") + ".png"
selectedRows.Rows.Add(newRow)
theLabel.Label.QuantityColumn = "QTY"
End If
Next row2
theLabel.DataSource = selectedRows
theLabel.ExportOptions.FileName = "test"
theLabel.ExportOptions.Path = Application.StartupPath
theLabel.ExportOptions.Quantity = QuantityOptions.AllRecords
theLabel.ExportOptions.Format = ImageFormats.Png
theLabel.ExportOptions.Resolution = 300
theLabel.ExportImage()
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
CreateDataTable()
DataGridView1.DataSource = m_DataTable
Dim CheckedBoxColumn As New DataGridViewCheckBoxColumn
CheckedBoxColumn.Width = 40
CheckedBoxColumn.Name = "checkboxcolumn"
CheckedBoxColumn.HeaderText = "Check"
DataGridView1.Columns.Insert(0, CheckedBoxColumn)
End Sub
End Class
</code>
<code>Imports System.IO Imports BaiqiSoft.LabelControl Public Class Form1 Private m_DataTable As DataTable Private Sub CreateDataTable() If m_DataTable IsNot Nothing Then Return m_DataTable = New DataTable 'Columns m_DataTable.Columns.Add("ProductName", GetType(String)) m_DataTable.Columns.Add("Barcode", GetType(String)) m_DataTable.Columns.Add("Price", GetType(Single)) m_DataTable.Columns.Add("LabelNumber", GetType(Integer)) m_DataTable.Columns.Add("QTY", GetType(Integer)) m_DataTable.Columns.Add("Filename", GetType(String), "ProductName +','+ Barcode") 'Rows m_DataTable.Rows.Add("Mishi Kobe Niku", "845723054943", 96.0, 2, 1) m_DataTable.Rows.Add("Carnarvon Tigers", "246321456231", 61.5, 1, 1) m_DataTable.Rows.Add("Ipoh Coffee", "589412354786", 46.0, 3, 1) m_DataTable.Rows.Add("Aniseed Syrup", "457125463254", 10.0, 1, 1) m_DataTable.Rows.Add("Teatime Chocolate Biscuits", "232145674321", 9.2, 5, 1) End Sub Private Sub Btnexport_Click(sender As Object, e As EventArgs) Handles Btnexport.Click Dim theLabel As New LabelPrinting() theLabel.LicenseKey = "" theLabel.OpenLabel(Application.StartupPath & "test.blf") Dim selectedRows As DataTable = m_DataTable.Clone selectedRows.Columns("Filename").Expression = Nothing : selectedRows.Columns("Filename").ReadOnly = False For Each row2 As DataGridViewRow In DataGridView1.Rows Dim isselect As Boolean = Convert.ToBoolean(row2.Cells("checkboxcolumn").Value) If isselect Then Dim newRow As DataRow = selectedRows.NewRow() newRow("ProductName") = m_DataTable.Rows(row2.Index)("ProductName") newRow("Barcode") = m_DataTable.Rows(row2.Index)("Barcode") newRow("Price") = m_DataTable.Rows(row2.Index)("Price") newRow("LabelNumber") = m_DataTable.Rows(row2.Index)("LabelNumber") newRow("QTY") = m_DataTable.Rows(row2.Index)("QTY") newRow("Filename") = m_DataTable.Rows(row2.Index)("ProductName") + "," + m_DataTable.Rows(row2.Index)("Barcode") + ".png" selectedRows.Rows.Add(newRow) theLabel.Label.QuantityColumn = "QTY" End If Next row2 theLabel.DataSource = selectedRows theLabel.ExportOptions.FileName = "test" theLabel.ExportOptions.Path = Application.StartupPath theLabel.ExportOptions.Quantity = QuantityOptions.AllRecords theLabel.ExportOptions.Format = ImageFormats.Png theLabel.ExportOptions.Resolution = 300 theLabel.ExportImage() End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load CreateDataTable() DataGridView1.DataSource = m_DataTable Dim CheckedBoxColumn As New DataGridViewCheckBoxColumn CheckedBoxColumn.Width = 40 CheckedBoxColumn.Name = "checkboxcolumn" CheckedBoxColumn.HeaderText = "Check" DataGridView1.Columns.Insert(0, CheckedBoxColumn) End Sub End Class </code>
Imports System.IO
Imports BaiqiSoft.LabelControl
Public Class Form1
    Private m_DataTable As DataTable
    Private Sub CreateDataTable()
        If m_DataTable IsNot Nothing Then Return
        m_DataTable = New DataTable
        'Columns
        m_DataTable.Columns.Add("ProductName", GetType(String))
        m_DataTable.Columns.Add("Barcode", GetType(String))
        m_DataTable.Columns.Add("Price", GetType(Single))
        m_DataTable.Columns.Add("LabelNumber", GetType(Integer))
        m_DataTable.Columns.Add("QTY", GetType(Integer))
        m_DataTable.Columns.Add("Filename", GetType(String), "ProductName +','+ Barcode")
        'Rows
        m_DataTable.Rows.Add("Mishi Kobe Niku", "845723054943", 96.0, 2, 1)
        m_DataTable.Rows.Add("Carnarvon Tigers", "246321456231", 61.5, 1, 1)
        m_DataTable.Rows.Add("Ipoh Coffee", "589412354786", 46.0, 3, 1)
        m_DataTable.Rows.Add("Aniseed Syrup", "457125463254", 10.0, 1, 1)
        m_DataTable.Rows.Add("Teatime Chocolate Biscuits", "232145674321", 9.2, 5, 1)
    End Sub
Private Sub Btnexport_Click(sender As Object, e As EventArgs) Handles Btnexport.Click
        Dim theLabel As New LabelPrinting()
        theLabel.LicenseKey = ""
        theLabel.OpenLabel(Application.StartupPath & "test.blf")
        Dim selectedRows As DataTable = m_DataTable.Clone
        selectedRows.Columns("Filename").Expression = Nothing : selectedRows.Columns("Filename").ReadOnly = False
        For Each row2 As DataGridViewRow In DataGridView1.Rows
            Dim isselect As Boolean = Convert.ToBoolean(row2.Cells("checkboxcolumn").Value)
            If isselect Then
                Dim newRow As DataRow = selectedRows.NewRow()
                newRow("ProductName") = m_DataTable.Rows(row2.Index)("ProductName")
                newRow("Barcode") = m_DataTable.Rows(row2.Index)("Barcode")
                newRow("Price") = m_DataTable.Rows(row2.Index)("Price")
                newRow("LabelNumber") = m_DataTable.Rows(row2.Index)("LabelNumber")
                newRow("QTY") = m_DataTable.Rows(row2.Index)("QTY")
                newRow("Filename") = m_DataTable.Rows(row2.Index)("ProductName") + "," + m_DataTable.Rows(row2.Index)("Barcode") + ".png"
                selectedRows.Rows.Add(newRow)
                theLabel.Label.QuantityColumn = "QTY"
            End If
        Next row2
        theLabel.DataSource = selectedRows
        theLabel.ExportOptions.FileName = "test"
        theLabel.ExportOptions.Path = Application.StartupPath
        theLabel.ExportOptions.Quantity = QuantityOptions.AllRecords
        theLabel.ExportOptions.Format = ImageFormats.Png
        theLabel.ExportOptions.Resolution = 300
        theLabel.ExportImage()
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        CreateDataTable()
        DataGridView1.DataSource = m_DataTable
        Dim CheckedBoxColumn As New DataGridViewCheckBoxColumn
        CheckedBoxColumn.Width = 40
        CheckedBoxColumn.Name = "checkboxcolumn"
        CheckedBoxColumn.HeaderText = "Check"
        DataGridView1.Columns.Insert(0, CheckedBoxColumn)
    End Sub
End Class

Result from Code :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>test1.png
test2.png
test3.png
test4.png
test5.png
</code>
<code>test1.png test2.png test3.png test4.png test5.png </code>
test1.png

test2.png

test3.png

test4.png

test5.png

It should be like this (Desired result):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Mishi Kobe Niku,845723054943.png
Carnarvon Tigers,246321456231.png
Ipoh Coffee,589412354786.png
Aniseed Syrup,457125463254.png
Teatime Chocolate Biscuits,232145674321.png
</code>
<code>Mishi Kobe Niku,845723054943.png Carnarvon Tigers,246321456231.png Ipoh Coffee,589412354786.png Aniseed Syrup,457125463254.png Teatime Chocolate Biscuits,232145674321.png </code>
Mishi Kobe Niku,845723054943.png
 
Carnarvon Tigers,246321456231.png
 
Ipoh Coffee,589412354786.png
 
Aniseed Syrup,457125463254.png
 
Teatime Chocolate Biscuits,232145674321.png

Is it possible that I can rename like this

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>test1.png >>>> Mishi Kobe Niku,845723054943.png
test2.png >>>> Carnarvon Tigers,246321456231.png
test3.png >>>> Ipoh Coffee,589412354786.png
test4.png >>>> Aniseed Syrup,457125463254.png
test5.png >>>> Teatime Chocolate Biscuits,232145674321.png
</code>
<code>test1.png >>>> Mishi Kobe Niku,845723054943.png test2.png >>>> Carnarvon Tigers,246321456231.png test3.png >>>> Ipoh Coffee,589412354786.png test4.png >>>> Aniseed Syrup,457125463254.png test5.png >>>> Teatime Chocolate Biscuits,232145674321.png </code>
test1.png >>>> Mishi Kobe Niku,845723054943.png

test2.png >>>> Carnarvon Tigers,246321456231.png

test3.png >>>> Ipoh Coffee,589412354786.png

test4.png >>>> Aniseed Syrup,457125463254.png

test5.png >>>> Teatime Chocolate Biscuits,232145674321.png

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật