Strona 1 z 2
Filtr po atrybucie na FS/FSE
: 15 lis 2019, 15:15
autor: Lukas
Cześć,
mam dodany atrybut na dokumentach FS/FSE. Oczywiście jest możliwe wyszukiwanie na zakładce "znajdź" po tym atrybucie, natomiast trwało by to dłużej aniżeli filtr na liście. Numer id atrybutu mam, natomiast przydałby się filtr. Z poprzednich tematów po filtrach niestety nie mogę wywnioskować jak taki filtr powinien wyglądać. Pomoże ktoś? Z góry dzięki

Re: Filtr po atrybucie na FS/FSE
: 18 lis 2019, 10:36
autor: Gc12ch
Np tak
Kod: Zaznacz cały
Trn_GidNumer IN (select Trn_Gidnumer from cdn.tranag join cdn.Atrybuty On Trn_Gidtyp = Atr_Obityp and Trn_GidNumer = Atr_ObiNumer where Atr_AtkID="Tutaj ID atrybutu")
pozdrawiam
Greg
Re: Filtr po atrybucie na FS/FSE
: 18 lis 2019, 14:15
autor: Misek
można też tak:
@PAR ?@S20|Atr|Wartość Atrybutu: @? PAR@
exists ( select 1 from cdn.atrybuty where atr_obityp = trn_gidtyp and atr_obinumer = trn_gidnumer and atr_atk = ' tu wstaw ID atrybutu'
and atr_wartosc like '%'+ ??Atr +'%'
Re: Filtr po atrybucie na FS/FSE
: 18 lis 2019, 14:27
autor: Misek
Albo jeszcze bardziej uniwersalnie - wybierasz jaki atrybut chcesz (z listy przypisanych do FS/FSK/FSE/FKE) i jakiej wartości atrybutu szukasz:
@PAR ?@R(select AtK_ID as ID,AtK_Nazwa as [Nazwa Atrybutu] from cdn.AtrybutyKlasy where exists(select 1 from cdn.AtrybutyObiekty where atk_id = AtO_AtKId and AtO_GIDTyp in (2033,2041,2037,2045)))|AtrID|Atrybut:REG= @? PAR@
@PAR ?@S20|Atr|Wartość Atrybutu: @? PAR@
exists ( select 1 from cdn.atrybuty where atr_obityp = trn_gidtyp and atr_obinumer = trn_gidnumer and atr_atk = ??AtrID
and atr_wartosc like '%'+ ??Atr +'%'
Re: Filtr po atrybucie na FS/FSE
: 19 lis 2019, 16:31
autor: Lukas
CZeść,
dzięki za odzew, ten drugi filtr (z wyborem atrybutu i wpisaniem wartości) byłby idealny, gdyby działał. Po wskazaniu atrybutu i wartości atrybutu (która jest na FS) wyskakuje informacja o błędnym filtrze i ma być skasowany. Sam pomysł DOSKONAŁY!
Re: Filtr po atrybucie na FS/FSE
: 19 lis 2019, 16:39
autor: Misek
błąd był w warunku. powinno być tak:
exists ( select 1 from cdn.atrybuty where atr_obityp = trn_gidtyp and atr_obinumer = trn_gidnumer and atr_atkid = ??AtrID
and atr_wartosc like '%'+ ??Atr +'%')
Re: Filtr po atrybucie na FS/FSE
: 21 lis 2019, 09:46
autor: Lukas
A masz może kolumnę, która wyświetli mi konkretny atrybut na liście tych dokumentów? To też by było przydatne. Dziękuję z góry.
Re: Filtr po atrybucie na FS/FSE
: 21 lis 2019, 14:48
autor: Misek
Proszę bardzo:
Kod: Zaznacz cały
select isnull(atr_wartosc,'') as [nazwa wyświetlanej kolumny] from cdn.tranag (nolock) left join cdn.atrybuty (nolock)
on Atr_ObiTyp = TrN_GIDTyp and Atr_ObiNumer = TrN_GIDNumer and Atr_AtkId = 'tu wpisz ID atrybutu'
where {filtrsql}
Re: Filtr po atrybucie na FS/FSE
: 29 lis 2019, 10:54
autor: Lukas
Hej,
a jeszcze takie pytanie, czy jest opcja by w wyszukiwarce po atrybucie wskazać zakres? Czyli np. Atrybut ma wartość liczbową i są tam wpisane atrybuty 1,2,3,4.... a następnie w filtrze wpisuję 5-10 i pokazuje mi dokumenty z atrybutem 5,6,7,8,9,10 ?
Re: Filtr po atrybucie na FS/FSE
: 04 gru 2019, 09:52
autor: Misek
Kod: Zaznacz cały
@PAR ?@R(select AtK_ID as ID,AtK_Nazwa as [Nazwa Atrybutu] from cdn.AtrybutyKlasy where exists(select 1 from cdn.AtrybutyObiekty where atk_id = AtO_AtKId and AtO_GIDTyp in (2033,2041,2037,2045) and AtK_Typ = 3))|AtrID|Atrybut:REG= @? PAR@
@PAR ?@N7.4|Wart|Wartość:REG=0 @? @RH(999999) PAR@
@PAR ?@N7.4|tol|Tolerancja:REG=0 @? @RH(999999) PAR@
exists ( select 1 from cdn.atrybuty where atr_obityp = trn_gidtyp and atr_obinumer = trn_gidnumer and atr_atkid = ??AtrID
and atr_wartosc Between ??Wart - ??tol and ??Wart + ??tol)