Xbrowse to Html

Xbrowse to Html

Postby Silvio.Falconi » Thu Oct 06, 2022 6:56 am

Code: Select all  Expand view
Menuitem "Save as Html" ACTION oGrid:ToHTML()


Why ask me a Spreadsheet software ?
and if the user not have Excel or Openoffice or another spreadsheet cannot converte the xbrowse datas into html ?

and with oBrw:ToHtml() anyway I couldn't

for the header and for the cells, set the font, style, space, background color, text color


I tested
Code: Select all  Expand view

Function testHtml(oDbf)
    HB_MEMOWRIT( "cust.html", oDbf:FW_DbfToHTML() )
   ShellExecute( 0, "Open", "cust.html" )
   return nil
 


and seem run ok

But I cannot change the styles , where I found FW_DbfToHTML ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Otto » Thu Oct 06, 2022 7:39 am

Silvio, I am really happy to see you at the HTML path.
Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6006
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse to Html

Postby Silvio.Falconi » Thu Oct 06, 2022 8:49 am

Otto wrote:Silvio, I am really happy to see you at the HTML path.
Regards,
Otto


only to converte xbrowse "lotto" into html because someone ask me it
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Antonio Linares » Thu Oct 06, 2022 9:23 am

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbrowse to Html

Postby Silvio.Falconi » Thu Oct 06, 2022 9:28 am




I have only been back to work at school for three days, I can go down the stairs but I cannot go up them, to go up I use the elevator


I tested

Function testHtml(oDbf)
HB_MEMOWRIT( "cust.html", oDbf:FW_DbfToHTML() )
ShellExecute( 0, "Open", "cust.html" )
return nil

but I couldn't

for the header and for the cells, set the font, style, space, background color, text color
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Silvio.Falconi » Thu Oct 06, 2022 10:43 am

Antonio, Otto
I made a test only in five minutes, not use Bootstrap only css

Image

Code: Select all  Expand view

 

 


#include "fivewin.ch"

// NO USe Bootstrap  only css


Function DbfToHtml()
local cTxt,y,astruct


USE CUSTOMER  ALIAS CUST

astruct := CUST->( DBSTRUCT() )


cTxt ="<HTML>"+CRLF
cTXT+="<title>"+Alias()+"</title>"+CRLF
cTXT+="<!-- style css-->"+CRLF
cTXT+="<style>                               "+CRLF
cTXT+=" #customers {                                 "+CRLF
cTXT+="  font-family: Arial, Helvetica, sans-serif;  "+CRLF
cTXT+="  border-collapse: collapse;                  "+CRLF
cTXT+="  width: 100%;                                "+CRLF
cTXT+="}                                             "+CRLF
cTXT+=" #customers td, #customers th {               "+CRLF
cTXT+="  border: 1px solid #ddd;                     "+CRLF
cTXT+="  padding: 2px;                               "+CRLF
cTXT+="}                                             "+CRLF
cTXT+="  #customers tr:nth-child(even){background-color: #f2f2f2;}  "+CRLF
cTXT+="                                                             "+CRLF
cTXT+="  #customers tr:hover {background-color: #ddd;}              "+CRLF
cTXT+="   #customers th {                                           "+CRLF
cTXT+="   padding-top: 12px;                                        "+CRLF
cTXT+="   padding-bottom: 12px;                                     "+CRLF
cTXT+="   text-align: left;                                         "+CRLF
cTXT+="   background-color: #04AA6D;                                "+CRLF
cTXT+="   color: white;                                             "+CRLF
cTXT+="  }                                                          "+CRLF
cTXT+="</style>                               "+CRLF
cTXT+="<!-- style css-->"+CRLF


cTXT+="<BODY>                  "+CRLF

cTXT+="<h1>"+Alias()+"</h1>    "+CRLF


cTXT+="<!-- responsive on -->"+CRLF
cTXT+="<div style='overflow-x:auto;'> "+CRLF

