1. Yolanda Moreno
  2. PowerBuilder
  3. Wednesday, 18 July 2018 14:29 PM UTC
Hi, 

I don't know how to access to compute field in the trailer group. 

The group is repeated several times and each time the computed field of the trailer must take a different value. 
 
The next code doesn't work: 

string         ls_expr, ls_e, ls_value, ls_first, ls_last                         
         
ls_e = dw_tareas_intermedias.object.co_tiempo_parcial_grupo.name + ".expression" 
dw_tareas_intermedias.GroupCalc() 
ls_last = dw_tareas_intermedias.Object.DataWindow.LastRowOnPage 
ls_expr = "evaluate ('" + ls_e + "'," + ls_last + ")" 
ls_value = dw_tareas_intermedias.describe (ls_expr)                 

What is wrong? 

Can somebody help me? 

Sorry for my expression in English. 

Thank you very much. 

regards 

Yolanda 
 
 
 
 
 
Yolanda Moreno Accepted Answer Pending Moderation
  1. Thursday, 19 July 2018 09:02 AM UTC
  2. PowerBuilder
  3. # 1

Hi Miguel,

Thank you very much for your answer.

I have tried that code but it still does not show the computed field, ls_value = "".

I need the computed field 'co_partial_time_group' to be executed for each group. The expression of the computed field is:

'TIEMPO ACTIVIDADES INTERMEDIAS PARA EL TREN ' +  as_tren + ': ' + string (sum( co_duracion_tarea_tren for group 1)) + ' min' 

The computed field 'co_duracion_tarea_tren' has value because it is at the row level of the datawindow, but I can not get the computed field 'co_patrimonio_grupo' to show its value in the group trailer.

I have done the following and it works:

dw_tareas_intermedias.SetTransObject(SQLCA)

dw_tareas_intermedias.Retrieve(as_tren_activo, ngrafico, tdia, anucleo, 0, al_mercado )

dw_tareas_intermedias.Reset()

:-)))))))))

 

Thank you very much again.

 

Regards,

 

Yolanda

Comment
  1. Miguel Leeuwe
  2. Thursday, 19 July 2018 09:19 AM UTC
Can you also paste the code, starting from the retrieve() until the ls_value = ...

?
  1. Helpful
  1. Yolanda Moreno
  2. Thursday, 19 July 2018 12:40 PM UTC
Hi miguel



The problem is already solved. The solution was to add Retrieve.



Thank you very much.



Regards,



Yolanda
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 24 July 2018 00:29 AM UTC
Great, glad it works now.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 18 July 2018 21:57 PM UTC
  2. PowerBuilder
  3. # 2

Hi Yolanda,

 

You don't have to use evaluate() at all to do what you want to do:

Just do:

 

string ls_expr, ls_e, ls_value, ls_first, ls_last

ls_e = dw_tareas_intermedias.object.co_tiempo_parcial_grupo.name + ".expression"
dw_tareas_intermedias.GroupCalc()
ls_last = dw_tareas_intermedias.Object.DataWindow.LastRowOnPage
ls_value = dw_tareas_intermedias.object.co_tiempo_parcial_grupo[long(ls_last)]

 

saludos,

MiguelL.

Comment
  1. Miguel Leeuwe
  2. Wednesday, 18 July 2018 22:01 PM UTC
(you don't have to do "ls_e = ......" either in that case.)



If you want to get the value of a column or computed field in a trailer for example, then you can use any of the rows within that group. So if you have a group trailer with let's say row 3, 4 and 5 of the detail in it, you will get the same value when reading the column with [3], [4] or [5].

No sé si con ésto te he explicado un poco mejor.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.