Changing database at runtime for Crystal Report

How to change database, server name at runtime for crystal report designed for asp.net application. I am using multiple databases of same table structures. I want to change X database to Y database at runtime through vb.net coding. Sql Server 2000 is used as data server. Please suggest a way to change database, servername, userid and password at runtime
0
nsomu
7/21/2005 10:23:21 AM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

1 Replies
389 Views

Similar Articles

[PageSpeed] 48

You can use this code to log on to the different databases

Private Sub LogOn(ByVal poReport As CrystalDecisions.CrystalReports.Engine.ReportDocument, ByVal strServer as string, ByVal strTable as string, ByVal strUsername as string, ByVal strPassword as string)
   Dim lsMethod As String = System.Reflection.MethodBase.GetCurrentMethod().Name
   Dim loConnInfo As New CrystalDecisions.Shared.ConnectionInfo
   Dim lsMode As String = ConfigurationSettings.AppSettings("Mode")
   loConnInfo.ServerName =strServer 
   loConnInfo.DatabaseName = strTable 
   loConnInfo.UserID = strUsername 
   loConnInfo.Password = strPassword 
   
Dim loTables As CrystalDecisions.CrystalReports.Engine.Tables
   
Dim loTable As CrystalDecisions.CrystalReports.Engine.Table
   
Dim loTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
   loTables = poReport.Database.Tables
   
For Each loTable In loTables
      loTableLogonInfo = loTable.LogOnInfo
      loTableLogonInfo.ConnectionInfo = loConnInfo
      loTable.ApplyLogOnInfo(loTableLogonInfo)
   
Next
End Sub

All you need to do is pass the report to this function and it will direct it to the new database.

0
RyanSmith
7/25/2005 12:19:09 AM
Reply:

Similar Artilces:

Converting Crystal Reports 9 report to Crystal Reports .NET report
I have a web page that is supposed to display a crystal report.  The report is fully written and functional in crystal 9 (non-.Net)  .  Is there a way to convert my .rpt so that I can just include it in the new web site? why you don't try to compile project with .net and include your report. then if crystal report is power tool will suggests you with conversation tool    My blog is here.Please remember to 'Mark as Answer' if this post answered your question! Wow it really was that easy!  I just added the old crystal report into my .NET proj...

crystal reports .net -> crystal reports .net 2003
recently converted a project from .net to .net 2003. The 2 crystal reports I had in the project do not load when executing the application. The project itself within 2003 will allow me to multiplat the crystal reports, however when it comes to execution time I get the error: Invalid Data Source. If this isn't the right forum please point me to the right one as this is really the only website I know of with a large reader base. >to multiplat the crystal reports To what the crystal reports? Do you have the same database connections established and verified in your 2003 s...