cTXT+="<table id='customers'>  "+CRLF
cTXT+="  <thead>                  "+CRLF

      For i= 1 to Len(astruct)
         cTXT+="    <th>" + astruct[i][1] + "</th>     "+CRLF
        next
    cTXT+="  </thead                 "+CRLF

   do while !eof()
     cTxt+="<tr>"+CRLF
           for y=1 to fcount()
             cTxt+="<td>"+cValToChar(fieldget( y ))+"</td>"+CRLF
           next
         cTxt+="</tr>"+CRLF
    dbskip()
enddo
cTxt+="</table>"+CRLF
cTXT+="<!-- responsive off -->"+CRLF
cTxt+="</div> "+CRLF
cTxt+="</BODY>"+CRLF+"</HTML>"+CRLF



HB_MEMOWRIT( "cust.html", cTxt )
ShellExecute( 0, "Open", "cust.html" )
return nil















 


of course you can select the size with
padding: 2px; I put 8px
Last edited by Silvio.Falconi on Fri Oct 07, 2022 7:19 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Marc Venken » Thu Oct 06, 2022 12:23 pm

Silvio,

some years ago i made html the old way, but I had total control of all elements, like you prefere.
I used Dreanweaver or any program that edit html and I made a design there, including visual and tables. I than looked at the code and implemeted this into FWcode like below.

The top lines of the html file you can put into a small file and read this file before usinf fw code. that changes for every record.

//=========================
cFile = "c:\maveco\website\catalog.htm"
FCatalog := FCREATE(cFile)
FWRITE(FCatalog, MEMOREAD("c:\maveco\html\catbase.htm") + chr(10) ) // This file contains the first lines of the html file that are always the same.
// from here the FWcode to generate html


You may consider this...

Code: Select all  Expand view

Function CreateOneHtmlPag()  // Dbf is already open !!

   cFile = "c:\maveco\website\html\maveco folder\pag"+alltrim(fotoinde->code)+".htm"
   Fzoeken := FCREATE(cFile)

   FWRITE(Fzoeken,  "<html>" + chr(10)  )
   FWRITE(Fzoeken,  "<head>" + chr(10) )
   FWRITE(Fzoeken,  '<title>'+alltrim(fotoinde->titel)+'</title>' + chr(10))
   FWRITE(Fzoeken,  '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'  + chr(10))
   FWRITE(Fzoeken,  '</HEAD> ' + chr(10))
   FWRITE(Fzoeken,  '<body bgcolor="#FFFFFF" text="#000000" background="../../Internet%20Sources/Achtergrond.jpg" leftmargin="30">' + chr(10))

   FWRITE(Fzoeken,  '<table width="600" border="1" cellspacing="5" cellpadding="0"> ' + chr(10))
   FWRITE(Fzoeken,  '<tr>' + chr(10))
   FWRITE(Fzoeken,  '<td colspan="4"> ' + chr(10))
   FWRITE(Fzoeken,  '<div align="center"><font color="#0000FF"><b><font size="5">'+alltrim(fotoinde->titel) +'</font></b></font></div> ' + chr(10))
   FWRITE(Fzoeken,  '</td> ' + chr(10))
   FWRITE(Fzoeken,  '</tr> ' + chr(10))
   FWRITE(Fzoeken,  '<tr>' + chr(10))
   FWRITE(Fzoeken,  '<td width="140" height="99">  ' + chr(10))
   FWRITE(Fzoeken,  '<div align="center"><font color="#0000FF" size="5">'+alltrim(fotoinde->code)+'</font></div> ' + chr(10))
   FWRITE(Fzoeken,  '</td> ' + chr(10))
   FWRITE(Fzoeken,  '<td colspan="3" valign="top" height="77">' + chr(10))
   aText = formatMemo("FOTOPAG",fotoinde->info)
   FWRITE(Fzoeken,  '<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">' + chr(10))
   for mTel = 1 to Len(aText)
      FWRITE(Fzoeken,  alltrim(aText[mTel])+'<br>' + chr(10))
   next
   FWRITE(Fzoeken,  '</font></p> ' + chr(10))
   FWRITE(Fzoeken,  '</td> ' + chr(10))
   FWRITE(Fzoeken,  '</tr> ' + chr(10))

   fotodata->(dbseek(fotoinde->code))
   aInfo:={"","","",""} // 4 lege velden
   aPic150:={"","","",""}
   aPic400:={"","","",""}
   aHtmlFoto150:={"","","",""}
   aHtmlFoto400:={"","","",""}
   aHtmlArtNr :={"","","",""}
   aHtmlNom1 :={"","","",""}
   aHtmlNom2 :={"","","",""}
   nPosPag = 1
   do while fotodata->code = fotoinde->code
      if  empty(fotodata->artikel_nr)
          fotodata->(dbskip())
          loop
      endif
      artikel->(dbseek(fotodata->artikel_nr))
      if artikel->(rlock())
         artikel->fotopag = fotoinde->code
         artikel->online  = "PAG "+fotoinde->code
         artikel->(dbunlock())
      endif
      aPic150[nPosPag] = "c:\pictures\web150\"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg"
      aPic400[nPosPag] = "
c:\pictures\web400\"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg"
      if file(aPic150[nPosPag])
           cTarget = lower("
c:\maveco\website\pictures\"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg")
           copy file &(aPic150[nPosPag])  to &cTarget
      endif
      if file(aPic400[nPosPag])
           cTarget = lower("
c:\maveco\website\pictures\b"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg")
           copy file &(aPic400[nPosPag])  to &cTarget
      endif
      aHtmlFoto150[nPosPag] = '"
../../images/'+lower(substr(artikel->artikel_nr,1,3))+lower(substr(artikel->artikel_nr,5,2))+lower(substr(artikel->artikel_nr,8,2))+'.jpg" '
      //aHtmlFoto400[nPosPag] = "
'../../images/b"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg' "
      aHtmlArtNr[nPosPag] = lower(fotodata->artikel_nr)
      aHtmlNom1[nPosPag] = left(fotodata->benaming,25)
      aHtmlNom2[nPosPag] = substr(fotodata->benaming,26)
      aHtmlArtNr[nPosPag] = fotodata->artikel_nr

      nPosPag ++
      if nPosPag = 5 .or. fotodata->code <> fotoinde->code
         FWRITE(Fzoeken,  '<tr> ' + chr(10))
            for mDat = 1 to 4
               FWRITE(Fzoeken,  '<td width="
160" height="140"> ' + chr(10))
                  FWRITE(Fzoeken,  '<div align="
center">' + chr(10))
                  FWRITE(Fzoeken,  '<a href="
../../zoekindex.php?loc=zoekdetail&pcode=true&perform_query=true&pcode_query=' + lower(alltrim(aHtmlArtNr[mDat])) + '">' + chr(10))
                  FWRITE(Fzoeken,  '<img src=' + lower(aHtmlFoto150[mDat]) + ' alt="
Klik om te vergroten" border = "0" vspace="5" hspace="5" align="top" ></a></div>' + chr(10))
//                  FWRITE(Fzoeken,  '<font size="
1">' + chr(10))
//                  FWRITE(Fzoeken,  alltrim(aHtmlNom1[m])+'<br>'+ chr(10))
//                  FWRITE(Fzoeken,  alltrim(aHtmlNom2[m])+ chr(10))
//                  FWRITE(Fzoeken,  '<br><b><font size="
2">' + chr(10))
//                  FWRITE(Fzoeken,  alltrim(aHtmlArtNr[m]) + chr(10))
//                  FWRITE(Fzoeken,  '</b></font></div>' + chr(10))
               FWRITE(Fzoeken,  '</td> ' + chr(10))
            next
         FWRITE(Fzoeken,  '</tr> ' + chr(10))
         FWRITE(Fzoeken,  '<tr> ' + chr(10))
            for mDat = 1 to 4
               if empty(aHtmlArtNr[mDat])
                  FWRITE(Fzoeken,  '<td width="
160" height="26" > ' + chr(10))
               else
                  FWRITE(Fzoeken,  '<td width="
160" height="26" bgcolor="#72B8B8"> ' + chr(10))
               endif
                  FWRITE(Fzoeken,  '<div align="
center">' + chr(10))
//                  FWRITE(Fzoeken,  '<a href="
../../zoekindex.php?loc=zoekdetail&pcode=true&perform_query=true&pcode_query=' + alltrim(aHtmlArtNr[m]) + '">' + chr(10))
//                  FWRITE(Fzoeken,  '<img src=' + aHtmlFoto150[m] + ' alt="
Klik om te vergroten" border = "0" vspace="5" hspace="5" align="top" ></a> <br>' + chr(10))
                  FWRITE(Fzoeken,  '<b><font size="
2">' + chr(10))
                  FWRITE(Fzoeken,  lower(alltrim(aHtmlArtNr[mDat]))+'<br>' + chr(10))
                  FWRITE(Fzoeken,  '</b><font size="
1">' + chr(10))
                  FWRITE(Fzoeken,  alltrim(aHtmlNom1[mDat])+'<br>'+ chr(10))
                  FWRITE(Fzoeken,  alltrim(aHtmlNom2[mDat])+ chr(10))
                  FWRITE(Fzoeken,  '</font></div>' + chr(10))
            next
         FWRITE(Fzoeken,  '</tr> ' + chr(10))
         nPosPag = 1
         aInfo:={"
","","",""} // 4 lege velden
         aPic150:={"
","","",""}
         aPic400:={"
","","",""}
         aHtmlFoto150:={"
","","",""}
         aHtmlFoto400:={"
","","",""}
         aHtmlArtNr :={"
","","",""}
         aHtmlNom1 :={"
","","",""}
         aHtmlNom2 :={"
","","",""}
         endif
      fotodata->(dbskip())
   enddo
   FWRITE(Fzoeken,  '</table>' + chr(10))
   FWRITE(Fzoeken,  '</body>' + chr(10))
   FWRITE(Fzoeken,  '</html>' + chr(10))
   fClose(fZoeken)
return


Result something like this :

Image
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse to Html

Postby Marc Venken » Thu Oct 06, 2022 12:25 pm

To late for my post ))))) :lol: :lol:
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse to Html

Postby Silvio.Falconi » Thu Oct 06, 2022 1:49 pm

Marc Venken wrote:Silvio,

some years ago i made html the old way, but I had total control of all elements, like you prefere.
I used Dreanweaver or any program that edit html and I made a design there, including visual and tables. I than looked at the code and implemeted this into FWcode like below.

The top lines of the html file you can put into a small file and read this file before usinf fw code. that changes for every record.

//=========================
cFile = "c:\maveco\website\catalog.htm"
FCatalog := FCREATE(cFile)
FWRITE(FCatalog, MEMOREAD("c:\maveco\html\catbase.htm") + chr(10) ) // This file contains the first lines of the html file that are always the same.
// from here the FWcode to generate html


You may consider this...

Code: Select all  Expand view

Function CreateOneHtmlPag()  // Dbf is already open !!

   cFile = "c:\maveco\website\html\maveco folder\pag"+alltrim(fotoinde->code)+".htm"
   Fzoeken := FCREATE(cFile)

   FWRITE(Fzoeken,  "<html>" + chr(10)  )
   FWRITE(Fzoeken,  "<head>" + chr(10) )
   FWRITE(Fzoeken,  '<title>'+alltrim(fotoinde->titel)+'</title>' + chr(10))
   FWRITE(Fzoeken,  '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'  + chr(10))
   FWRITE(Fzoeken,  '</HEAD> ' + chr(10))
   FWRITE(Fzoeken,  '<body bgcolor="#FFFFFF" text="#000000" background="../../Internet%20Sources/Achtergrond.jpg" leftmargin="30">' + chr(10))

   FWRITE(Fzoeken,  '<table width="600" border="1" cellspacing="5" cellpadding="0"> ' + chr(10))
   FWRITE(Fzoeken,  '<tr>' + chr(10))
   FWRITE(Fzoeken,  '<td colspan="4"> ' + chr(10))
   FWRITE(Fzoeken,  '<div align="center"><font color="#0000FF"><b><font size="5">'+alltrim(fotoinde->titel) +'</font></b></font></div> ' + chr(10))
   FWRITE(Fzoeken,  '</td> ' + chr(10))
   FWRITE(Fzoeken,  '</tr> ' + chr(10))
   FWRITE(Fzoeken,  '<tr>' + chr(10))
   FWRITE(Fzoeken,  '<td width="140" height="99">  ' + chr(10))
   FWRITE(Fzoeken,  '<div align="center"><font color="#0000FF" size="5">'+alltrim(fotoinde->code)+'</font></div> ' + chr(10))
   FWRITE(Fzoeken,  '</td> ' + chr(10))
   FWRITE(Fzoeken,  '<td colspan="3" valign="top" height="77">' + chr(10))
   aText = formatMemo("FOTOPAG",fotoinde->info)
   FWRITE(Fzoeken,  '<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">' + chr(10))
   for mTel = 1 to Len(aText)
      FWRITE(Fzoeken,  alltrim(aText[mTel])+'<br>' + chr(10))
   next
   FWRITE(Fzoeken,  '</font></p> ' + chr(10))
   FWRITE(Fzoeken,  '</td> ' + chr(10))
   FWRITE(Fzoeken,  '</tr> ' + chr(10))

   fotodata->(dbseek(fotoinde->code))
   aInfo:={"","","",""} // 4 lege velden
   aPic150:={"","","",""}
   aPic400:={"","","",""}
   aHtmlFoto150:={"","","",""}
   aHtmlFoto400:={"","","",""}
   aHtmlArtNr :={"","","",""}
   aHtmlNom1 :={"","","",""}
   aHtmlNom2 :={"","","",""}
   nPosPag = 1
   do while fotodata->code = fotoinde->code
      if  empty(fotodata->artikel_nr)
          fotodata->(dbskip())
          loop
      endif
      artikel->(dbseek(fotodata->artikel_nr))
      if artikel->(rlock())
         artikel->fotopag = fotoinde->code
         artikel->online  = "PAG "+fotoinde->code
         artikel->(dbunlock())
      endif
      aPic150[nPosPag] = "c:\pictures\web150\"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg"
      aPic400[nPosPag] = "
c:\pictures\web400\"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg"
      if file(aPic150[nPosPag])
           cTarget = lower("
c:\maveco\website\pictures\"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg")
           copy file &(aPic150[nPosPag])  to &cTarget
      endif
      if file(aPic400[nPosPag])
           cTarget = lower("
c:\maveco\website\pictures\b"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg")
           copy file &(aPic400[nPosPag])  to &cTarget
      endif
      aHtmlFoto150[nPosPag] = '"
../../images/'+lower(substr(artikel->artikel_nr,1,3))+lower(substr(artikel->artikel_nr,5,2))+lower(substr(artikel->artikel_nr,8,2))+'.jpg" '
      //aHtmlFoto400[nPosPag] = "
'../../images/b"+substr(artikel->artikel_nr,1,3)+substr(artikel->artikel_nr,5,2)+substr(artikel->artikel_nr,8,2)+".jpg' "
      aHtmlArtNr[nPosPag] = lower(fotodata->artikel_nr)
      aHtmlNom1[nPosPag] = left(fotodata->benaming,25)
      aHtmlNom2[nPosPag] = substr(fotodata->benaming,26)
      aHtmlArtNr[nPosPag] = fotodata->artikel_nr

      nPosPag ++
      if nPosPag = 5 .or. fotodata->code <> fotoinde->code
         FWRITE(Fzoeken,  '<tr> ' + chr(10))
            for mDat = 1 to 4
               FWRITE(Fzoeken,  '<td width="
160" height="140"> ' + chr(10))
                  FWRITE(Fzoeken,  '<div align="
center">' + chr(10))
                  FWRITE(Fzoeken,  '<a href="
../../zoekindex.php?loc=zoekdetail&pcode=true&perform_query=true&pcode_query=' + lower(alltrim(aHtmlArtNr[mDat])) + '">' + chr(10))
                  FWRITE(Fzoeken,  '<img src=' + lower(aHtmlFoto150[mDat]) + ' alt="
Klik om te vergroten" border = "0" vspace="5" hspace="5" align="top" ></a></div>' + chr(10))
//                  FWRITE(Fzoeken,  '<font size="
1">' + chr(10))
//                  FWRITE(Fzoeken,  alltrim(aHtmlNom1[m])+'<br>'+ chr(10))
//                  FWRITE(Fzoeken,  alltrim(aHtmlNom2[m])+ chr(10))
//                  FWRITE(Fzoeken,  '<br><b><font size="
2">' + chr(10))
//                  FWRITE(Fzoeken,  alltrim(aHtmlArtNr[m]) + chr(10))
//                  FWRITE(Fzoeken,  '</b></font></div>' + chr(10))
               FWRITE(Fzoeken,  '</td> ' + chr(10))
            next
         FWRITE(Fzoeken,  '</tr> ' + chr(10))
         FWRITE(Fzoeken,  '<tr> ' + chr(10))
            for mDat = 1 to 4
               if empty(aHtmlArtNr[mDat])
                  FWRITE(Fzoeken,  '<td width="
160" height="26" > ' + chr(10))
               else
                  FWRITE(Fzoeken,  '<td width="
160" height="26" bgcolor="#72B8B8"> ' + chr(10))
               endif
                  FWRITE(Fzoeken,  '<div align="
center">' + chr(10))
//                  FWRITE(Fzoeken,  '<a href="
../../zoekindex.php?loc=zoekdetail&pcode=true&perform_query=true&pcode_query=' + alltrim(aHtmlArtNr[m]) + '">' + chr(10))
//                  FWRITE(Fzoeken,  '<img src=' + aHtmlFoto150[m] + ' alt="
Klik om te vergroten" border = "0" vspace="5" hspace="5" align="top" ></a> <br>' + chr(10))
                  FWRITE(Fzoeken,  '<b><font size="
2">' + chr(10))
                  FWRITE(Fzoeken,  lower(alltrim(aHtmlArtNr[mDat]))+'<br>' + chr(10))
                  FWRITE(Fzoeken,  '</b><font size="
1">' + chr(10))
                  FWRITE(Fzoeken,  alltrim(aHtmlNom1[mDat])+'<br>'+ chr(10))
                  FWRITE(Fzoeken,  alltrim(aHtmlNom2[mDat])+ chr(10))
                  FWRITE(Fzoeken,  '</font></div>' + chr(10))
            next
         FWRITE(Fzoeken,  '</tr> ' + chr(10))
         nPosPag = 1
         aInfo:={"
","","",""} // 4 lege velden
         aPic150:={"
","","",""}
         aPic400:={"
","","",""}
         aHtmlFoto150:={"
","","",""}
         aHtmlFoto400:={"
","","",""}
         aHtmlArtNr :={"
","","",""}
         aHtmlNom1 :={"
","","",""}
         aHtmlNom2 :={"
","","",""}
         endif
      fotodata->(dbskip())
   enddo
   FWRITE(Fzoeken,  '</table>' + chr(10))
   FWRITE(Fzoeken,  '</body>' + chr(10))
   FWRITE(Fzoeken,  '</html>' + chr(10))
   fClose(fZoeken)
return


Result something like this :

Image


I wanted only a HTML from xbrowse or dbf with the possibility to set font and colore for header and Cell
On the next week i made a Easy function because with fw_dbftohtml() you cannot set anything
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Antonio Linares » Thu Oct 06, 2022 2:15 pm

Dear Silvio,

fw_dbftohtml() is a function, not a method. Don't call it as a method.

Please review the example that I pointed you to

Please do it this way:
Code: Select all  Expand view
USE CUSTOMER
   HB_MEMOWRIT( "c:\fwh\samples\cust.html", FW_DbfToHTML() )
   ShellExecute( 0, "Open", "c:\fwh\samples\cust.html" )
   return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbrowse to Html

Postby Silvio.Falconi » Thu Oct 06, 2022 6:48 pm

Antonio Linares wrote:Dear Silvio,

fw_dbftohtml() is a function, not a method. Don't call it as a method.

Please review the example that I pointed you to

Please do it this way:
Code: Select all  Expand view
USE CUSTOMER
   HB_MEMOWRIT( "c:\fwh\samples\cust.html", FW_DbfToHTML() )
   ShellExecute( 0, "Open", "c:\fwh\samples\cust.html" )
   return nil



Antonio,

I allready tested it I want to set some things: ( need and ask from customer)

1. the name of the window
2. the name of the schedule ( name list on html)
3. the Font character of the header
4. the font of the cells
5. the height of the header (normal or bold)
6. the height of the cells (normal or bold)
7. the space of both the header and the cells (padding)
8. the color of the header border
9 the color of the cell border
10. the background color
11. the color of the text
12. create a responsive html web page

the FW_DbfToHTML () function doesn't do these things ( it create a webpage with css from bootstrap )
and the oBrw: toHtml () method of xbrowse class won't work if you don't have spreadsheet software installed on your computer
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Antonio Linares » Fri Oct 07, 2022 6:30 am

Dear Silvio,

https://www.w3schools.com/html/html_tables.asp

time to learn some HTML my friend :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbrowse to Html

Postby Silvio.Falconi » Fri Oct 07, 2022 6:57 am

Antonio Linares wrote:Dear Silvio,

https://www.w3schools.com/html/html_tables.asp

time to learn some HTML my friend :-)



I know well the html language, php, flash java, javascript , wordpress, joomla and other

since I have been working at school for thirty-five years and for about twenty I have been creating websites and portals,

do I have to list the sites that I have created?

indeed , that little program I created above I did it in just five minutes in pure html and css without using gimmicks such as bootstrap

maybe someone else needs to learn html language, certainly not me

If you look closely at my script (posted above) it is very different from yours

1. I don't use bootstrap
2 is responsive
3 when you hover the mouse over the records light up
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse to Html

Postby Antonio Linares » Fri Oct 07, 2022 7:14 am

Dear Silvio,

my apologizes, I missunderstood you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Xbrowse to Html

Postby Silvio.Falconi » Fri Oct 07, 2022 7:34 am

Antonio Linares wrote:Dear Silvio,

my apologizes, I missunderstood you


Dear Antonio,

I don't love the Internet but I use it to work,

I don't like making websites and web portals but I do it to work, I am very opposed to having an internet application on a browser because I would face many risks, one of all not having to work due to of the connection missing.

I see it every day at school, the secretaries of my institute all use government applications that are exclusively on the internet but that day when for one reason or another the internet does not work, the secretaries remain with their arms crossed and do nothing .

If you do not have an application that works locally you cannot work well, unfortunately in my reality the internet is an incogita when you think that there is a connection here that the connection is blocked for days and what you do you stay still until the connection returns ?

the customer to whom I am doing the lotto program has had a serious problem, it is not possible to have the program update as the programmer who created the software died due to covid about a year ago

and I used some of my old lottery procedures to create something that looks like the software the customer had
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests

cron