alex.rodionov
5th November 2015, 18:36
Hello,
I need to modify standard report whinh447601000 generated by session whinh4476m000. I redesigned layouts, and created report script to print the required information. Now I have trapped into the following problem: different business partners of company use different native language and they need to get this report in native language (i.e. user who generates this report is working with language 2, while the report should be generated for language 3 or R, etc. depending what language is specified in tccom100 Business Partners table).
Is it possible to specify report language in report script or in any other way (not modifying standard session whinh4476m000)?
mark_h
5th November 2015, 22:48
Try searching the forum - one thread http://www.baanboard.com/baanboard/showthread.php?t=26342&highlight=change+report+language. It mentions using AFS to do it - but I am not sure how that would work. I know you could write a session that would look up the language needed and run the session in the background - that is what AFS is for. But how you change the language I am not sure about - the variables I see like lattr.language say they are read only.
mark_h
5th November 2015, 23:21
RIght now I am thinking it is not possible without source code. After reading this http://www.baanboard.com/baanboard/showthread.php?t=36783&highlight=change+report+language. Maybe someone else has a suggestion.
vamsi_gujjula
6th November 2015, 06:38
well there is one approach i have in mind but needs to be tried out
well calling the same report from report script using brp.open.language()
data from session ==> (report_ called_by_session ) ==> (report called with in the report)
report_ called_by_session needs to be killed once all the data is sent to report called with in the report
günther
6th November 2015, 14:07
I could imagine to create just one report, that does the "translation" by itselt. That means, all labels have to be fields, and eg. in before.report, you have to fill them according to the desired language.
I have never done that, but it should be possible.
Just to be sure: The content of the normal fields is not concerned by the language settings, right? And texts get only the text number, the rest is done by the report, so that part should work.
Regards
Günther
bhushanchanda
6th November 2015, 16:35
Also check this similar thread (http://www.baanboard.com/baanboard/showthread.php?t=52799) which is for Baan 4 I guess.
Han Brinkman
6th November 2015, 17:08
Copy the report to another report code.
Replace the current one so that it only contains one detail line. In this detail you only call brp.ready.
In the before program you open the just new create report in the correct language (make sure you have the data at hand at this time, if not you need to check e.g. in the report if the report open function is already being called, if not than perform it than.
In the after program close the report.
If within one run you have to print in different languages you need to check if the business partner changes and perform closeing and opening the report again.
benito
6th November 2015, 17:41
his requirement is not to mess with (std) program script. in theory looks doable by just putting the statement in the report script:
before.program:
language$ = "1"
you just need to make sure you have the equivalent labels in each language. however, from my test, it doesn't always work as desired.
i would go with gunther's suggestion. make all labels as variable fields and assign values depending on the language of the bp. maybe create a dll for this so you can re-use it in other reports. this way, all you need to do is get the language of the bp first then the dll will assign values. this should work flawlessly and you don't have to deal with language software components that are a lot of pain sometimes.
alex.rodionov
9th November 2015, 16:13
It seems to me that creating form fields for labels and assigning values using tt.label.desc.by.lang is the only correct way.
Thank to all for replies!!!