Results 1 to 6 of 6

Thread: [RESOLVED] [SQL Server 05] - Cascading Style

  1. #1

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Resolved [RESOLVED] [SQL Server 05] - Cascading Style

    Hello everyone

    I need some help/advice with a query to generate a report.

    I'm creating an application to control, in my company, the expeditions of items/material. In the end of the process of registrying i have to print a document with all the info. My problem it's the way i get the data from the database....

    My DB structure it's something like this:
    [Company_destination] can make several [Requests] and the request have [Items]

    THen i have tables for [packs] some items of an request inside, and then i have [boxs] where the packs of the request are. In this point the items and packs belong all to the same request.

    In the end, the boxes are put in a truck [truck], but the boxes can be from diferent requests...

    To print the document i have another table that associate the truck, with a driver and a id.

    The structure of the database i think it's ok.

    I can make a query, but i need to present data like a casacading style, for example:
    In the truck i have boxs to 2 companies, the boxs have 4 packs inside each one and every pack have 10 items.

    My query return 10*4*2=80 rows (Inner Joins and Distinct), it's possible to make this query and separate all the things?

    Or the only way it's making several querys?

    Thanks

    Sorry for my english...

  2. #2
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961

    Re: [SQL Server 05] - Cascading Style

    If this report is for viewing purpose, then Drill Down report is the answer to this. If it's for printing, then you decide what all you want to print and to how many pages.
    Microsoft Techie

  3. #3

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: [SQL Server 05] - Cascading Style

    the report it's for printing..

    i need to get the data separated in the doc, something like this:
    Company 1
    -----------------
    request 1 - Box1 -
    -----------------
    pack 1 - item1
    - item 2
    - item 3
    pack 2 - item 1
    - item 2
    --------------------
    - request 2 - Box2 -
    --------------------
    ...

  4. #4
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961

    Re: [SQL Server 05] - Cascading Style

    so, where have you stuck? can u provide the query that u r using?
    Microsoft Techie

  5. #5

    Thread Starter
    Frenzied Member mickey_pt's Avatar
    Join Date
    Sep 2006
    Location
    Corner of the Europe :)
    Posts
    1,959

    Re: [SQL Server 05] - Cascading Style

    I'm not really stuck, i was trying to do this with one query, but the way i want this i don't think it's possible...

    So i'll use multiple querys, first select the diferents companys, then for each one select the diferents requests, for each request i select what i want and so on...

    If someone know another way, write please

    I leave this thread open till the end of the day

    thanks pvbangera

  6. #6
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961

    Re: [SQL Server 05] - Cascading Style

    why cant u use a single query? have inner joins between Company, Requests, Packs, Items, etc. Order them accordingly and then iterate it through a loop and then gen ur report
    Microsoft Techie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width