![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
02/06/2004, 15:58
|
![Avatar de jrp01](http://static.forosdelweb.com/customavatars/avatar65768_1.gif) | | | Fecha de Ingreso: mayo-2004 Ubicación: México
Mensajes: 2.702
Antigüedad: 20 años, 8 meses Puntos: 0 | |
ya intente lo que me pusiste y si el igual que el codigo que tengo si me regresa los registros pero al mandarlos al crystal no solo me regresa el primero. este esta en un subreporte y el codigo que utilizo es :
sent1 = "select cotizacion.idcotizacion, cotizacion.ant,cotizacion.preciocot,cotizacion.mon eda,vendedor.nomvendedor,cliente.nomcliente,client e.domcliente,cliente.cdcliente,cliente.telcliente, Enc_Pie_Cot.Encabezado, Enc_Pie_Cot.Pie,tempcot.reparacion"
sent2 = " from carrocerias,tempcot,cotizacion ,vendedor ,cliente, Enc_Pie_Cot where cotizacion.idcotizacion=" & Text1(0) & " and vendedor.idvendedor=" & Idvendedor & " and cliente.idcliente = '" & Text1(1) & "'" & " and Enc_Pie_Cot.IdEmpresa=1 and carrocerias.idcarroceria=" & idCarroceria & " and tempcot.idcotizacion=" & Text1(0)
sentencia = sent1 & sent2
Set rs = cn.Execute(sentencia)
sentencia = "select tempcotcarr.cantidad,tempcotcarr.descripcionconcep ,tempcotcarr.Precio,tempcotcarr.moneda from tempcotcarr where idcotizacion=" & Text1(0)
Set RsSR1 = cn.Execute(sentencia)
sentencia = "select DescripcionConcep from configuraciones where idempresa=1"
Set RsSr2 = cn.Execute(sentencia)
Set crpApplication = CreateObject("crystal.crpe.application")
Set crpReport = crpApplication.OpenReport(App.Path & "\Cotizacion_Rep.rpt")
Set crpDatabase = crpReport.Database
Set crpTables = crpDatabase.Tables
Set crpTable = crpTables.Item(1)
Call crpTable.SetPrivateData(3, rs)
'############# SubReportes #################
Set CrSections = crpReport.Sections
For X = 1 To CrSections.Count
Set CrSection = CrSections.Item(X)
Set CrReportObjs = CrSection.ReportObjects
For Y = 1 To CrReportObjs.Count
If CrReportObjs.Item(Y).Kind = crSubreportObject Then
If nosubrep = 0 Then
Set CrSubreportObj = CrReportObjs.Item(Y)
Set CrSubreportObj = CrReportObjs.Item(Y)
Set CrSubreport = crpReport.OpenSubreport(CrReportObjs(Y).Name)
Set crpDatabase = CrSubreport.Database
Set crpTables = crpDatabase.Tables
Set crpTable = crpTables.Item(1)
Call crpTable.SetPrivateData(3, RsSR1)
nosubrep = 1
Else
If nosubrep = 1 Then
Set CrSubreportObj = CrReportObjs.Item(Y)
Set CrSubreportObj = CrReportObjs.Item(Y)
Set CrSubreport = crpReport.OpenSubreport(CrReportObjs(Y).Name)
Set crpDatabase = CrSubreport.Database
Set crpTables = crpDatabase.Tables
Set crpTable = crpTables.Item(1)
Call crpTable.SetPrivateData(3, RsSr2) ' este es el que no funciona
End If
End If
End If
Next
Next
'###########################################
'Se dan los parámetros de la presentanción previa del reporte
crpReport.Preview " Cotización", 0, 0, 800, 600, 524288 Or 16777216 Or 268435456
Última edición por jrp01; 02/06/2004 a las 15:59 |