0

Word Template Problem

let vTbl := ((select 'EAT Documentos') order by Areas);
let vObj := vTbl.{
        vTotal: sum((select 'EAT Documentos').Presupuesto),
        vFGst: format('Fecha Real 5', "DD.MM.YYYY"),
        vDoc: Documentos,
        vHrs: Horas,
        vPres: format(Presupuesto, "€ #,##0.00"),
        vAreas: text(Areas),
        vCatArr: let xAreas := Areas;
        vTbl[Areas = xAreas].Areas,
        vSum: let yAreas := Areas;
        sum(vTbl[Areas = yAreas].Presupuesto)
    };
let xArr := [{}][null];
let xObj := {};
for i from 0 to cnt(vObj) do
    xObj := item(vObj, number(i));
    if i = 0 then
        setItem(xObj, "vSkip", 1);
        if item(vObj, number(i)).text(vCatArr) != item(vObj, number(i + 1)).text(vCatArr) then
            setItem(xObj, "vSkipSum", 3)
        end;
        xArr := array(xArr, [xObj])
    else
        if item(vObj, number(i - 1)).text(vCatArr) = item(vObj, number(i)).text(vCatArr) then
            setItem(xObj, "vSkip", 0);
            if item(vObj, number(i)).text(vCatArr) != item(vObj, number(i + 1)).text(vCatArr) then
                setItem(xObj, "vSkipSum", 3)
            end;
            xArr := array(xArr, [xObj])
        else
            setItem(xObj, "vSkip", 1);
            if item(vObj, number(i)).text(vCatArr) != item(vObj, number(i + 1)).text(vCatArr) then
                setItem(xObj, "vSkipSum", 3)
            end;
            xArr := array(xArr, [xObj])
        end
    end
end;
let pJson := {
        pName: "Planta Separacion de Liquidos - Rio Grande",
        pTbl: xArr
    };
'Reporte Areas' := importFile(this, printAndSaveRecord(this, "Areas-SumPresupuesto", pJson), "PrintOut.pdf");
alert(" Reporte Generado Exitosamente")

I need place in the report the vTotal in the Report "Word Template" The total presupuesto.

I don't know where place it.

4 replies

null
    • Fred
    • 13 days ago
    • Reported - view

    Here is an example from Carbone.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 13 days ago
      • Reported - view

       

      Hi Fred Thanks.

      The result of my report is this, but need the sum of my all total Areas. The are group by Areas.

      • Fred
      • 13 days ago
      • Reported - view

      Have you tried creating a row at the end that has vTotal in it?

      • Rafael Sanchis
      • Rafael_Sanchis
      • 13 days ago
      • Reported - view

       You are right. 👍 Thanks