Exportar a excel registros sin duplicar
Publicado por Karen (34 intervenciones) el 22/12/2016 17:35:09
Hola buen día!
Podrian ayudarme con una exportacion a excel,
pasa que tengo este código:
Pero quiero colocar algún filtro, como el distinct del sql o algo parecido, que solo me de los nombres de los empleados pero sin repetir, porque me manda todos, algo asi :

Please!!
Podrian ayudarme con una exportacion a excel,
pasa que tengo este código:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
&RutaFisica=GetPathApp.Udp()+"Formatos"+GetSlash.Udp()
&RutaExportar=GetPathApp.Udp()+"Exportar"+GetSlash.Udp()
&Random = Random() * 10000
&Archivo=&RutaFisica+"Confianza.xlsx"
&File.Source=&Archivo.Trim()
if &File.Exists()
&ArchivoExporta=!"Confianza"+&Fecha.Trim()+"R"+&Random.ToString().Trim()+!".xlsx"
&Exporta=&RutaExportar.Trim()+&ArchivoExporta
&File.Copy(&Exporta)
&ExcelDocument.Open(&Exporta)
if &ExcelDocument.ErrCode<>0
&Mensaje=&ExcelDocument.ErrDescription
&ExcelDocument.Close()
else
&CellRow = 7
For Each
Order ReporteArea,ReporteTrabaiador
where ReporteArea like &ReporteArea when not &ReporteArea.IsEmpty()
Where ReporteTrabaiador Like &ReporteTrabaiador when not &ReporteTrabaiador.IsEmpty()
&CellRow += 1
&ExcelDocument.Cells(&CellRow, &FirstColumn + 1).Number = ReporteId
&ExcelDocument.Cells(&CellRow, &FirstColumn + 2).Number = ReporteClave
&ExcelDocument.Cells(&CellRow, &FirstColumn + 5).Text = ReportePuesto
&ExcelDocument.Cells(&CellRow, &FirstColumn + 3).Text = ReporteTrabaiador
&ExcelDocument.Cells(&CellRow, &FirstColumn + 4).Number = 14
EndFor
EndIf
&ExcelDocument.Save()
&ExcelDocument.Close()
&UrlExporta=GetUrlApp.Udp()+"Exportar"+GetSlash.Udp()+&ArchivoExporta
Link(&UrlExporta)
Endif
Pero quiero colocar algún filtro, como el distinct del sql o algo parecido, que solo me de los nombres de los empleados pero sin repetir, porque me manda todos, algo asi :

Please!!
Valora esta pregunta


0