我想创建具有多个表的分组功能的水晶报表。 [英] I want to create crystal report with group by feature with multiple tables.

查看:103
本文介绍了我想创建具有多个表的分组功能的水晶报表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有3张桌子



1)TM_Company(compID,CompName)

2)tm_Customer(custId,CName,CompID)

3)tm_booking(bID,Amount,CustID,CompID)


$ b表格中的$ b数据




I have 3 tables

1) TM_Company (compID,CompName)
2) tm_Customer(custId,CName,CompID)
3) tm_booking(bID,Amount,CustID,CompID)

data in table


1) tm_Company

1, abc
2, def
3, xyz


2) tm_customer

1, jagdish,1
2, ghi,    1
3, jkl,    1
4, iuy,    2
5, lkj,    2
6, lskdfj, 2

3) tm_booking

1, 12000,  1, 1
2, 123000, 2, 1
3, 2345,   3, 1
4, 1234,   1, 1
5, 123,    1, 1
6, 456,    6, 2
7, 2334,   4, 2
8, 123000, 2, 1


now I want to show data customer wise bt from selected company means if i had logged in company 1 then only customers of company 1 should be display


Company Name : CompName

CustName
         Bid   amount   

result should be


Company Name : ABC

CustName 
         Bid Amount

Jagdish
        1 12000
        4 1234
        5 123
ghi     
        2 123000
        8 45600
jkl
        3 2345

Here CompID should be taken dynamically if user is logged in in compID 1 then all data will be display of compID 1 

推荐答案

你写了一个为你重新搜索数据的查询



You write one query which is retriving data for you like

select Co.CompanyID,Co.CompanyName,Cu.CustId,Cu.CName,B.bID,B.Amount from
TM_Company Co inner join TM_Customer Cu on Co.CompID=Cu.CompID inner join Tm_Booking on  cu.Custid=B.CustId and Co.CompID = b.CompID
where co.CompID='Selected Company'





您必须在登录时传递选择的公司代码。



然后将查询传递给您的报告,在报告中添加3组

CompID,CustID,bID respectivaly。



然后根据您的要求设计报告。



You must need to pass the company code wich is selected at the time of login.

Then after that pass the Query to your report and add 3 group in report
CompID ,CustID ,bID respectivaly.

And then design the report as per your requirement.


这篇关于我想创建具有多个表的分组功能的水晶报表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