PDF Include and Dynamic Temp-Table

pmoyano

New Member
Hi:

I need help with PDF_Include and I’ Hope you can help me.

My problem is trying to use Dynamics Temp-Tables to make a pdf file.

Here is the code i use:

{pdf_inc.i "NOT SUPER"}
DEF VAR tt-Preview AS WIDGET-HANDLE.
DEF VAR bh-Preview AS HANDLE.
/* */
CREATE TEMP-TABLE tt-Preview.
tt-Preview:ADD-NEW-FIELD("campo1", "INTEGER", 0, "9999", "", "Codigo", "Codigo").
tt-Preview:ADD-NEW-FIELD("campo2", "CHARACTER", 0, "X(20)", "", "Nombre", "Nombre").
tt-Preview:TEMP-TABLE-PREPARE("Preview").
bh-Preview = tt-Preview:DEFAULT-BUFFER-HANDLE.

bh-Preview:BUFFER-CREATE.
/* Fill temp-table */
/* .... */
/* .... */
RUN pdf_new IN h_PDFinc ("Report","c:\PruebaReport3.pdf").
RUN pdf_set_parameter IN h_PDFinc("Report","Compress","TRUE").
/* Don't want the table to be going until the end of the page or too near the side */
RUN pdf_set_LeftMargin IN h_PDFinc("Report",20).
RUN pdf_set_BottomMargin IN h_PDFinc("Report",50).
RUN pdf_tool_add IN h_PDFinc ("Report","Reporte", "TABLE", bh-Preview:TABLE-HANDLE).
/* Now Setup some Parameters for the Table */
RUN pdf_tool_create IN h_PDFinc ("Report","Reporte").
RUN pdf_close IN h_PDFinc("Report").

When i’m open de pdf file gives my this error:

Unknown distintive ‘??’ (“Distintivo Desconocido” in spanish)

It’s Work fine if i use a non dynamic temp-table. :confused::confused:

Any help?

Thanks.
 
I just tested with the sample table.p from pdf_include and that gives no problem with a dynamic temp-table. The temp-table is already handled dynamically by pdftool.p, so there should not be any difference.
One thing I don't understand is why you use hBuffer:table-handle and not just tt-preview which is the table-handle....

The error you get translates to "unknown symbol" BTW (if anyone wants to know.. :-)).

Are you sure that you fill the static temp-table you tested with exact the same data as the dynamic temp-table?

Casper.
 
Casper:

Thanks, your answer makes me think.... hahaha. :blush1:

The problem was with the ADD-NEW-FIELD method on the creation of my dynamic Temp-Table, a bad "Format-Exp" Definition of a field.

You also were rigth about "hBuffer:table-handle".:biggrin:

Pablo.
 
Back
Top