database location of SubReports 
Author Message
 database location of SubReports

I can iterate through tables of a report & set the DB location at run time
with

         For i = 1 To Report.Database.Tables.count
            Report.Database.Tables(i).Location = gsDBPath &
"\DB\ReviewDB.mdb"
         Next i

but how do I do this for subreports?



Thu, 22 Apr 2004 21:42:01 GMT  
 database location of SubReports
You need to interate through each section
looking for each object
If it's a subreport, then look at it's database tables.


Quote:
> I can iterate through tables of a report & set the DB location at run time
> with

>          For i = 1 To Report.Database.Tables.count
>             Report.Database.Tables(i).Location = gsDBPath &
> "\DB\ReviewDB.mdb"
>          Next i

> but how do I do this for subreports?



Fri, 23 Apr 2004 03:58:15 GMT  
 database location of SubReports
Can I ask how?


Quote:
> You need to interate through each section
> looking for each object
> If it's a subreport, then look at it's database tables.



> > I can iterate through tables of a report & set the DB location at run
time
> > with

> >          For i = 1 To Report.Database.Tables.count
> >             Report.Database.Tables(i).Location = gsDBPath &
> > "\DB\ReviewDB.mdb"
> >          Next i

> > but how do I do this for subreports?



Fri, 23 Apr 2004 05:34:27 GMT  
 database location of SubReports
Hi Michael!



Quote:
> Can I ask how?

yes you can!
                ->your code
                Set ptCRX = New CRAXDRT.Application
                Set ptCRReport = ptCRX.OpenReport(strFile,
crOpenReportByTempCopy)
                ptCRReport.DATABASE.SetDataSource rsResult, 3, 1
                '**********************************************************
            'look for subreport
                For Each ptObj In
ptCRReport.Sections(lngSubRInSec).ReportObjects
                       If ptObj.Kind = crSubreportObject Then
                          Set ptSubReport = ptObj
                          Set ptxReport = ptSubReport.OpenSubreport
                          ptxReport.DATABASE.SetDataSource rsSubQuery, 3, 1
                          Exit For
                       End If
                    Next
                End If

good luck
ConnyHell



Mon, 26 Apr 2004 16:15:29 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to set database location for subreports?

2. Change Database Location in Subreports

3. set location of a database for a subreport

4. Subreports and database location

5. Crystal Subreports Database Tables Location

6. Crystal report - Change SubReport Location

7. subreports datafile location

8. Change subreport DB location at runtime using PE

9. How can I set the table location from VB6 to a subreports in runtime

10. Subreport db location... (again ;-) )

11. Changing Subreport location

12. Specifying Subreports location By Code

 

 
Powered by phpBB® Forum Software