integration of Crystal Report with .NET ; crystal report viewer not displaying in Toolbox
Hi I m new to Visual Web Developer 2005 Express Edition. I want to integrate Crystal Report with .NET. In my Toolbox , Crystal Report Viewer is not displaying. How to make it possible? + How to call my report from asp.net 2.0. Need source code plz.*Share Knowledge Every TIME Crystal Reports for .NET does not come with VWD Express.  It only comes with VS 2005 Professional (I'm not sure about the Standard edition).If you have Crystal Reports 10 or XI, you can installed the .NET libraries for Crystal and then use them within VWD Express, noting that you have to build your reports ...

VS .net 2005 Crystal reports ok to run on Crystal Reports XI?
I am getting mixed messages from the asp.net website hosting providers - some say they do not support Crystal Reports due to a $25,000 per cpu licensing fee, others say all I need to do is install Crystal Reports XI (about $500) on a dedicated server and it will run fine. Will Reports developed with the embeded Crystal Reports in VS 2005 run in a Crystal Reports XI environment? Thanks....

Cassini, VS.Net and Crystal Reports
Hi,I am working with Win XP home, Cassini and VS.Net.I would like to play with some Crystal Reports.I create the report in VS as CrystalReport1.I put a CrystalReportViewer on my web form. It does not get recognized as a defined object type but there are no build errors.When I run the app I get an error: Type 'CrystalReport1' is not defined.I have googled on this and see several things people have suggested/tried to correct this. Most I have already tried or the suggestions are not very clear to me. Then I came across a msg that instructed me to set up virtual directories for IIS for CrystalR...

RunTime Report With Crystal Report
hi dears. I'm a new user and work with C#. i want create RunTime Reports with Crystal Report. but i can't. I can't send parameters in C# programs to Crystal Report File. i want list fileld's in my program. and select Choice Field's. and send to crystal report file. then report that field and values. for example : i select in program name and family and phone number and home address. and click to report. and send that parameters to report file. name family phone address ---------------------------------- xxxxx xxxx1 4341254 ...

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
hello Friends,I developing web site in asp.net 2005. Using inbuilt  crystal report for reporting.Development time its working fine but problem arise when i published site and upload in a web server.first some reference dll were missing so i copy them from gac and paste then in the bin folder for local reference.It works, but not i received the following error message:An error has occurred while attempting to load the Crystal Reports runtime.Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.Please install the ...

Export Crystal Report to Crystal Report format
I looked at some sample code provided by crystaldecisions, and they have the ability to export a web crystal report to a crystal report. I was assuming that this would cause the local instance of Crystal reports on the client machine to be invoked. I tried this in my project, and I get the following error: Error Encountered by Crystal Web Report Server -------------------------------------------------------------------------------- The error message returned is: Connection to Report Server Failed. It creates the file as an .rpt file in the directory it should. Do I need a dif...

Are there other reporting tools other than reporting services and crystal reports
Has anyone had any experience with any reporting tools other than Reporting services and Crystal reports? If so, is there one that you would strongly recommend? Or, are these two the top choice on the market for report generation from .NET? I have heard some moaning and groaning about reporting services. Specifically in regards to the amount of time needed to design a report. Crystal reports seems kind of difficult to me, as I don't have any training with it. Basically I am looking for a reporting tool that is easy to use, and can be used from .NET....

Crystal Report.NET and nested sub reports
I have a report where i need to have several nested subreports... A parent may have childs and childs may have other childs and so on... CrystalReport.NET and VS2005 seems to support one level of subreport (a report could have a nested subreport but this nested subreport can't have another nested subreport). I really need to handle multiple levels of nested subreports in order to complete my report. What is the solution ???   Thanks   Eviral     I'm not positive if this works but its worth a shot.  Create the subreports as se...

Reporting (Crystal Reports vs. Custom .NET)
Ok, so I have to confess, I have never tried Crystal Reports. I just recently started working for a marketing company now and reporting is VERY important to them.  I am currently migrating a lot of the applications they use from VB5 and VB6 to web based .NET 3.5 apps.   The whole company is running off ACCESS databases if you can believe that.  They sometimes have up to a few hundred agents taking sales on incoming calls and chat sessions and they are all getting streamed to FLAT file records (completely un-normalized database).  I am in the process of developing a c...

Errors with all my reports after upgrade from Bundeled Crystal.NET (VS2003) to Crystal XI Developer for .NET
All my Crystal reports were developed using the bundled Crystal in VS 2003.  I just installed the Crystal XI for .NET Developer version that we purchased and now I get an error when running my reports.  (I am running them in debug mode on my development machine). I have tested it on several different reports.  I did not change the code, this worked fine in the previous version. First I reference my report (AccountList is the AccountList.rpt report that is in my project): Dim myReport As New AccountList Then I start rolling through the report's tables to update the log...

How do I incorporate a crystal report other than the crystal report provided by Visual Studio?
I'm working with the CrystalDecision version of the crystal report. How do I incorporate this into my development?...

How do I deploy an application using crystal reports/install crystal reports?
First of all: C# .NET framework 1.1, IIS 6.0, XP SP1, Windows forms - not ASP.NET but I don't see how it would make a differenceMy Situation: I am tasked with adding to an application the ability to generate a crystal report.  It currently has nothing to do with them.The application runs on an XP system with .NET 1.1 installed but lord only knows how it was installed on there (the guy that set it up is long gone and from past experience with his work I think he was just guessing anyways) In an attempt to see if crystal reports was installed, I wrote a quick test forms appl...

Web resources about - Changing database at runtime for Crystal Report - asp.net.crystal-reports

Changing room - Wikipedia, the free encyclopedia
A changing room , locker room , dressing room (usually in a sports, theater or staff context) or changeroom (regional use) is a room or area ...

Beyond Timeline: The Changing Face Of Facebook Ads
Despite the hype, timeline may not be the most exciting, or important change coming on March 30. Expanded advertising opportunities may unlock ...

Robert Scoble - Micromedia, how it's changing what we blog - Facebook
Jeremiah Owyang wrote an interesting piece about micromedia and how it's changing what we do on blogs and how we distribute media (er, ideas, ...

8 Ways the Changing Facebook Home Page Will Affect Application Virality
For developers who live and die by the changes Facebook makes to the way information flows through the service, every little Facebook tweak has ...

Changing Lanes (@chginglanes) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Changing the way business decisions are made
We believe that social data has unlimited value, and near limitless application. Today, we’re taking an important step toward unleashing this ...

The Right and Wrong Reasons for Changing Jobs
... your profile is a clue to the folks at LinkedIn that you’re thinking of switching jobs, so don’t be The Right and Wrong Reasons for Changing ...

We're Changing Our Name (Back) to Stack Overflow
We are Stack Overflow. You may know us from such popular websites as Stack Overflow Q&A, Stack Overflow Careers, The Stack Exchange Q&A Network, ...

The Tao of Twitter: Changing your life and business 140 characters at a time - Amazon
It's time to take the mystery out of Twitter. Twitter may be the most powerful business and personal networking platform ever created but it ...

App Store - Voices 2 ~ fun voice changing!
Read reviews, get customer ratings, see screenshots, and learn more about Voices 2 ~ fun voice changing! on the App Store. Download Voices 2 ...

Resources last updated: 11/25/2015 5:31:03 PM