IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Lotus Notes Discussion :

NotesViewColumn déterminer le type de la colonne


Sujet :

Lotus Notes

  1. #1
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut NotesViewColumn déterminer le type de la colonne
    Hello

    je coince sur un truc tout bête, j'ai besoin en Lotus Script de déterminer le type d'une colonne dans une vue (numerique/texte/Date) mais je ne trouve rien qui me donne une info claire et fiable

    une petite idée ?

    Merci

  2. #2
    Membre expérimenté
    Avatar de Jérôme Deniau
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Janvier 2015
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2015
    Messages : 804
    Points : 1 434
    Points
    1 434
    Billets dans le blog
    32
    Par défaut
    Essaie Datatype(la vlauer dans ta colonne de ta vue) de mémoire ça doit le faire.

  3. #3
    Membre averti
    Homme Profil pro
    Consultant Lotus Notes/Domino
    Inscrit en
    Juin 2015
    Messages
    312
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Consultant Lotus Notes/Domino
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2015
    Messages : 312
    Points : 397
    Points
    397
    Par défaut
    Oui je pense aussi que le type de la colonne c'est le type des valeurs dedans.
    Il y a un "type" d'affichage de la colonne, mais c'est une préférence d'affichage, ça ne préfigure probablement pas ce qui est dans la liste des valeurs.

  4. #4
    Membre habitué
    Homme Profil pro
    Geek
    Inscrit en
    Avril 2007
    Messages
    452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France

    Informations professionnelles :
    Activité : Geek

    Informations forums :
    Inscription : Avril 2007
    Messages : 452
    Points : 175
    Points
    175
    Par défaut
    Pas bête le DataType j'y avais pas pensée

    mais j'ai fais autrement, en parsant le XML de la vue

    Public Function ViewColonneType(wvwView As NotesView, wDBtarget As NotesDatabase) As Variant

    Dim Doc As NotesDocument
    Dim exporter As NotesDXLExporter
    Dim XML As String
    Dim vrValue As Variant
    Dim nbUBound As Integer
    Dim i As Integer
    Dim Array () As String
    Dim Decimal As String
    Dim Temp As String

    On Error GoTo CatchError

    ViewColonneType = Null

    If wvwView Is Nothing Then
    Error 9999,"wvwView is Nothing"
    Exit Function
    End If

    If wDBtarget Is Nothing Then
    Error 9999,"wDBtarget is Nothing"
    Exit Function
    End If

    If Session Is Nothing Then
    Set Session = New NotesSession
    End If

    Set Doc = DocSearchByUNID(wvwView.Universalid,wDBtarget,"","")
    If Doc Is Nothing Then
    Error 9999,"Doc is Nothing for UNID : "+wvwView.Universalid
    Exit Function
    End If

    Set exporter = session.CreateDXLExporter
    XML = LCase(exporter.Export(Doc))
    Set Doc = Nothing
    Set exporter = Nothing
    If Trim(XML) = "" Then
    Error 9999,"XML is Empty"
    Exit Function
    End If

    Decimal = ""
    vrvalue = Split(XML,"decimalsym='")
    If IsArray(vrValue) = True Then
    If IsEmpty(vrValue) = False Then
    If UBound(vrValue) > 0 Then
    Decimal = StrLeft(vrValue(1),"'")
    End If
    End If
    End If
    vrValue = Null

    vrValue = Split(XML,"<column ")
    XML = ""
    If IsArray(vrValue) = False Then
    vrValue = Null
    Exit Function
    ElseIf IsEmpty(vrvalue) = True Then
    vrValue = Null
    Exit Function
    End If

    nbUbound = UBound(vrValue)
    If nbUbound < 2 Then
    vrValue = Null
    Exit Function
    End If

    vrValue(0) = ""
    ReDim Array(1 To nbUbound)
    Temp = ""
    For i = 1 To nbUbound
    If InStr(vrValue(i),"datetimeformat") > 0 Then
    If InStr(vrValue(i),"show='datetime'") > 0 Then
    Temp = "DT"
    ElseIf InStr(vrValue(i),"show='date'") > 0 Then
    Temp = "D"
    ElseIf InStr(vrValue(i),"show='time'") > 0 Then
    Temp = "T"
    Else
    Temp = "DT"
    End If
    Array(i) = "D"+";"+Temp
    else
    If InStr(vrValue(i),"numberformat") > 0 Then
    If InStr(vrValue(i),"varying='true'") > 0 Then
    Temp = "V"
    Else
    Temp = StrLeft(StrRight(vrValue(i),"digits='"),"'")
    If Trim(Temp) = "" Then
    Temp = "0"
    End If
    End If
    Array(i) = "N;"+Decimal+";"+Temp
    Temp = ""
    Else
    Array(i) = "T"
    End If
    End if
    Temp = ""
    Next
    vrValue = Null
    ViewColonneType = Array
    Erase Array

    Exit Function
    CatchError:
    MsgBox "("+Structure_Log+" : "+Cstr(GetThreadInfo (1))+" Call by "+Cstr(GetThreadInfo(10))+")"+Chr(10)+"Error " + CStr(Err) + " : "+Chr(10) + CStr(Error)+". "+Chr(10)+"Line # "+Cstr(Erl),16," ERROR !"
    ViewColonneType = Null
    Exit Function
    End Function

Discussions similaires

  1. Réponses: 5
    Dernier message: 28/05/2015, 14h38
  2. Changer le type d'une colonne
    Par Poisson59 dans le forum Oracle
    Réponses: 2
    Dernier message: 06/12/2005, 13h59
  3. [Débutant] Changer le type d'une colonne
    Par david71 dans le forum MS SQL Server
    Réponses: 8
    Dernier message: 08/11/2005, 11h26
  4. Déterminer le type d'une class dérivée
    Par LDDL dans le forum MFC
    Réponses: 3
    Dernier message: 10/12/2004, 17h36
  5. [struts] déterminer le type Mime d'un fichier
    Par k4eve dans le forum Struts 1
    Réponses: 4
    Dernier message: 14/06/2004, 10h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo