Estimado Carles
Los ejemplos de TWeb Master no funcionan con libharbour.dll de Mercury
Version 1.3
Process execute 08/26/21 06:06:55 (2 msec.)
Error
Proc. file C:/Apache24/htdocs/tweb/browse.prg
Error (1) Unknown or unregistered symbol
Operation HB_COMPILEFROMBUF
Subsystem BASE/6101
Trace ReplaceBlocks
Block
0001 // {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
Error Code LoadHrb( 'lib/tweb/tweb.hrb' )
// {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
#define PATH_DATA HB_GetEnv( "PRGPATH" ) + '/data/'
#include {% TWebInclude() %}
REQUEST HB_CODEPAGE_ES850
REQUEST HB_LANG_ESWIN
REQUEST DBFCDX
function main(op)
local o, oCol, oWeb, oBrw, cAlias
local aRows := {}
local cStyle := cHtml:= cfooter:=''
USE ( PATH_DATA + 'proyectos.dbf' ) NEW SHARED
INDEX ON field->code TAG "code" FOR field->SALDO>0 MEMORY
cAlias := Alias()
while !Eof()
Aadd( aRows, { 'code' => UHtmlEncode( (cAlias)->code ) ,;
'proyecto' => UHtmlEncode( (cAlias)->proyecto ) ,;
'responsabl' => UHtmlEncode( (cAlias)->responsabl ) ,;
'costo' => (cAlias)->costo ,;
'saldo' => (cAlias)->saldo })
(cAlias)->( dbskip() )
end
CLOSE
DEFINE WEB oWeb TITLE 'Adm. Condominios' TABLES INIT
TEXT TO cStyle ECHO
<head>
<html lang="es">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/admcon.ico" type="image/x-icon">
<link rel="shortcut icon" href="admcon.ico" type="image/x-icon">
<title>Adm. Condominios</title>
</head>
ENDTEXT
Banner()
DEFINE FORM o ID 'Proyectos'
INIT FORM o
DEFINE BROWSE oBrw ID 'ringo' HEIGHT 350 OF o
ADD oCol TO oBrw ID 'code' HEADER 'COD.'
ADD oCol TO oBrw ID 'proyecto' HEADER 'PROYECTO'
ADD oCol TO oBrw ID 'responsabl' HEADER 'RESPONSABLE'
ADD oCol TO oBrw ID 'costo' HEADER 'COSTO'
ADD oCol TO oBrw ID 'saldo' HEADER 'SALDO'
INIT BROWSE oBrw DATA aRows
END FORM o
TEXT TO cfooter ECHO
<div class="container">
<center><a href="javascript: history.go(-1)">Volver</a></center>
<br>
<a href="https://adhemarcr.github.io/acrsoft/"> <img
src="images/lAcrSoft.jpg" align="left"> <br> Soluciones Informáticas
</a>
</div>
</div>
ENDTEXT
retu nil
function Banner()
TEXT TO cHtml ECHO
<div class="container">
<a href="javascript: history.go(-1)">Volver</a>
<center><b><h5>P R O Y E C T O S</h5></b></center>
</div>
ENDTEXT
return
Return
ADD oCol TO oBrw ID 'saldo' HEADER 'SALDO'
acuellar wrote:
Cómo se hace para dar formato numérico PICTURE "@Z 99,999.99" a una columna?.
REQUEST DBFCDX
REQUEST DBFFPT
function main
local cAlias, nI
local aRows := {}
local cRows
USE ( 'c:\www\htdocs\tweb-master\data\test.dbf' ) SHARED NEW VIA 'DBFCDX'
cAlias := Alias()
for nI := 1 to 100
Aadd( aRows, { 'first' => rtrim( (cAlias)->first ) ,;
'last' => rtrim( (cAlias)->last ) ,;
'age' => rtrim(STR( (cAlias)->age ) ) })
(cAlias)->( dbskip() )
next
USE
cRows := hb_jsonencode(aRows)
TEMPLATE PARAMS cRows
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css">
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<style>
.fixed-height {
height: 240px;
overflow-y: auto;
}
</style>
</head>
<body>
<br> <br>
<div class="container ">
<div class="fixed-table-container fixed-height" style="height: 400px; padding-bottom: 35.5938px;">
<table id="table" data-show-footer="true">
<thead>
<tr>
<th data-field="first" data-footer-formatter="firstFormatter" data-sortable="true">First</th>
<th data-field="last" data-sortable="true">Last</th>
<th data-field="age" class="text-center">Age</th>
</tr>
</thead>
</table>
</div>
</div>
<script>
function firstFormatter() {
return 'Total'
}
var $table = $('#table')
$(function() {
var data = <?prg return cRows ?>
$table.bootstrapTable({data: data})
})
</script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.js"></script>
</body>
</html>
ENDTEXT
return
//----------------------------------------------------------------------------//
INIT PROCEDURE PrgInit
SET CENTURY ON
SET EPOCH TO YEAR(DATE())-98
SET DELETED ON
SET EXCLUSIVE OFF
REQUEST HB_Lang_DE
HB_LangSelect("DE")
SET DATE TO GERMAN
rddsetdefault( "DBFCDX" )
EXTERN DESCEND
RETURN
//----------------------------------------------------------------------------//
acuellar wrote:Muchas gracias Carles
Lo logré.
Cómo se activa el FOOTER del BROWSE
Gracias por su tiempo y ayuda.
Users browsing this forum: No registered users and 1 guest