Textfiledatabase Does Not Exist
Dear sir/madam,
I have searched the forums to achieve a working vb.net application that uses a .txt file as source, but I am not able to get it right.
This is how my code looks now:
Imports Seagull.BarTender.Print Imports Seagull.BarTender.Print.Database
Dim btEngine As New Engine
Dim btFormat As LabelFormatDocument
Dim txtFile = New TextFile("TextFileDatabase")
btEngine.Start()
txtFile.FileName = "P:\BarTender\Templates\Test.csv"
btFormat = btEngine.Documents.Open("P:\BarTender\Templates\PageTemplate.btw")
btFormat.DatabaseConnections.SetDatabaseConnection(txtFile)
btFormat.Print()
btFormat.Close(SaveOptions.DoNotSaveChanges)
btEngine.Stop()
I'm getting this error: TextFileDatabase does not exist at btFormat.DatabaseConnections.SetDatabaseConnection(txtFile).
Hope some of you could help me out?
Thanks in advance!
0
-
I managed to solve my own problem.
Maybe this example can act as a tutorial. The lines I needed were:
Dim txtFile = New TextFile(btFormat.DatabaseConnections(0).Name) txtFile.FileName = "P:\BarTender\Templates\Test2.csv" btFormat.DatabaseConnections.SetDatabaseConnection(txtFile)
Instead of:
txtFile.FileName = "P:\BarTender\Templates\Test.csv" btFormat.DatabaseConnections.SetDatabaseConnection(txtFile)
Thanks for the support anyways!
0
请先登录再写评论。
评论
1 条评论