After trying a lot i myself found a solution for this, making a crosstab crystalreport
seems not good to me
so i will explain what i have done is:
Installed the additional module tablefunc
which provides the function crosstab(). Since i am PostgreSQL 9.1 i can use CREATE EXTENSION
for that
CREATE EXTENSION tablefunc;
and
converted rows into columns using the following query
select * from crosstab(' select product,branch,orderqty from vConsolPrchOrd ORDER by product ',$$values(1::int),(3),(4),(5),(6)$$) as tbl("product" character varying,"1" numeric,"3" numeric,"4" numeric,"5" numeric,"6" numeric) order by product asc limit 5
BEFORE
AFTER using crosstab