1

Konu: Excele Gönderilen Kayıtlara Otomatik Filter..

arkadaşlar kayıtları excell ortamına aktardığımızda, Veri/Filitre uygulama/Otomatik filitre uygula  işlemini kullanıcı yapmadan foxpro ile nasıl yapabilirim.Kullanıcılardan bu işlemi bile yapamayan:( kişiler oluyor.hazır gelsin istiyorum.Tüm arkadaşlara teşekkür ederim.

En büyük sermaye nakit,nakit sermaye vakittir...

2

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

Visual Fox Pro
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
SET SAFETY off

local oExcel
 
SELECT * FROM (_samples+'data\customer') INTO CURSOR CrsExcel
COPY TO sys(5)+CURDIR()+[CrsExcel] TYPE XLS
 
oExcel=createobject("excel.application")
        oExcel.Application.ScreenUpdating = .F.
        oExcel.workbooks.open(sys(5)+CURDIR()+[CrsExcel])
        oExcel.visible=.t.
 
oExcel.range("a1").select && basliklar a1 de kabul ediyoruz
 
dimension SUTUN(254)  && alansayilarinin karsiligi icin harf tanimlari
SUTUN(1)="A"
SUTUN(2)="B"
SUTUN(3)="C"
SUTUN(4)="D"
SUTUN(5)="E"
SUTUN(6)="F"
SUTUN(7)="G"
SUTUN(8)="H"
SUTUN(9)="I"
SUTUN(10)="J"
SUTUN(11)="K"
SUTUN(12)="L"
SUTUN(13)="M"
SUTUN(14)="N"
SUTUN(15)="O"
SUTUN(16)="P"
SUTUN(17)="Q"
SUTUN(18)="R"
SUTUN(19)="S"
SUTUN(20)="T"
SUTUN(21)="U"
SUTUN(22)="V"
SUTUN(23)="W"
SUTUN(24)="X"
SUTUN(25)="Y"
SUTUN(26)="Z"
SUTUN(27)="AA"
SUTUN(28)="AB"
SUTUN(28)="AC"
SUTUN(29)="AD"
SUTUN(30)="AE"
SUTUN(31)="AF"
SUTUN(32)="AG"
SUTUN(33)="AH"
SUTUN(34)="AI"
SUTUN(35)="AJ"
SUTUN(36)="AK"
SUTUN(37)="AL"
SUTUN(38)="AM"
SUTUN(39)="AN"
SUTUN(40)="AO"
SUTUN(41)="AP"
SUTUN(42)="AQ"
SUTUN(43)="AR"
SUTUN(44)="AS"
SUTUN(45)="AT"
SUTUN(46)="AU"
SUTUN(47)="AV"
SUTUN(48)="AW"
SUTUN(49)="AX"
SUTUN(40)="AY"
SUTUN(50)="AZ"
SUTUN(51)="BA"
SUTUN(52)="BB"
SUTUN(53)="BC"
SUTUN(54)="BD"
SUTUN(55)="BE"
SUTUN(56)="BF"
SUTUN(57)="BG"
SUTUN(58)="BH"
SUTUN(59)="BI"
SUTUN(60)="BJ"
SUTUN(61)="BK"
SUTUN(62)="BL"
SUTUN(63)="BM"
SUTUN(64)="BN"
SUTUN(65)="BO"
SUTUN(66)="BP"
SUTUN(67)="BQ"
SUTUN(68)="BR"
SUTUN(69)="BS"
SUTUN(70)="BT"
SUTUN(71)="BU"
SUTUN(72)="BV"
SUTUN(73)="BW"
SUTUN(74)="BX"
SUTUN(75)="BY"
SUTUN(76)="BZ"
SUTUN(77)="CA"
SUTUN(78)="CB"
SUTUN(79)="CC"
SUTUN(80)="CD"
SUTUN(81)="CE"
SUTUN(82)="CF"
SUTUN(83)="CG"
SUTUN(84)="CH"
SUTUN(85)="CI"
SUTUN(86)="CJ"
SUTUN(87)="CK"
SUTUN(88)="CL"
SUTUN(89)="CM"
SUTUN(90)="CN"
SUTUN(91)="CO"
SUTUN(92)="CP"
SUTUN(93)="CQ"
SUTUN(94)="CR"
SUTUN(95)="CS"
SUTUN(96)="CT"
SUTUN(97)="CU"
SUTUN(98)="CV"
SUTUN(99)="CW"
SUTUN(100)="CX"
SUTUN(101)="CY"
SUTUN(102)="CZ"
SUTUN(103)="DA"
SUTUN(104)="DB"
SUTUN(105)="DC"
SUTUN(106)="DD"
SUTUN(107)="DE"
SUTUN(108)="DF"
SUTUN(109)="DG"
SUTUN(110)="DH"
SUTUN(111)="DI"
SUTUN(112)="DJ"
SUTUN(113)="DK"
SUTUN(114)="DL"
SUTUN(115)="DM"
SUTUN(116)="DN"
SUTUN(117)="DO"
SUTUN(118)="DP"
SUTUN(119)="DQ"
SUTUN(120)="DR"
SUTUN(121)="DS"
SUTUN(122)="DT"
SUTUN(123)="DU"
SUTUN(124)="DV"
SUTUN(125)="DW"
SUTUN(126)="DX"
SUTUN(127)="DY"
SUTUN(128)="DZ"
SUTUN(129)="EA"
SUTUN(130)="EB"
SUTUN(131)="EC"
SUTUN(132)="ED"
SUTUN(133)="EE"
SUTUN(134)="EF"
SUTUN(135)="EG"
SUTUN(136)="EH"
SUTUN(137)="EI"
SUTUN(138)="EJ"
SUTUN(139)="EK"
SUTUN(140)="EL"
SUTUN(141)="EM"
SUTUN(142)="EN"
SUTUN(143)="EO"
SUTUN(144)="EP"
SUTUN(145)="EQ"
SUTUN(146)="ER"
SUTUN(147)="ES"
SUTUN(148)="ET"
SUTUN(149)="EU"
SUTUN(150)="EV"
SUTUN(151)="EW"
SUTUN(152)="EX"
SUTUN(153)="EY"
SUTUN(154)="EZ"
SUTUN(155)="FA"
SUTUN(156)="FB"
SUTUN(157)="FC"
SUTUN(158)="FD"
SUTUN(159)="FE"
SUTUN(160)="FF"
SUTUN(161)="FG"
SUTUN(162)="FH"
SUTUN(163)="FI"
SUTUN(164)="FJ"
SUTUN(165)="FK"
SUTUN(166)="FL"
SUTUN(167)="FM"
SUTUN(168)="FN"
SUTUN(169)="FO"
SUTUN(170)="FP"
SUTUN(171)="FQ"
SUTUN(172)="FR"
SUTUN(173)="FS"
SUTUN(174)="FT"
SUTUN(175)="FU"
SUTUN(176)="FV"
SUTUN(177)="FW"
SUTUN(178)="FX"
SUTUN(179)="FY"
SUTUN(180)="FZ"
SUTUN(181)="GA"
SUTUN(182)="GB"
SUTUN(183)="GC"
SUTUN(184)="GD"
SUTUN(185)="GE"
SUTUN(186)="GF"
SUTUN(187)="GG"
SUTUN(188)="GH"
SUTUN(189)="GI"
SUTUN(190)="GJ"
SUTUN(191)="GK"
SUTUN(192)="GL"
SUTUN(193)="GM"
SUTUN(194)="GN"
SUTUN(195)="GO"
SUTUN(196)="GP"
SUTUN(197)="GQ"
SUTUN(198)="GR"
SUTUN(199)="GS"
SUTUN(200)="GT"
SUTUN(201)="GU"
SUTUN(202)="GV"
SUTUN(203)="GW"
SUTUN(204)="GX"
SUTUN(205)="GY"
SUTUN(206)="GZ"
SUTUN(207)="HA"
SUTUN(208)="HB"
SUTUN(209)="HC"
SUTUN(210)="HD"
SUTUN(211)="HE"
SUTUN(212)="HF"
SUTUN(213)="HG"
SUTUN(214)="HH"
SUTUN(215)="HI"
SUTUN(216)="HJ"
SUTUN(217)="HK"
SUTUN(218)="HL"
SUTUN(219)="HM"
SUTUN(220)="HN"
SUTUN(221)="HO"
SUTUN(222)="HP"
SUTUN(223)="HQ"
SUTUN(224)="HR"
SUTUN(225)="HS"
SUTUN(226)="HT"
SUTUN(227)="HU"
SUTUN(228)="HV"
SUTUN(229)="HW"
SUTUN(230)="HX"
SUTUN(231)="HY"
SUTUN(232)="HZ"
SUTUN(233)="IA"
SUTUN(234)="IB"
SUTUN(235)="IC"
SUTUN(236)="ID"
SUTUN(237)="IE"
SUTUN(238)="IF"
SUTUN(239)="IG"
SUTUN(240)="IH"
SUTUN(241)="II"
SUTUN(242)="IJ"
SUTUN(243)="IK"
SUTUN(244)="IL"
SUTUN(245)="IM"
SUTUN(246)="IN"
SUTUN(247)="IO"
SUTUN(248)="IP"
SUTUN(249)="IQ"
SUTUN(250)="IR"
SUTUN(251)="IS"
SUTUN(252)="IT"
SUTUN(253)="IU"
SUTUN(253)="IV"
 
oExcel.range( 'A1:'+SUTUN(FCOUNT())+'1').select  && sutun sayisi kadar secim yapildi
 
oExcel.selection.autofilter && selectiona gore otomatik filtre yapildi
 
oExcel.Columns().AutoFit && kolonlar otomatik olarak boyutlandırıldı
oExcel.range("a2").select && a2 de konumlan
oExcel.Application.ScreenUpdating = .T.
oExcel=.null.
http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

3

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

soykanozcelik üsdadım teşekkür ederim

En büyük sermaye nakit,nakit sermaye vakittir...

4

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

Sütun tanımları yapmadan da bu işi şu şekilde yapabilirsin.

Visual Fox Pro
1

2
3
oExcel.range( 'A1:'+SUTUN(FCOUNT())+'1').select  && sutun sayisi kadar secim yapildi

*!* yerine
oExcel.Range(Cells(1, 1), Cells(1, FCount())).Select
/o---------------------o\
     www.haser.com
\o---------------------o/

5

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

Haklısın Tarkan,
dimension ile ilgili kısım da kod cok uzun daha pratik yolu var ama kolayda bu kod vardi diye not dusecektim unutmusum smile

http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

6

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

kısaltılmıs halini e yayınlayalim bari smile

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SET SAFETY off

local oExcel
 
SELECT * FROM (_samples+'data\customer') INTO CURSOR CrsExcel
COPY TO sys(5)+CURDIR()+[CrsExcel] TYPE XLS
 
oExcel=createobject("excel.application")
        oExcel.Application.ScreenUpdating = .F.
        oExcel.workbooks.open(sys(5)+CURDIR()+[CrsExcel])
        oExcel.visible=.t.
 
oExcel.range("a1").select && basliklar a1 de kabul ediyoruz
 
oExcel.Range(Cells(1, 1), Cells(1, FCount())).Select
 
oExcel.selection.autofilter && selectiona gore otomatik filtre yapildi
 
oExcel.Columns().AutoFit && kolonlar otomatik olarak boyutlandırıldı
oExcel.range("a2").select && a2 de konumlan
oExcel.Application.ScreenUpdating = .T.
oExcel=.null.
http://www.soykansoft.com/images/twitter.jpghttp://www.soykansoft.com/images/wp.jpghttp://www.soykansoft.com/images/blogger.jpg

7

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

Visual Fox Pro
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
43
44
45
46
47
48
*** Constant Group: XlAutoFilterOperator

#Define xlAnd                                             1
#Define xlBottom10Items                                   4
#Define xlBottom10Percent                                 6
#Define xlOr                                              2
#Define xlTop10Items                                      3
#Define xlTop10Percent                                    5
 
Local oExcel
oExcel = Createobject("Excel.Application")
With oExcel
  .WorkBooks.Add
  .Visible = .T.
  With .ActiveWorkBook.ActiveSheet
    * Customer tablosunu Excel'e gonder
    * Datayi B5'den itibaren yerlestir
    VFP2Excel(_samples+'data\testdata.dbc','select * from customer',.Range('B5'))
 
    * Country alan indexini al
    Use (_samples+'data\customer') In 0
    Afields(aFieldList,'customer')
    Use In 'customer'
    lnFieldIndex = Ascan(aFieldList,'country',1,-1,1,1+2+4+8)
 
    * Country = 'UK' or Country < 'Germany' filtrele
    .Range('B5').AutoFilter(m.lnFieldIndex,"UK",xlOr,"<Germany")
 
  Endwith
Endwith
 
Function VFP2Excel
  Lparameters tcDataSource, tcSQL, toRange
  Local loConn As AdoDB.Connection, ;
    loRS As AdoDB.Recordset,;
    ix
  loConn = Createobject("Adodb.connection")
  loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+m.tcDataSource
  loConn.Open()
  loRS = loConn.Execute(m.tcSQL)
 
  For ix=1 To loRS.Fields.Count
    toRange.Offset(0,m.ix-1).Value = Proper(loRS.Fields(m.ix-1).Name)
    toRange.Offset(0,m.ix-1).Font.Bold = .T.
  Endfor
  toRange.Offset(1,0).CopyFromRecordSet( loRS )
  loRS.Close
  loConn.Close
Endfunc
Yen yaz 1907'ye yolla FB gelsin evinde yensin.
(sonra salaklar ciksin alin terine şike desin)

8

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

AH BIR EXCEL A GONDEREBILSEM

BEN DAHA EXCEL A GONDEREMIYORUM KI

9

Re: Excele Gönderilen Kayıtlara Otomatik Filter..

Senin gondermene gerek yok, kod gonderiyor zaten.

Yen yaz 1907'ye yolla FB gelsin evinde yensin.
(sonra salaklar ciksin alin terine şike desin)