on 2025 May 02 3:40 AM
Hello, I'm new to programming. I would like to create a tool that reads my Crystal Reports .rpt file and sends the result by email. However, when I try to read the .rpt file, the connection fails. I'm using VS 2019, C# language.
Crystal Reports 13 SP37
I have already used commands like
SetDatabaseLogon(sqluser, sqlpassword, sqlserver, company);
or
foreach (IConnectionInfo info in rpt.DataSourceConnections)
{
info.SetLogon(UserID, Password);
info.SetConnection(ServerName, DatabaseName, false);
}
foreach (ReportDocument sub in rpt.Subreports)
{
foreach (IConnectionInfo info in sub.DataSourceConnections)
{
info.SetLogon(UserID, Password);
info.SetConnection(ServerName, DatabaseName, UserID, Password);
}
and it doesn't work
Request clarification before answering.
CR for VS doesn't come with the Hana database Client.
Often what you need to do is create a report in CR Designer first, the same step you use to connect to Hana you need to set the same values in VS.
Test the connection in CR first, then set the same values in your app.
Then open that report in VS and see if it connects.
Try this, In VS open your test report or create a new report and set the Database info:
Then select ODBC, I believe Hana Client uses ODBC, I don't have it so I can't show you:
If that works then you need to set the same values in code as the Hana client requires.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, but the idea is to take the ready .rpt files that are in SAP B1 and run them on another machine at specific times using the service. The connection string is already set up within Crystal Reports.
I can open it the first time when it's saved, but when I try to refresh the report, a message appears.
User | Count |
---|---|
30 | |
22 | |
16 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.