Hi Everyone,
I am at the final stage of my practice windows program and I ran into issues with the report. I created a report and I entered a text, a field and a graphics on the header. I used this code to print and also to view the results on a listbox to make sure my Query is correct. When I run it, I only get one page with the “text” printed and “0” as the field and nothing for the graphics. How do I tell the report to get all the data from the Query I created? I am missing something and I tried to read all the posts and documents before posting this.
[CODE
If orders <> Nil Then
For Each row As DatabaseRow In orders
ProdListBox.AddRow(row.ColumnAt(0).StringValue, row.ColumnAt(1).StringValue, _
row.ColumnAt(2).StringValue, row.ColumnAt(3).StringValue)
Next
End If
report1.Picture1.DataField = “logo.jpg”
report1.Field2.DataField = orders.Column(“FacturaID”).stringvalue
If orders = Nil Then
MessageBox(“No records found to print.”)
Else
Var ps As New PrinterSetup
// set the resolution to 300 DPI for printing
ps.MaximumHorizontalResolution = 300
ps.MaximumVerticalResolution = 300
If ps.ShowPageSetupDialog Then
Var g As Graphics
g = OpenPrinterDialog(ps, Nil)
If g <> Nil Then
// if the report runs successfully
If rpt.Run(orders, ps) Then
rpt.Document.Print(g)
End If
End If
End If
End If
/CODE]
In the listbox, I can see the records:
My final target is print an invoice for a particular ID (FacturaID). I will be adding more tables on the final query but I wanted to start with two first just to see how it all works.
Also, the logo I specified on the “image” part of the designer didnt print either.
Thank You