Friday, March 9, 2012

Please, please help

CategoryA
Description Value Type
nbbnbnb jjhdjh hde
hjhjjhwjh jdjj j j jjnjnj
Description Value Amount
hbsjbj bj hbhjb $23.45
hsdhsbdh bnnbnb $57.89
CategoryB
Description Value Type
vvvvbvbvb mmkmhh gfjh
hhjjkjkjkh uiuiuyjh ytyuy
Description Value Amount
hbhghgbj huyuyjb $40.89
hsdrerrtdh bmnbnb $234.90

Hi All,
I have to create a report in the above fashion. For this I have created a stored procedure like this
Create proc proc1
declared the temporary table and varibles
insert into @.tempTable(category,Description,Value,Type)
select categoryA,Description,Value,Type from Table A
insert into @.tempTable(category,Description,Value,Amount)
select categoryA,Description,Value,Amount from Table A
--
select * from @.tempTable
end of procedure.
When Iam doing inserts in this way the report i get is like this
In the report I placed two tables from the toolbox onto the report . TableA has {Category,Description Value Type}
columns but Table B has {Category,Description Value Amount}columns

CategoryA
Description Value Type
nbbnbnb jjhdjh hde
hjhjjhwjh jdjj j j jjnjnj
Description Value
hbsjbj bj hbhjb
hsdhsbdh bnnbnb
CategoryB
Description Value Type
vvvvbvbvb mmkmhh gfjh
hhjjkjkjkh uiuiuyjh ytyuy
Description Value
hbhghgbj huyuyjb
hsdrerrtdh bmnbnb
CategoryA
Description Value
nbbnbnb jjhdjh
hjhjjhwjh jdjj j j
Description Value Amount
hbsjbj bj hbhjb $23.45
hsdhsbdh bnnbnb $57.89
CategoryB
Description Value
vvvvbvbvb mmkmhh
hhjjkjkjkh uiuiuyjh
Description Value Amount
hbhghgbj huyuyjb $40.89
hsdrerrtdh bmnbnb $234.90

I hope u guys could see my problem. Please help me to correct this.
Thank u so much
Hi,
you can try using 2 store procedures : 1 for Type and 1 for Amount.
Then, you can bind first store procedure for Table A and second store procedure for Table B.
|||

u can build your query in the following way

select Category, 1 as grouptyp, Description , Value , Type, 0 as amount from Table A
union
select Category, , 2 as grouptyp , Description , Value , '' as Type, amount from Table A
then u can group your reporty by Category and grouptyp
them show or hide the amount or value based on the grouptype
hope it works
Bolos

|||

Hi,

how can i use two stored procedures. Because, while i'm building the report there is space for only one stored procedure right in the data section. Could explain me in more detail.
Thank u so much.

|||

bwageh wrote:

u can build your query in the following way

select Category, 1 as grouptyp, Description , Value , Type, 0 as amount from Table A
union
select Category, , 2 as grouptyp , Description , Value , '' as Type, amount from Table A
then u can group your reporty by Category and grouptyp
them show or hide the amount or value based on the grouptype
hope it works
Bolos


Hi,
i will try it out as u said. Could u tell me if i could use two stored procedures as scu said. Would be able to answer my question. Because, while i'm building the report there is space for only one stored procedure in the data section. Thank u so much.|||Hi nissan,
you can add a new DataSet (another store proc) in Data Tab selecting dropdown DataSet -> New DataSet.
So, you can refer to 2 DataSet in Layout Tab.
|||

bwageh wrote:

u can build your query in the following way

select Category, 1 as grouptyp, Description , Value , Type, 0 as amount from Table A
union
select Category, , 2 as grouptyp , Description , Value , '' as Type, amount from Table A
then u can group your reporty by Category and grouptyp
them show or hide the amount or value based on the grouptype
hope it works
Bolos



Hi bwageh,
I have the same question again after a long time, How can I show or hide the amount or value based on the grouptype. Could you please please explain me in more detail.

|||Hi bwageh,
I have the same question again after a long time, How can I show or hide the amount or value based on the grouptype. Could you please please explain me in more detail.

No comments:

Post a Comment