alexpreyer
4th July 2008, 10:41
We are using the session tdssc0402m000 for creating order confirmations for our customers. This session originaly is only for printing an internal list. So from Baan standart the report is only printed in the language of the user printing it.

For the order confirmation it is neccessary to print it in the language of the customer. I searched yesterday long here in the forum, but found nothing helping me.

I have the script of the session and could set there the language depending on the customer. But how can I stear which Report is taken (the report is existing in all necessary languages)?

Thanks for your help

Alex

george7a
4th July 2008, 11:25
Hi,

This link discusses the same issue:
http://www.baanboard.com/baanboard/showthread.php?t=26342

I hope it helps,

- George

vahdani
4th July 2008, 11:40
Hi Alex,

in Baan IV standard this is generally done using the include "itccom0010 Report Handling". Following is the basic program structure:


declaration:
....
long open.mode

#include "itccom0010"

choice.cont.process:
before.choice:
spool.device = "D"
open.mode = 1
on.choice:
if not open.report(1,spool.device,open.mode,language$,1) then
close.reports()
choice.again()
endif
main.printing.function()
close.reports(0)

|****************************** functions *************************************
functions:


function main.printing.function()
{
string lang.code(1) |language code:
|"1" = Dutsch
|"2" = English
|"3" = German,.....
|as in "tcmcs046.lang"
...

print.record(1, lang.code)

...
}

alexpreyer
4th July 2008, 11:59
First thanks for your very fast help.

At the moment the call for printing looks:

choice.cont.process:
on.choice:
execute(print.data)

choice.print.data:
on.choice:

if open.report(1,"",1) then
| cum.qty = 0 |#158547.o
read.main.table()
close.reports(1)
else
choice.again()
endif

Then I tried different things for the open.report command
(For testing "hardwired" to english):

iif open.report(1,"",1,2) then
also
if open.report(1,"",1,"2")

But the printed report stays in german.

vahdani
4th July 2008, 12:13
Hi Alex,

the trick is to find the language code of the customer and use it when calling the print.record function (see below), the "report handling include" automatically opens the report in the requested language if not already open.


function main.printing.function()
{
...
select records to print
selectdo
select tcmcs046.lang
from tcmcs046, tccom010
where tccom010.cuno = :customer
and tccom010.clan refres to tcmcs046
selectdo
endselect
....
print.record(1, tcmcs046.lang)
....
endselect
}

alexpreyer
4th July 2008, 16:29
function main.printing.function()
{
...
select records to print
selectdo
select tcmcs046.lang
from tcmcs046, tccom010
where tccom010.cuno = :customer
and tccom010.clan refres to tcmcs046
selectdo
endselect
....
print.record(1, tcmcs046.lang)
....
endselect
}



Thats worked! Before the print.record only was set to "print.record(1)". After getting tcmcs046.lang and adding the language to print.record the session is multilanguage able.

Thanks a lot for the great help, I appriciate.
Alex