Skip to Content
0
Former Member
Jun 10, 2011 at 10:04 AM

summing totals dynamically in colums and rows..

43 Views

hi all,

I have a Orocle Database table with the following struture.

ShopNumber ShopName ShopItem NumberSold Expired Total initial stock

00609001....' K1................ Fanta........ 176............... 4................... 500

00609001....' K1................ Coke........ 156............... 2...................500

00609001....' K1................ Sprite........ 134............... 1................... 500

00609004....' K2................ Fanta........ 45............... 4................... 500

00609004....' K2................ Coke........ 56............... 5................... 500

00609004....' K2................ Sprite........ 78............... 5................... 500

I would like to present the data in Crystal reports in the following format..

ShopNumber initial stock Fanta(F) Coke (C) Sprite (S) expired(e) Total(Fcs+e)

00609001..... 1500............. 176..........156..........134............7................473

00609004..... 1500............. 45............56...........78............14................193

inital stock is a total of all the drinks in a particular shop.the expired amount is a total of all the expired drinks in a particular shop.

The types of drinks can increase or reduce, its dynamic. the same applies to the shops.. we can have more shops. i have tried to use a cross tab, but the cross tab is rigid as one can not add a field which is not directly related to a drink type(eg expired amounts which are totals)..

I would appreciate if i could be helped. thanks in advance..