CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #6
    Join Date
    Jul 2005
    Location
    Louisville, KY
    Posts
    201

    Re: C# and Crystal Report

    Quote Originally Posted by kikoph View Post
    to add further info, is there a way to dynamically change the table.LogOnInfo.TableName ?

    ie:
    Code:
    table.LogOnInfo.TableName = "dynamic view or tablename"
    In leiu of that question, from that link I gave,

    Code:
    private void AssignConnectionInfo(ReportDocument document,ConnectionInfo crConnection)
        {
            foreach (CrystalDecisions.CrystalReports.Engine.Table table in document.Database.Tables)
            {
                TableLogOnInfo logOnInfo = table.LogOnInfo;
                if (logOnInfo != null)
                {
                    table.ApplyLogOnInfo(table.LogOnInfo);
                    table.LogOnInfo.TableName = table.Name;
                    table.LogOnInfo.ConnectionInfo.UserID = crConnection.UserID;
                    table.LogOnInfo.ConnectionInfo.Password = crConnection.Password;
                    table.LogOnInfo.ConnectionInfo.DatabaseName = crConnection.DatabaseName;
                    table.LogOnInfo.ConnectionInfo.ServerName = crConnection.ServerName;
    
                    CrystalReportViewer1.LogOnInfo.Add(table.LogOnInfo);
    
                }
            }
        }
    Apparently, according to http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx, that TableName is just passed as a "String*".
    Last edited by QuinnJohns; October 12th, 2011 at 11:03 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured