HTML reports - live preview inside VS Code

HTML reports - live preview inside VS Code

Postby Otto » Thu Jul 29, 2021 4:30 pm

Dear Antonio,

I am testing live preview inside VS Code.

Preview your html files in VS Code itself. Use it to quickly set the html and css right for your webpages.


Do you know it live preview is also working for mod harbour?

Best regards,
Otto


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: HTML reports - live preview inside VS Code

Postby Otto » Fri Jul 30, 2021 6:52 am

easy peasy lemon squeezy

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: HTML reports - live preview inside VS Code

Postby Otto » Fri Jul 30, 2021 7:39 am

add: padding


Code: Select all  Expand view

<TD WIDTH=50%
            ALIGN=RIGHT
            BGCOLOR="#5b9bd5"
            STYLE="padding: 18px;" >
 


Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: HTML reports - live preview inside VS Code

Postby Marc Vanzegbroeck » Fri Jul 30, 2021 8:10 am

Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: HTML reports - live preview inside VS Code

Postby Otto » Fri Jul 30, 2021 8:16 am

Hello Marc,
Yes, this is the function I use.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: HTML reports - live preview inside VS Code

Postby Marc Vanzegbroeck » Sat Jul 31, 2021 11:25 am

Hi,

If I use that Printhtml function, I get a runtime error.

    Application
    ===========
    Path and name: c:\_vmsdata\FWH\Projects\_Test\htmlTabel\TEST.exe (32 bits)
    Size: 1,283,584 bytes
    Time from start: 0 hours 0 mins 0 secs
    Error occurred at: 07/31/21, 13:19:52
    Error description: Error BASE/1004 Message not found: TACTIVEX:DOCUMENT

    Stack Calls
    ===========
    Called from: tobject.prg => TACTIVEX:ERROR(172)
    Called from: tobject.prg => TACTIVEX:MSGNOTFOUND(205)
    Called from: tobject.prg => TACTIVEX:DOCUMENT(0)
    Called from: TEST.PRG => PRINTHTML(57)
    Called from: TEST.PRG => TEST(12)

The line with the error is:

Code: Select all  Expand view
  do while alltrim(oIe:document:readyState) <> 'complete'
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: HTML reports - live preview inside VS Code

Postby Otto » Sat Jul 31, 2021 3:04 pm

Hello Marc,
please send me your source code.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: HTML reports - live preview inside VS Code

Postby Marc Vanzegbroeck » Sat Jul 31, 2021 3:17 pm

Otto,

What is the email adress I can send it to?

Otto wrote:Hello Marc,
please send me your source code.
Best regards,
Otto
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: HTML reports - live preview inside VS Code

Postby Marc Vanzegbroeck » Mon Aug 02, 2021 8:37 pm

Hi;

Thanks to Otto, my test is working.
The problem was that in my testprogram, I didn't opened a window, and directly create an print the html-file.
In a normal program, a window will be open.

Also entering the complete path of the html-file has to done, to made it run.

This is my test-program (with the additional window and path added by Otto)

The function mHTMLtabel() is a funtion I'm creating to generate a HTML-tables.
Until now you can give the size of the table, and the data per field.
It is in a very, very, very early stage of development.
The purpose is also giving the column width, row height, border-type, the font-style, color,... of each cell. Also to merging cells,....


Code: Select all  Expand view
#INCLUDE "fivewin.CH"


function Main(cAufruf)
    local oBtn
    local I             := 0
   local oDlg, oFont,  n, oFontBrw, oBTNSave
   local nWidth   := GetSysMetrics( 0 ) * 2/4
   local nHeight  := GetSysMetrics(1 ) * 3/4
   local cTitle   := "/i zi' pi zi/   ***** Reportgenerator"

    *----------------------------------------------------------





    DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-18
   DEFINE FONT oFontBrw NAME 'TAHOMA' SIZE 0,-26

   DEFINE DIALOG oDlg SIZE nWidth,nHeight PIXEL FONT oFont

   @ 20,20  SAY cTitle OF oDlg PIXEL  FONT oFontBrw


@ ( nHeight - 90 ) / 2.05,nWidth/5/2.05 ;
   FLATBTN oBTNSave ;
   PROMPT "Speichern" ;
   SIZE 2, ( 32 ) /2.05 ;
   OF oDlg ;
   ACTION (  test( ) )

