To address a long standing bug/issue with the Crystal Reports application forcing you to update every table/view/sproc one by one I built a quick/dirty application in c#.

You will need .NET installed and the Crystal runtime v13 to run it: http://snk.to/f-cztp0jk7

Here’s the code… no error trapping etc… I may improve it in the future:

            InitializeComponent();
            ReportDocument rpt = new ReportDocument();
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "Crystal Reports (*.rpt)|*.rpt";
            ofd.ShowDialog();
            rpt.Load(ofd.FileName);
            ConnectionInfo ci = new ConnectionInfo();
            ci.ServerName = Microsoft.VisualBasic.Interaction.InputBox("Server");
            ci.DatabaseName = Microsoft.VisualBasic.Interaction.InputBox("Database");
            ci.UserID = Microsoft.VisualBasic.Interaction.InputBox("User");
            ci.Password = Microsoft.VisualBasic.Interaction.InputBox("Password");
            ci.IntegratedSecurity = (Microsoft.VisualBasic.Interaction.InputBox("SSPI (Y/N)") == "Y");
            TableLogOnInfo tli = new TableLogOnInfo();
            tli.ConnectionInfo = ci;
            for (int i = 0; i < rpt.Database.Tables.Count; i++)
            {
                rpt.Database.Tables[i].ApplyLogOnInfo(tli);
            }
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.DefaultExt = ".rpt";
            sfd.ShowDialog();
            rpt.SaveAs(sfd.FileName);
            Environment.Exit(0);
Advertisements