如何为Crystal Reports动态指出servername,database,userid和password? [英] How to point out servername ,database ,userid and password dynamically for Crystal Reports ?

查看:77
本文介绍了如何为Crystal Reports动态指出servername,database,userid和password?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai

i我在我的网站上使用水晶报告,我通过在设计时选择Data Expert并创建新连接并设置我的本地服务器名称,数据库名称来添加水晶报告并将数据库添加到报告中,用户ID和密码。一旦创建连接,我可以添加表格,最后我可以将字段拖放到水晶报表字段。如果我在设计时看到主报表预览,我可以正确查看报表,也可以在运行时查看报表但是,如果我部署在服务器机器上,我需要更改数据源,数据库名称,用户ID和密码,bcz在服务器机器数据中不同于我的本地机器,如数据源,数据库名称,用户ID和密码。那么如何动态更改报告连接表单web config.i表示如何在运行时将数据源,数据库名称,用户ID和密码传递给水晶报表。



问候

Aravind

Hai
i am use crystal reports in my website,i am add crystal reports and add database to reports by choosing Data Expert in design time and create new connection and set my local server name,database name ,userid and password .Once create connection i can add tables and finally i can drag and drop fields to crystal reports fields.if i see main report preview in design time i can view the report correctly and also in running time also i can get correct report.But if i deploy in server machine ,i need to change datasource,database name,userid and password,bcz in server machine datails different from my local machine like datasource,database name,userid and password.So how to dynamically change the reports connection form web config.i mean how to pass data source ,database name,userid and password to crystal report in run time.

Regards
Aravind

推荐答案

将所有这些值作为参数传递然后使用报告中连接字符串中的参数。
Pass all these values as parameters and then use the parameters in the connection string in your report.


我用Google搜索并发现这篇文章可以帮助您:

http://taylortutorials.wordpress.com/2010/06/10/set-crystal-reports- datasource-at-run-time / [ ^ ]
I googled and found this article that may help you:
http://taylortutorials.wordpress.com/2010/06/10/set-crystal-reports-datasource-at-run-time/[^]


查看本教程

C# Crystal Reports动态登录参数 [ ^ ]


这篇关于如何为Crystal Reports动态指出servername,database,userid和password?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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