Hello all,
I've created a restaurant POS and i'm having trouble with the listview printing
the target is to print in the receipt the following
Product Quantity Unit Price Total
I've managed through coding to print it, but I have another problem
using the following code
graphics.DrawString(" " + listView1.Items[0].SubItems[0].Text + " " + listView1.Items[0].SubItems[1].Text + " " + listView1.Items[2].SubItems[0].Text + " " + listView1.Items[0].SubItems[3].Text, new Font("Arial Bold", 11),
new SolidBrush(Color.Black), startX, startY + Offset);
the problem is, this only prints one row of the listview
I've tried add multiple lines of the previous code to be able to print 6 rows
but it give an error when any of the rows are empty
how to make it print all items and subitems in a listview dynamically depending on the number of rows add by the user?
What I have tried:
here is the full code of the printing
graphics.DrawString(" " + listView1.Items[0].SubItems[0].Text + " " + listView1.Items[0].SubItems[1].Text + " " + listView1.Items[2].SubItems[0].Text + " " + listView1.Items[0].SubItems[3].Text, new Font("Arial Bold", 11),
new SolidBrush(Color.Black), startX, startY + Offset);