Error logging into Crystal Reports

After spending 3 to 4 hours on Google trying to find a solution to my problem, I was out of luck.

In fact, we use Crystal reports for our .NET applications with the server side sql, we have many clients, each of which has its own server, so our reports need to dynamically establish connections. Until a week ago, this worked fine. However, a few days ago, the client announced that he was receiving a request to enter the database for the report (only one report, the rest worked fine). We were rather puzzled, but we managed to play it on a netbook on which Visual Studio or SQL Server was not installed. In the end, the developer decided to reproduce the report in the hope that in this particular report it would just be weird.

Unfortunately, the new client today also faced the same problem, but this time for every Crystal report they had, and he also worked on a netbook, so we really got lost here.

Below is a screenshot of what our customers receive as a gift -

Screen shot

  and here is the code that I use to set the connection information in the report

                cI.ServerName = (string)builder["Data Source"];
                cI.DatabaseName = (string)builder["Initial Catalog"];
                cI.UserID = (string)builder["User ID"];
                cI.Password = (string)builder["Password"];

                foreach (IConnectionInfo info in cryRpt.DataSourceConnections)
                {
                    info.SetConnection(cI.ServerName, cI.DatabaseName, cI.UserID, cI.Password);
                }

                foreach (ReportDocument sub in cryRpt.Subreports)
                {
                    foreach (IConnectionInfo info in sub.DataSourceConnections)
                    {
                        info.SetConnection(cI.ServerName, cI.DatabaseName, cI.UserID, cI.Password);
                    }
                }

As always, any help is greatly appreciated.

+5
source share
3 answers

, , , , . .net . , .

.

+2
+2

. / , , , .

- :

Crystal Reports Viewer screen shot

then, when you configure SQL Server login information for the report, make sure you provide the service name . So, for example, make sure you pass Crystal "myserver \ myservice" instead of "myserver".

My program can access data from SQL Server using only "myserver", but Crystal needs to provide "myserver \ myservice".

0
source

All Articles