Visual Studio中的Crystal Reports数据源 [英] Crystal Reports datasource in Visual Studio

查看:424
本文介绍了Visual Studio中的Crystal Reports数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2005默认安装Crystal Reports。

Using Visual Studio 2005 with default install of Crystal Reports.

当我创建一个报表时,Crystal会询问数据库,并给它我的开发数据库。在应用程序中,我创建一个DataTable并将其传递给报告,然后将其传递给CR查看器。在运行时,报表对象和查看器都不需要查看数据库,因为我已经检索了表。

When I create a report, Crystal asks for the database, and I give it my development db. In the app, I create a DataTable and pass it to the report, which is then handed to the CR Viewer. At runtime, neither the report object, nor the viewer need to see the db since I have already retrieved the table.

当应用程序交给用户时,一切正常精细。他们看不到开发数据库。

When the app is handed to the users, everything works fine. They cannot see the development db.

在生产部门,我在生产站点创建了一个报表,而不是通过指定开发数据库,我给它生产db。回到我自己的办公室,在VS中运行,报表尝试连接到开发数据库,​​并失败。 (它不可见。)

Once, in the production office, I created a report at the production site, and instead of creating the Crystal Report by specifying the development db, I gave it the production db. Back in my own office, running in VS, the report tries to connect to the development db, and fails. (It's not visible.)

所以,这不是一个问题,他们看不到我的开发数据库,​​但它是一个问题,我看不到生产数据库。

So, it's not a problem that they can't see my development database, but it is a problem that I can't see the production database.

问题是:这是否因为在VS中运行与运行安装的应用程序不同而出现?为什么报告尝试连接到数据库?

Questions are: Does this arise because running in VS is different from running the installed app? Why does the report try to connect to the DB anyway? How do I control it?

推荐答案

当你创建报表时,你应该能够做report.SetDataSouce(DataSet)它是您的数据集,其中包含报表使用的表。

When you create the report you should be able to do report.SetDataSouce(DataSet) and pass it your dataset that contains the tables that the report uses.

这篇关于Visual Studio中的Crystal Reports数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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