Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 2011, table.ApplyLogOnInfo has no effect

Status
Not open for further replies.

kristofdielis

Programmer
Sep 1, 2011
25
Hi,

I don't know if this forum is the right place for development questions, but ...

I'm writing a 'general purpose' back-end, that needs to provide basic operations, to load a Crystal Reports report.

Using the connection string I get from the client app (a test program, at the moment), I build a ConnectionInfo object and apply it to the table(s) of the selected report (+ sub reports):

Code:
CRS.TableLogOnInfo tableLogOnInfo = table.LogOnInfo;

tableLogOnInfo.ConnectionInfo.ServerName = connectionInfo.ServerName;
tableLogOnInfo.ConnectionInfo.DatabaseName = connectionInfo.DatabaseName;
tableLogOnInfo.ConnectionInfo.UserID = connectionInfo.UserID;
tableLogOnInfo.ConnectionInfo.Password = connectionInfo.Password;

table.ApplyLogOnInfo(tableLogOnInfo);


If I halt the debugger on the last line, table contains the correct information. Once I execute the ApplyLogOnInfo, it seems to have restored the original connection, provided in the report itself.

The reports used are delivered to me, I have zero control regarding the content, so I have to make them work as is.

Any idea why ApplyLogOnInfo doesn't accept my changes?

Thx.

PS: I am using Visual Studio 2010, so with Crystal Reports 2011
PPS: I also posted this question on the C# forum.
 
One reason I can see for that not to work is if the original reports was designed to use Integrated Security. That will override any login password.

If you can't modify the original design then use
tableLogOnInfo.ConnectionInfo.UseTrusted=False

Make sure your ODBC setting is also set to NOT use integrated security.

Bruce Ferguson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top