views:

362

answers:

4

i have 2 tables 1.product fields are prod_no(primary key),prod_name 2.sales fields are sal_no,sal_date,cust,prod1(foreign key ie prod_no),prod2(foreign key ie prod_no),fst_qty,snd_qty

i want to sort my report based on prod_no

ex: product

prod_no prod_name

1 printer

2 paper

3 catridge

sales

sal_no sal_date customer prod1 prod2 fst_qty snd_qty

1 5-sep-09 aaa 1 3 2 3

2 5-sep-09 bbb 2 3 1 1

3 5-sep-09 ccc 1 2 3 4

i want report like this

prod_no

1 sal_no sal_date customer qty

        1     5-sep-09    aaa        2
        3     5-sep-09    ccc        3

2

        2     5-sep-09    bbb        1
        3     5-sep-09    ccc        4

3

        1     5-sep-09    aaa        3
        2     5-sep-09    bbb        1
A: 

Looks like a job for subreports to me, with Prod_No passed as a parameter.

CodeByMoonlight
A: 

You need to work on your grouping skills for this. I believe that if you simply create groupings for prod_no and then sal_no, and after placing the necessary fields in the proper group headers and details sections you should be able to display this info in the way that you want it.

Please see my answer on the below question for an example of a grouping similar to what you are looking for.

http://stackoverflow.com/questions/1264213/how-to-avoid-the-duplicate-values

Hope this helps and don't forget to mark an answer as the accepted answer and vote for answers that have helped. Thanks

Dusty
A: 

I'm using free RAQ Report. RAQ Report can slove your problem easily. Maybe you can hava a try. Free RAQ Report can be download at http://www.raqsoft.com/.