Skip to Content
0
Former Member
Apr 01, 2011 at 07:11 AM

V6 and CR XI R2 Subreports

19 Views

Good morning everyone.

Sorry for my English is not very good.

I have a poroblem with Subreports me explain.

Work with vb6 and crystal reports XI R2, I create a report with Subreports which are linked, when the bonds I create a parameter like this Pm-Comando.AboCodi. When I run the crystal reports works well and I do not give me problems but when I run and passed the data when you open asks me to enter the value of the command.

Not to do so they do not ask me and I go all right.

The code I use in vb6 is this.

Sql = "SELECT abogados.* from abogados"

Set rsComm = New Recordset

rsComm.CursorLocation = adUseClient

rsComm.Open Sql, Conexion, adOpenStatic, adLockOptimistic, adCmdText

'Sql1 = "SELECT aboct.* from aboct"

Sql1 = "select abogados., aboct. from abogados inner join aboct on abogados.abocodi = aboct.ctcodi"

Set rsComm1 = New Recordset

rsComm1.CursorLocation = adUseClient

rsComm1.Open Sql1, Conexion, adOpenStatic, adLockOptimistic, adCmdText

Dim crApp As New CRAXDDRT.Application

Dim crRep As New CRAXDDRT.Report

Set crRep = crApp.OpenReport("C:\InformeSub2.rpt", 1)

crRep.FieldMappingType = crAutoFieldMapping

crRep.OpenSubreport("InformeSub3").FieldMappingType = crAutoFieldMapping

crRep.Database.Tables(1).SetDataSource rsComm, 3

crRep.OpenSubreport("InformeSub3").Database.Tables(1).SetDataSource rsComm1, 3

OfrmRep.Caption = "titulo"

OfrmRep.CRViewer1.ReportSource = crRep

OfrmRep.CRViewer1.DisplayGroupTree = False

OfrmRep.CRViewer1.ViewReport

Took 2 weeks behind this problem and can not find the solution.

Please can someone help me.

Thank you very much to all.