Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 2556

ApplyLogOnInfo does not save data to report

$
0
0

Hi,

 

i have a big problem and it keeps on track for a few days now. We are using a old module, which was developed in Delphi for Report and Printing. Now its time to get new and for that I develop same module in .net and Visual Studio 2015.

As it is a old module, we have a lot of Reports created in CR XI. Open an showing these reports is no problem for the new modul as long as i use the same Oracle-Database as the report was created for.

But if I run the module at the customer place and have the same database but other User, PW and Databasename its not working anymore. Troubleshooting showed that ApplyLogOnInfo() don't saves the connectioninfo into the Reportfile.

I have tried a lot to fix it, searched for days thru all kind of forum but didn't find anything that solved the problem. I even tried to use complete fresh Reports created with Crystal Reports 2013 but it did not help either.

 

Maybe someone of you can help me?

 

regards

Tobias

 

        string DBUser = Application.Current.Properties["DBUser"].ToString();
        string DBPasswort = Application.Current.Properties["DBPasswort"].ToString();
        string Database = Application.Current.Properties["DataSource"].ToString();

 

        InitializeComponent();
        _Parentwindow = Parentwindow;
        if (System.IO.File.Exists(ReportFile))
        {
            CrystalReport = new ReportDocument();
            string test = Application.Current.Properties["ConnectionString"].ToString();
            CrystalReport.Load(ReportFile);

 

            foreach (CrystalDecisions.CrystalReports.Engine.Table ThisTable in CrystalReport.Database.Tables)
            {
                TableLogOnInfo crtableLogoninfo = ThisTable.LogOnInfo;
              
                crtableLogoninfo.ConnectionInfo.UserID = DBUser;
                crtableLogoninfo.ConnectionInfo.Password = DBPasswort;
                crtableLogoninfo.ConnectionInfo.ServerName = Database;
                ThisTable.ApplyLogOnInfo(crtableLogoninfo);
           

}

 

 

            foreach (ReportDocument Sub in CrystalReport.Subreports)
            {

 

                foreach (CrystalDecisions.CrystalReports.Engine.Table ThisTable in Sub.Database.Tables)
                {
                    TableLogOnInfo crtableLogoninfo = ThisTable.LogOnInfo;
                    crtableLogoninfo.ConnectionInfo.UserID = DBUser;
                    crtableLogoninfo.ConnectionInfo.Password =  DBPasswort;
                    crtableLogoninfo.ConnectionInfo.ServerName = Database;
                    ThisTable.ApplyLogOnInfo(crtableLogoninfo);
                }
            }

 

 

 

            Reportname = ReportFile;
            ReportViewer.ViewerCore.ReportSource = CrystalReport;

Viewing all articles
Browse latest Browse all 2556

Trending Articles