Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2016 : Data Connectivity  
Message Icon Topic: Change data provider in CR runtime code? Post Reply Post New Topic
Author Message
billux123
Newbie
Newbie


Joined: 03 Aug 2017
Online Status: Offline
Posts: 2
Quote billux123 Replybullet Topic: Change data provider in CR runtime code?
    Posted: 10 Aug 2017 at 9:28am
Is there any way to change the data provider in the crystal runtime code to a different provider than what was set in the IDE while building the report? I have a situation where I have over 600 rpt files that were created with "Microsoft OLE DB Provider for SQL Server" and I need to now run these reports with the "SQL Server Native Client 11.0" provider on our servers with the crystal runtime. We really don't want to have to go back and manually switch the provider in all of our report files!

Thanks!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3587
Quote hilfy Replybullet Posted: 11 Aug 2017 at 5:01am
If you're using the "runtime", that means that you're running the reports through an application. Is this an application that you or your employer have written or is it a third-party application.

If you or your employer have written the application, then yes, you can change the provider at run time. You can find an example for how to do this here: https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples#CrystalReportsfor.NETSDKSamples-Database.

If you're running a third-party application, then there's probably no way of doing this at runtime. However, it wouldn't be difficult to write an application that will open each report, change the data provider, then save the report so that it has the correct provider when it runs.

-Dell
DecisionFirst Technologies - a Proviti Enterprise
9-Time SAP BusinessObjects Partner of the Year.
www.decisionfirst.com
IP IP Logged
billux123
Newbie
Newbie


Joined: 03 Aug 2017
Online Status: Offline
Posts: 2
Quote billux123 Replybullet Posted: Today at 4:27am
Originally posted by hilfy

If you're using the "runtime", that means that you're running the reports through an application. Is this an application that you or your employer have written or is it a third-party application.

If you or your employer have written the application, then yes, you can change the provider at run time. You can find an example for how to do this here: https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples#CrystalReportsfor.NETSDKSamples-Database.

If you're running a third-party application, then there's probably no way of doing this at runtime. However, it wouldn't be difficult to write an application that will open each report, change the data provider, then save the report so that it has the correct provider when it runs.

-Dell


Yes I am trying to run reports from with in my own custom built application. Do you know what property I can use to change the provider? I looked threw the examples you provided and could not find an example of when the provider was being changed.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3587
Quote hilfy Replybullet Posted: Today at 5:12am
Although this talks about parameters, it also contains info about how to change the database driver.

https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/

It has a link to an SAP Note where you can download the code for the application.

-Dell

Edited by hilfy - Today at 5:13am
DecisionFirst Technologies - a Proviti Enterprise
9-Time SAP BusinessObjects Partner of the Year.
www.decisionfirst.com
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.