Displaying Related Database Data on a Single Label in BarTender (Order's Products/ One to Many)
Hello BarTender Community,
I'm currently working on a project that requires me to design a label in BarTender that displays data from multiple related tables in a database. I hope some of you might have experience with a similar setup and can provide some guidance.
Objective:
My goal is to print a label for a specific Order. On this label, I want to display all of the OrderProducts associated with that Order.
Database Structure:
I have a database with three tables:
OrdersOrderProductsProducts
The Orders table is related to OrderProducts via an Order ID, and OrderProducts is related to Products using a Product ID.
Steps Taken & Challenges Faced:
- I successfully connected BarTender to my database and can drag and drop individual fields onto the label. For example, I can display the
Order IDfrom theOrderstable without any issue. I can then cycle through the records and see the OrderId value change on my label. - The challenge arises when I try to list out the associated products from the
OrderProductstable on the same label. I attempted to use a table object to display this list dynamically. - However, BarTender seems to require a new, separate database connection for the table object. This complicates things because the new connection does not recognize the specific
OrderI'm referencing from the initial connection. - When I right click on the table and go to Properties, I then go to the Table Data section. In this section I select Arranged in Rows. When I click the Source dropdown, I see the options: Database, File Names in Folder, Visual Basic Script, and Printers.
- I would expect to see my already connected database in the Sources dropdown. When I select Database, it wants me to re-setup the database connection, which then the table has no relation to the principle Order already on the label.
Questions:
- Is there a way to use a single database connection to display both individual fields and a dynamic list from related tables on one label?
- If the above isn't possible, is there a workaround or an alternative approach you would recommend to achieve the objective?
I've tried several methods and consulted the documentation, but I haven't been able to find a solution that meets my needs. Any guidance or suggestions would be greatly appreciated.
Thank you in advance for your help!
-
I could be wrong, but I am not sure you can achieve that via the use of a Table object.
You probably need to look at the Records per Item setting in the Database Connection Setup screens and use that to perhaps populate a grid object or table you have manually created.
0
Please sign in to leave a comment.
Comments
1 comment