1

Hi,

need to generate a report like Table Format(Excel Sheet)

 this is an example view of the report which I need of 

   it is for maintaining branch wise details

   In that product name contin in one table 

   and stock of each branch will contain in another table 


   --------------------------------------------------------------------
   |        |    Moniter    |    mouse    |    keyboard    |    CPU   |
   --------------------------------------------------------------------
   |Branch1 |        3      |      2      |      2         |     1    |
   --------------------------------------------------------------------
   |Branch2 |        2      |      3      |      1         |     3    |
   --------------------------------------------------------------------
   |  ...   |               |             |                |          |
   --------------------------------------------------------------------
   |Branchn |        2      |      3      |      1         |     3    |
   --------------------------------------------------------------------

   I want to generate report like this 

   In the  above report it deals with 3 tables in mysql 
   1. Product Table  (to maintain product details)
   2. Branch Table   (to maintain branch details)
   3. stock qunatity table (to  stock details with branch Id as well as product Id details)

Edited by thilipdilip: spelling mistake

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by diafol
0

There are a few approaches to this you could take, but I'd try to keep it as simple as possible by getting all my data into one array with a multiple join statement and then mess about with php. Trying to create this type of crosstab in MySQL can be tricky.

I'm busy at the mo, but if nobody comes back to you by tonight, I'll have a go at giving an example. BTW - I recently did something similar - if you search 'diafol crosstab' you may find it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.