报告应用程序在不同的报表服务器中 [英] Reports applicaion in different report servers

查看:56
本文介绍了报告应用程序在不同的报表服务器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2012中创建了一个带有reportviewer控件的WindowsForm项目。在创建项目期间,定义了连接字符串(例如ServerNmae.myDatabase)。编译项目并创建projectName.exe.config文件,其内容如下。





< configuration>

< configsections>



< connectionstrings>

< add name =ServerName.Properties.Settings。 myDatabaseConnectionString>

connectionString =Data Source = SERVERNAME; Initial Catalog = mydatabase; Integrated Security = True

providerName =System.Data.SqlClient/>



< startup>

< supportedruntime version =v4.0sku =。NETFramework,Version = v4.5>









效果很好。现在我想要使用此应用程序并在包含相同数据库(例如mydatabase)的其他服务器中运行它。这可以通过编辑数据源SERVERNAME来完成吗?

这是我到目前为止所做的,但报告没有填充。所以我需要知道它是否应该工作或解决其他问题。

I have created a WindowsForm project with reportviewer control in VS2012. During the creation of the project, the connection string was defined (e.g. ServerNmae.myDatabase). the project is compiled and a projectName.exe.config file is also created with contents as follows.


<configuration>
<configsections>

<connectionstrings>
<add name="ServerName.Properties.Settings.myDatabaseConnectionString">
connectionString="Data Source=SERVERNAME;Initial Catalog=mydatabase;Integrated Security=True"
providerName="System.Data.SqlClient" />

<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5">




Works great. now I want to take this application and run it in a different server that contains the same database (e.g. mydatabase). Can this be done just by editing the Data source SERVERNAME?
That is what I have done so far but the report does not get populated. so I need to know if it should work or troubleshoot something else.

推荐答案

在不同的PC或服务器上运行应用程序时,有几个选项可以检查问题是什么。您可以使用消息框或将异常详细信息写入日志文件来显示异常详细信息。然后你就知道运行时发生了什么。使用try .. catch。阻止捕获异常。

当您在连接中使用集成安全性时,它将检查应用程序令人兴奋的用户是否具有sql server的权限。如果您的应用程序和sql server在同一台机器上运行,那么集成安全性将在大多数时间运行。当您从不同的PC连接到SQL Server时,请确保Windows用户/执行域用户具有到SQL Server的pevileges,或者您可以通过在连接字符串中使用sql server用户名和密码来更改为sql server身份验证。查看 https://www.connectionstrings.com/sql-server/ [ ^ ]用于连接字符串格式
There are few options to check what is the issue when running application on different pc or server. You con display exception details by using message box or write exception details to a log file. Then you know exactly what's happening in run time. Use try.. catch. Block to capture exceptions.
When you using integrated security in the connection, it will check whether application exciting user has privileges to sql server. If your application and sql server running in the same machine then integrated security will work most of the time. When you connect from different pc to sql server, make sure that windows user/executing domain user having pevileges to sql server or you can change to sql server authentication by using sql server user name and password in the connection string. Check https://www.connectionstrings.com/sql-server/[^] for connecting string formats


这篇关于报告应用程序在不同的报表服务器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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