×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Crystal Reports 2011, table.ApplyLogOnInfo has no effect

Crystal Reports 2011, table.ApplyLogOnInfo has no effect

Crystal Reports 2011, table.ApplyLogOnInfo has no effect

(OP)
Hi,

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.

Any idea why ApplyLogOnInfo doesn't accept my changes?

Thx.

RE: Crystal Reports 2011, table.ApplyLogOnInfo has no effect

(OP)
Sadly I have no choice, the back-end is essentially an upgrade of existing functionality, with existing reports that can not be changed, that's just not going to happen.

So, I have to make it work the way it is.

RE: Crystal Reports 2011, table.ApplyLogOnInfo has no effect

What is the report connection type? Your code may work for OLE DB connections but will not work for ODBC connections.  

Report automation for Crystal reports and SSRS
www.R-Tag.com

RE: Crystal Reports 2011, table.ApplyLogOnInfo has no effect

(OP)
All data is fetched within the report(s), I only (try to) set the database credentials and the parameters.

Essentially, the code works, that has been proven for many years now, except, it just doesn't anymore on my own pc, with the new CR 2011 version (= 13).

That seems to suggest that CR no longer supports ApplyLogOnInfo, at least the way it used to.

RE: Crystal Reports 2011, table.ApplyLogOnInfo has no effect

Do you really need to change server and database name ?
If they are the same check if your code will work when you set just the values for user and password.
You will be able to change the server and database too , but setting ConnectionInfo properties will not work for all crystal versions and all connection types.

Report automation for Crystal reports and SSRS
www.R-Tag.com

RE: Crystal Reports 2011, table.ApplyLogOnInfo has no effect

@RTag
I would hope you don't develop against the production database. Having a local copy of the db schema and a subset of data makes for a much better development experience. then it should just be a matter of changing the connection string.

Jason Meckley
Programmer

FAQ855-7190: Database Connection Management
FAQ732-7259: Keeping the UI responsive

RE: Crystal Reports 2011, table.ApplyLogOnInfo has no effect

No, I am not developing against production database :). Generally it is not a good idea to work on you machine too.
Having separate test and real (production) word is probably the best scenario. When the report is ready in test world deploy it to real world and change server/database name to avoid doing that each time when you run it (this will work if you develop on your machine too). If the report is used with more than one database or server then connection should be set in runtime, but the code may be different for different connection types and crystal versions and may require update when crystal reports is upgraded.

Report automation for Crystal reports and SSRS
www.R-Tag.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close