BaBernd
14th December 2016, 18:01
Hello to All,

within a function I'll execute a select on table cprrp041 (is not necessarily important which table). In the selectdo area the function tccom.dll0010.print.record(1) transfers the record set to a report.
But I also like to transfer a calculated variable (here cal.week) within this selectdo area to the report. But it doesn't. I also tried the export()-function within the selectdo, but I haven't also no success.
Does anyone has an idea how I can join the result of the variable with the record set for transfer.

Here an example of my problem:
function long print.production.order.selection()
{
select cprrp041.*
from cprrp041
where cprrp041.koor = 3
selectdo
cal.week = val(sprintf$("%u(%02W)",cprrp041.date) |* calculated calendar week
tccom.dll0010.print.record( 1 ) |* record set transfer
endselect
}

Best Regards
Bernd

mark_h
14th December 2016, 21:59
Did you add the field to the report? I know in 4c4 we use print record in a few programs which are in our version of tccomdll010 which does I think the same thing. I am assuming you use the open.report and point it to the correct report.

hklett
14th December 2016, 23:03
As Marc mentioned you have to make this field as an input field in your report.
Did you declare this variable as extern?

BaBernd
15th December 2016, 12:10
I also added this field in the "input fields..." for the report, before. But I've got the error
"Process xx - Fatal Error: process xx: mv_symbols error: INCOMPATIBLE TYPES: (cal.week LONG|ARRAY|EXTERN|NO_ALLOC_MEM, cal.week LONG|EXTERN)
Process xx - Fatal Error: Can not continue in rtisfc0401010010 in DLL: ottstprepdll (r.main)[handle.report.pool]"

So I've thought to export and import the variable value. But with that methode I've got no values into the report.

Solution:
when I've created the input field I set the depth = 2. I've mixed it with the Domain property "Digits before Decimal = 2"
Now I've changed the value "depth = 0". The INCOMPATIBLE TYPES-Error doesn't occur. And the values will be correctly transferred to the report.

Thanks a lot for your help. Therefore I've recognized that I'm on the wrong track with my thread "joining record set and variable". Problem was the wrong defined input field.

Best Regards
Bernd