Mutiple supreports with Crystal report

Hi I am a programmer for a company called Matiss inc in Quebec.

My problem is this :

We are using VB 6 enterprise to communicate with Crystal Reports 8.5,
C.R. is connected to a SQL Server 2000 database.
We are using Crystal report OCX “Crystl32.ocx VS 8.0.0.4”

By calling Crystal Report from our VB Application we set the data source using the object’s properties. The problem is if the name of the server changes the sub report are no longer linked to the database.

i have found "SubReportToChange", "GetNSubreports" and "GetNthSubreportName" but i cant figure out how to use SubReportToChange...

Any suggestions would be very helpful.
CajunXAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
hmadhurConnect With a Mentor Commented:
Hi
You have found the solution yourself. SubReportToChange is the function to be used when you want to propogate any changes to the subreport.

When you call SubReportToChange, Crystal Reports loads the subreport into the memory. So any function call to change the Data Source or any other property changes you make will be directly sent to the subreport. For Eg: If you have a Report with two subreports named SubReport1.Rpt and SubReport2.Rpt. You want to change the SQLQuery property of SubReport1.Rpt. First you call SubReportToChange with the SubReports name. viz.

ActivexControl1.SubReportToChange = "SubReport1.Rpt"
'Any property changes after this statement will happen for SubReport1.
ActivexControl1.SQLQuery = strSql

The SQLQuery property will be set for the subreport.

When you want to revert back to the main report call SubReportToChange with empty string.

ActiveXControl1.SubReportToChange = ""

This will return the control to the main report.

Hope I got it right. Let me know if you want anything more.
By the way, Quebec is in Canada, isn't it? Wonderful place. I am trying for a job there. Right now I am in Dubai, UAE.

Regards
Madhur
0
 
CajunXAuthor Commented:
This is very important
0
 
CleanupPingCommented:
Hi CajunX,
This old question (QID 20565063) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept hmadhur's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0
All Courses

From novice to tech pro — start learning today.