1. Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies. En savoir plus.
  2. Bonjour tout le monde ! Veillez consulter la Politique de forum pour comprendre nos règles, Merci a vous !
    Rejeter la notice

AIDE [Résolu] WD: Printing from a Html control

Discussion dans 'Windev' créé par DirkPitt, Déc 3, 2018.

  1. DirkPitt

    DirkPitt Member

    Inscrit:
    Jan 8, 2018
    Messages:
    59
    J'aime reçus:
    16
    Hello to all /Bonjour

    Is there a method to print from an Html ctrl from windev, without push the right mouse button and select the print function?

    I have discovered the "ExecuteJS" method and i was trying to insert the JS code in a button in the window, like:

    PrintButton code:
    Code (Windev):
    JSCode is string = [
    "window.print()";
    ]
    ExecuteJS(HTM_MyHTMLControl, JSCode)
    but unfortunately the contents of the Html ctrl is not printed. I'm on windev not webdev..

    What i'm doing wrong?

    Tips and tricks are appreciated...

    Dirk
     
    Tags:
  2. DirkPitt

    DirkPitt Member

    Inscrit:
    Jan 8, 2018
    Messages:
    59
    J'aime reçus:
    16
    Hello to all

    Problem Solved!!

    the "window.print()"; must be written WITHOUT the "" characters.. :)
    so it is:
    Code (Windev):
    JSCode is string = [
    window.print();
    ]
    ExecuteJS(HTM_MyHTMLControl, JSCode)
    .......

    Thanks for the attention... :)

    Dirk
     
    suenodesign et joker aiment ça.
  3. popoy

    popoy Well-Known Member
    MEMBRE WX

    Inscrit:
    Fev 23, 2018
    Messages:
    2,884
    J'aime reçus:
    1,532
    Pour information il est aussi possible de lancer une procédure wlangage a partir du champ HTML
    WL.Execute(<Nom procédure WLangage>, <Paramètres>)
    voir :

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!


    et

    Bonjour visiteur, Merci de vous Inscrire ou de vous connectez pour voir les liens!


    il est donc possible de lancer un État avec son aperçu.
     
    joker apprécie ceci.

Partager cette page

Chargement...