大家帮我解决有关水晶报表的问题. [英] hey guys help me regarding crystal report issue.

查看:72
本文介绍了大家帮我解决有关水晶报表的问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个应用程序,并在其中使用了水晶报表.但是,当我在另一个系统中运行该应用程序时,它要求提供数据库凭据(用户名,密码,服务器,数据库)和服务器,数据库以文本框只读格式显示.问题是我已经在web.config和编码部分中设置了新的数据库(新系统)凭据.但是我不知道为什么它显示以前的系统数据库连接.

当我创建Crystal报表时,我已经在其中设置了一个向导连接(用户名,密码,服务器,数据库),这可能是可能的.因此,我显示了向导连接而不是C#编码连接.

还有一个问题,如果我们必须更改向导连接,那么我们如何在服务器上运行应用程序,因为在那里我们提供了服务器数据库凭据.因此,在这种情况下,我们必须在使用Crystal Report运行应用程序时更改数据库连接.或者我们将数据库连接设置在某个地方.

知道解决方案的任何人,请指导.在此先感谢.

I have developed an application & using crystal report in it. But when i run that application in another system it ask for database credentials (user name, password, server, database) & server, database shows in textbox read only format. The matter is that i had already set new database (new system) credentials in web.config & in coding part. But i dnt know why it show previous system databse connection.

May be this is possible, when i create crystal report i had set a wizard connection in it (user name, password, server, database). So i shows wizard connection rather than C# coding connection.

One more question if we have to change wizard connection then how we run application on server because at there we provides server database credentials. So in this case we have to change database connection while we live our application with crystal report. Or we set our database connection somewhere.

Anyone who know the solution, kindly guide. Thanks in Advance.

推荐答案

请勿尝试直接从表或存储过程创建报告.
将所需的数据加载到数据集或数据表中.将这些数据集或数据表设置为报告的报告源.这样,将不会提示您提供数据库凭据.

只需遵循简单的步骤:
1.使用从员工中选择*"创建命令对象

2.使用数据适配器获取数据并将其填充到数据集中.

3.使用ds.WriteXmlSchema(硬盘驱动器中的本地文件夹")函数.运行并停止
应用程序.这样该架构将保存在给定的路径中.

4.从解决方案资源管理器中将Crystal Report添加到您的项目中.

5. Crystal Report向导将提示您提供数据源.选择
ADO.NET(XML)和架构文件的路径.该报告将被创建
使用架构.
6.如果结构有任何更改,请单击验证数据库".
Do not try creating reports directly from tables or stored procedures.
Load the required data in datasets or datatables. Set these dataset or datatable as the report source for the report. That way you will not be prompted to give the database credentials.

Just follow the simple steps:
1. Create a command object with "select * from employee"

2. Use a dataadapter to get the data and populate it in the dataset.

3. Use the ds.WriteXmlSchema("A local folder in hard drive") function. Run and stop
the application. so that schema will be saved at the given path.

4. Add Crystal Report to your project from Solution Explorer.

5. Crystal Report Wizard will prompt you to give the data source. Choose the
ADO.NET(XML) and the path of the schema file. The report will be created
using the schema.
6. If there is any change in the structure just click "Verify Database".


这篇关于大家帮我解决有关水晶报表的问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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