BUG SC V. 8.00.0041 Header/Footer unable to call databases

Hi,

after the header/footer calls in pdf-reports are enabled, I tried to select a fields from another table,
which results in an error message:

Fehler
Undefined variable: field_state_id
Fehler
Undefined property: Header_Footer::$Db
Fatal error: Call to a member function Execute() on a non-object in C:\Program Files\NetMake\v8\wwwroot\scriptcase\app\AppName\pdfreport_test2\pdfreport_test2_head_foot.php on line 32

The code snip of “Selecting fields from another table” is NOT working, ending in such an error message within on_header and on_footer event. The other events it is working …

BR

Eric

Is not a bug, you just can’t do database statements in this events

According to the docs you can use sc_select in a grid onfooter/onheader. So it looks like a bug to me.

Ex. 2: The SQL command can passed as application fields (local variables) or of global variables.
sc_select(dataset,“select price order from order where clientId = ‘{clientId}’ and cod_Seller = [var_glo_seller]”);

Note: The command must always be finished with semicolon";".
on grid:
onClick
onClick
onFooter <=
onGroupBy
onHeader <=
onNavigate
onRecord
onScriptInit

[QUOTE=aducom;35939]According to the docs you can use sc_select in a grid onfooter/onheader. So it looks like a bug to me.

Ex. 2: The SQL command can passed as application fields (local variables) or of global variables.
sc_select(dataset,“select price order from order where clientId = ‘{clientId}’ and cod_Seller = [var_glo_seller]”);

Note: The command must always be finished with semicolon";".
on grid:
onClick
onClick
onFooter <=
onGroupBy
onHeader <=
onNavigate
onRecord
onScriptInit[/QUOTE]

Yes you are true. Usually I don’t use this events, and I was in mobile when answered. I just did a quick search on webhelp and this confused me:
“onHeader- This event is executed immediately before displaying the grid header. Use this event to print some calculated value in the header for example.”

Now I’m in front of my SC, yes, this macros are available (green) and docs speaks about scope like you pointed.

Just an info, I corrected my starting post. Was not talking of grid, but from pdfreport.