@ ( nHeight - 90 ) / 2.05,nWidth/5/2.05+100 ;
   FLATBTN oBTNSave ;
   PROMPT "Abbruch" ;
   SIZE 2, ( 32 ) /2.05 ;
   OF oDlg ;
   ACTION (oDlg:End())

ACTIVATE DIALOG oDlg CENTERED


    RELEASE FONT oFont

    return (0)

//----------------------------------------------------------------------------//





FUNCTION test()
     Local aHoogte := {10,10,10,10,40,10,10,10,10,10}
     local aBreedte := {50,50,50,50,100,50,50}
     local aTekst := {{1,2,3,4,5,6,7},{11,12,13,14,15,16,17},{21,22,23,24,25,26,27},{31,32,33,34,35,36,37},{41,42,43,44,45,46,47},{51,52,53,54,55,56,57},{61,62,63,64,65,66,67},{71,72,73,74,75,76,77},{81,82,83,84,85,86,87},{91,92,93,94,95,96,97}}
     local vhtml
     vhtml = mHTMLtabel(aHoogte,aBreedte,aTekst)

     memowrit('C:\_vmsdata\FWH64\projects\_test\printhtml\test.html',vhtml)

     PrintHtml('C:\_vmsdata\FWH64\projects\_test\printhtml\test.html',1,.t.)

RETURN





//----------------------------------------------------------------------------//
#Define OLECMDID_PRINT                  6
#Define OLECMDEXECOPT_PROMPTUSER        1
#Define OLECMDEXECOPT_DONTPROMPTUSER    2
#Define OLECMDID_ENABLE_INTERACTION     36
#Define OLECMDID_PRINTPREVIEW           7
#Define OLECMDID_SAVEAS                 4
#Define OLECMDID_PAGESETUP              8
#Define OLECMDID_CUT                    11      //Shear
#Define OLECMDID_NEW                    2       //Create a new document
#Define OLECMDID_EXITFULLSCREEN          81
#Define OLECMDID_SAVE                   3       //Preservation

#Define OLECMDID_SETTITLE               28      //Fehler
#Define OLECMDID_ZOOM                   19

// enable print background and images in IE

function PrintHtml ( cHtmlOrUrl, nCopies,lShow )
    static  oIe, oWnd, oPrn
    local i
    *----------------------------------------------------------

    default lShow:=.f.,nCopies:=1

    oIe = TActiveX():New( NIL, "Shell.Explorer" )

    oIe:Do( "Navigate2", cHtmlOrUrl)

    do while alltrim(oIe:document:readyState) <> 'complete'
    sysrefresh()
    waitseconds(.5)
    enddo

    if lshow

    oIe:Do( "ExecWB", OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER, OLECMDID_PAGESETUP, OLECMDID_CUT  )

    else
    for i=1 to nCopies
    msgwait('Printing large receipt (' + alltrim(str(i)) + ' of '+alltrim(str(nCopies))+' copies).',,2)
    oIe:Do( "ExecWB", OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER )
    next i
    endif

    sysrefresh()
    oIe:end()
RETURN nil
//----------------------------------------------------------------------------//

func mHTMLtabel(aHoogte,aBreedte,aTekst)
 local vHTML := ''
 local vrij
 local vkol

 vHTML += '<HTML><TABLE border="1">'+ CRLF
 FOR vrij = 1 to len(aHoogte)

    vHTML += '<TR style="height: '+alltrim(str(aHoogte[vrij],10,0))+'px;">'+CRLF
    FOR vkol = 1 to len(aBreedte)
       IF valtype(atekst[vrij,vkol]) = 'N'
       vHTML += '<TD style="width: '+str(aBreedte[vkol],10,5)+'px;">&nbsp;'+str(atekst[vrij,vkol])+'</TD>'+CRLF
       ELSEIF valtype(atekst[vrij,vkol]) = 'C'
       vHTML += '<TD style="width: '+str(aBreedte[vkol],10,5)+'px;">&nbsp;'+atekst[vrij,vkol]+'</TD>'+CRLF
       ELSE
       vHTML += '<TD style="width: '+str(aBreedte[vkol],10,5)+'px;">&nbsp;</TD>'+CRLF
       ENDIF
    NEXT vkol
    vHTML += '</TR>'+CRLF
 NEXT vrij
 vHTML += '</TABLE></HTML>'+CRLF

return vHTML

//----------------------------------------------------------------------------//
 
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests