如何使用存储过程在水晶报表中进行 [英] how to do in crystal report using store procedure

查看:77
本文介绍了如何使用存储过程在水晶报表中进行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个表名城市和州:

城市表字段:

city_id,city_name,state_id



状态表字段:

state_id,state_name,country_id



i创建商店程序:

  ALTER   PROCEDURE  [dbo]。[testreport] 
AS
BEGIN
选择 * 来自 City_master
union
选择 * 来自 State_master
END







当我将其添加到水晶报表时

只有city_master列显示在数据库字段中



如何才能看到数据库领域的所有6列?





i不太了解水晶报告



提前感谢.....

解决方案

联盟运营商不会解决您的问题。



您应该使用Join运算符


对于Crystal报表而不是使用存储过程,您可以使用查看还。

请尝试以下代码:

 创建  VIEW  [dbo]。[vw_testreport] 
AS
选择 c。*,s.state_name,s.country_id 来自 City_master c
inner join State_master s
on s.state_id = c.state_id


i have 2 table name city and state:
city table field:
city_id,city_name,state_id

state table field:
state_id,state_name,country_id

i create store procedure:

ALTER PROCEDURE [dbo].[testreport]
AS
BEGIN
    select * from City_master
    union
    select * from State_master
END




when i add this to crystal report
only city_master column are display in database field

how can i see all 6 of column in database field


i does not know more about crystal report

thanks in advance.....

解决方案

Union Operator wont solve your problem .

You should use Join operator


For Crystal report instead of using store procedure you can use View also.
Please try following code:

CREATE VIEW [dbo].[vw_testreport]
AS
select c.*,s.state_name,s.country_id from City_master c
inner join State_master s
on s.state_id=c.state_id


这篇关于如何使用存储过程在水晶报表中进行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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