Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 203991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:25:40+00:00 2026-05-11T17:25:40+00:00

I have a Crystal report with 50 odd subreports, each with loads of parameters.

  • 0

I have a Crystal report with 50 odd subreports, each with loads of parameters. Switching it from one database to another takes ages as the Crystal Reports IDE insists that you enter all the parameters for each sub-report.

I’m wondering if it’s possible to write a quick tool in C# to view the current database config of all of the sub-reports in an rpt file, and ideally to switch to a different database.

Unfortunately (or fortunately) I don’t have much experience of the Crystal object model – anyone know where to start?

Thanks,
Jon.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:25:40+00:00Added an answer on May 11, 2026 at 5:25 pm

    This should do the job. Obviously replace the passwords and User names where neccesary.

    Private Sub ProcessFile(ByVal FileName As String)
            Dim CR As Engine.ReportDocument = Nothing
            Try
                CR = New Engine.ReportDocument
                CR.Load(FileName, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
    
                'Recurse thru Report
                RecurseAndRemap(CR)
                'Save File
                CR.SaveAs("OutPutFilePath")
    
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            Finally
                If Not CR Is Nothing Then
                    CR.Close()
                    CR.Dispose()
                End If
            End Try
        End Sub
    
        Private Sub RecurseAndRemap(ByVal CR As Engine.ReportDocument)
            For Each DSC As CrystalDecisions.Shared.IConnectionInfo In CR.DataSourceConnections
                DSC.SetLogon("YourUserName", "YourPassword")
                DSC.SetConnection("YouServerName", "YourDatabaseName", False)
            Next
    
            CR.SetDatabaseLogon("YourUserName", "YourPassword")
    
            For Each Table As Engine.Table In CR.Database.Tables
                Table.LogOnInfo.ConnectionInfo.UserID = "YourUserName"
                Table.LogOnInfo.ConnectionInfo.Password = "YourPassword"
            Next
    
            If Not CR.IsSubreport Then
                For Each SR As Engine.ReportDocument In CR.Subreports
                    RecurseAndRemap(SR)
                Next
            End If
        End Sub
    

    Hope that helps Cheers Ben

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a crystal report that gets its data from one stored procedure, this
I have a crystal report that is connecting to a database. The datatable from
I have created one Crystal Report with two Subreports. Here I included both the
I have a crystal report with 2 subreports. The type of the one of
I have a crystal report that gets ran several hundred times from a C#
Guys, i have a crystal report with a combination of database fields and static
I have a Crystal Report I'm trying to recreate from scratch after an update
I have one formula in crystal report, which displays fixed text if the value
I have a Crystal Report file from an old version (unfortunately I don't know
I have a crystal report that is like this: Group By Property.ID Group By

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.