• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 532
  • Last Modified:

printing invoice in Quick Report

I'm new in delphi4. I made an invoice module and I would like to print it.
The invoice consiste of two tables. MasterXYTable and DetailsXYTable. I'm trying to print it in quick report but with no succeed.
In the quick report I have defined again the Two tables giving them the same name MasterXYTable and DetailsXYTable. I put the Master table in Title Band and the detailsTable in the details Band and I made a Summary Band. In the summary band I put expressions to sum From MasterTable and from DetailsTable. In quick report main form I defined  the DataSet to MasterXYTable.
My Problems as follows:
- In the quickreport when I'm previewing the Invoice in the masterTable always shows the first record and in detailsTable if in one invoice there are more than one record, it shows only the first record and it shows also the first record from diffrent invoice numbers.
In the Summary band I'm getting resulsts only from MasterTable and nothing from detailsTable. In the exression wizard in the database field I cant insert database in expression I'm getting error message List Index out of bouds(0).
Thank you in advance for your help.
0
sivatagiherceg
Asked:
sivatagiherceg
1 Solution
 
Phoenix_sCommented:
10 points??

when you print a quick report, use whatever tactics you want... but in my experience with D4 and quickreports... use queries, not ttables

so you'd have query-master, and query-detail

then in quickrep, have a title, column header, detail, and even a summary

stick a public variable in the form declaration to hold the invoicenumber of the invoice you want to print out

the quickrep component should have it's dataset property set to the query-detail

then in the title or even the column header, you stick all the relevant header info as dbtext components... then the dbtext compionents in the header should have their dataset property set to the query-master, and the datafield properties set to the appropriate fields.

in the detail band... include only the query-detail fields you want to see

BEFORE printing this thing out..

open the report dynamically, place the invoicenumber in its placeholder, then call a loadquery procedure on the form before preview/printing it

if you want to send the report unit you have made I can perhaps send you a much better dissertation on how to get it to behave properly


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now