en@frrom
4th June 2007, 15:51
Hello all,
I am trying to set the language (different than system language) for a report printed through AFS. I guess it must be possible, but didn't manage so far... Adding the language code to the reportname in stpapi.set.report() didn't work...
Thanks in advance!
mark_h
4th June 2007, 16:55
Have you tried what you mentioned in this thread (http://www.baanboard.com/baanboard/showthread.php?t=28655&highlight=changing+language). Just wondering if changing the laguage before launching the session would work, then resetting the language after the session finished.
en@frrom
5th June 2007, 09:17
Hello Mark,
In the thread you mentioned all that was required was setting report language in regular Baan programming mode, which is done by using brp.open.language(). For AFS I don't know the similar function/command/argument to set the language...
As for changing language$: this is not an option for us, since the Baan objects in our environment (forms, enum-descriptions, etc) are not available in all the user languages.
Regards,
Eli Nager
en@frrom
12th June 2007, 13:04
I am actually surprised nobody has come up with something about this issue. I would expect this to be a very general and commonly used feature/requirement, as I assume that most companies print certain (BP-related..) documents in language <> system language..?
en@frrom
27th June 2007, 13:02
Ok guys,
This is unlike me usually, but I cannot believe that it shouldn't be possible to print a report through AFS in a language other than the system language, so therefor, in a last attempt, I am "refreshing" my thread once again by means of this post...
mark_h
27th June 2007, 14:02
I do not think it is possible - at least not without modifying the session you are calling through AFS. I do not think you can run the session in one language and have the report come out in a second language - not without modifying the session.
en@frrom
27th June 2007, 16:45
What can I say; I still find it strange and not making sense...
mark_h
27th June 2007, 17:30
It kind of makes sense to me - or I see both sides. When you run a session it runs in your default language, so it opens the report in the same language. If it did not do this then it would have to ask which language you want to open the report in. I am sure Baan could make this some kind of configurable option - but that would require some type of internal change. I can see where someone might want to run a report in a different language to send offsite. This could be a good feature for the software.
en@frrom
27th June 2007, 17:56
Mark,
Running a report in a language other than system language is a standard Baan-tools feature for Baan scripting via function brp.open.language(), just because it makes sense to have to send reports in languages <> system language.
I therefor expect the same functionality to be available through AFS...
Regards,
Eli Nager
mark_h
27th June 2007, 18:53
Running a report in a language other than system language is a standard Baan-tools feature for Baan scripting via function brp.open.language(), just because it makes sense to have to send reports in languages <> system language.
I know I can write a session that would open a report in another language, but Baan did not make this funtionality available in the standard sessions. For example I can not log into the system using English, run something like ttaad3410m000 and have the report come out in spanish. I know if I had source for ttaad3410m000 I could modify the script so it ran in spanish(or another language), but the standard sessions do not operate like that. If you look at tccom0010(used to open reports for most sessions) you see that it looks like(in old 4c3 code) they always open the report based off of the "language$" variable. So in order to change this variable using AFS would have to (1) change language$ BEFORE the reporting session is launched(you said you all do not have all of those objects) or (2) modify the session you are calling in order to print in another language.
Now there could be a method that I do not know that would allow me to run
ttaad3410m000 and get the report in spanish - but I have never seen it. So as far as I know you will have to make some changes in the session you are calling. Have you tried asking the support center if there is a way to this?
en@frrom
29th June 2007, 14:44
Thanks Mark for your replies, I might log a case by support about this, but am afraid you're right... The functionality of opening report in specific language does not seem to be available through AFS..
Thomasm
30th June 2007, 13:30
Have you considered running with different users, set up with different languages? Provided you can split your needs (by selection settings in jobs or similar) it might be a solution?
Not knowing what you are trying to print I would like to mention the existing support for printing customer and supplier related documents in the language set by customer/supplier.
Regards,
/Thomas
en@frrom
2nd July 2007, 15:25
Not knowing what you are trying to print I would like to mention the existing support for printing customer and supplier related documents in the language set by customer/supplier.
It is exactly that functionality which I would like to use through AFS, and seems NOT to be available in BaaN. I need to print customer-related reports in customer's language. In BaaN 3GL/4GL you can achieve this by the brp.open.language() function, yet in AFS it seems not to be possible.
mark_h
2nd July 2007, 16:22
That is interesting. I was just looking at our customer table and it allows us to set the language for the customer. Of course I was going to test this, but the only language we have available is English. Sigh. I was thinking - change the language, print a report, change it back. I wish I could test it.
en@frrom
2nd July 2007, 17:07
Mark, I am not sure if I understand you well, but if I do, you want to test if a report printed for a customer with language <> system language will default in standard BaaN always print in the customer language. The answer is no. The functionality is available, as I stated from the beginning of my thread (and maybe now you will understand why I didn't like to believe in the beginning that the functionality is not available through AFS).
Only very few reports in standard Baan are printing standard in the BP's language. An example of a report that DOES that, is for instance reminders. However, the standard Baan function brp.open.language() is made just for the purpose of printing a report in BP's language...
mark_h
2nd July 2007, 17:40
I think we are closer. :) The way I understood Thomas was that if I went into maintain customers, switched the language to say German, then ran something like print reminders, the report would be in German. I wanted to test this to see if my system would work that way without using AFS code. So far it does not appear to work that way - or at least maybe I have something else not set up correctly.
Thomasm
2nd July 2007, 20:29
Mark,
You are right, setting a language on the customer prints the standard customer documents (orders, invoices, reminders,...) in the set language. And I think you might be able to test it, depending on if your system is installed with all the A languges (1 for Dutch, 2 for English, 3 for German and 4 for French). I think you need to specify a user language and connect it to a system language AND it is of course provided your system has the language of your choice. Otherwise, or maybe easiest, you could copy a report to the language of your choice, make an identity mark and print. You don't need the labels to be translated for your test.
Eli,
However interested you are in making the call to set the language I still think you can acheive what you want by using different users running the print jobs. As you can come to a logic decision on what language you want to set at a certain point in your script I propose you make this selection up front by settings on the form and some connected programming.
Then you create a user connected to for example Spanish (or what ever) and let this user run the session with settings you need to pick up all the customers/suppliers that you want to print to in Spanish. Then you have a separate job with different settings that you call with a user connected to for example French, resulting in the French version of the report being used. And so on. So depending on the exact document you want to print the first alternative is probably easier but the second gives you flexibility into other reports too.
/Thomas
en@frrom
5th July 2007, 13:12
Thomas,
As I have already explained in my previous posts, this is anyway not an option, since my language dependant objects, like forms etc, are not available in those languages. Our objects are available only in one language, namely Ducth (1), so if I will activate a session (=form) in language 4 (French) for instance, I will get errors (forms not available).
If what you are suggesting WERE possible, then it would be enough to change the system language at runtime (predefined variable) to the desired language before calling the print session, print the report in the desired language, and change the language back. As easy as that. This is however only possible if your Baan objects are available in those other languages.
Regards,
Eli Nager
Thomasm
5th July 2007, 15:16
Eli,
Now I think we are getting somewhere :) . Go to ttaad1110m000 and create language 4 and call it French (and convert to runtime). Now you have French (4) in the system. So now you go to the form of the session you are looking for and go to special and Copy to Other Language.
I recomend to make sure to Link to Language and link it to 1 (Dutch) so that any change you do to a form in any language the change will be made to all the language versions. Go to the 4 version of the form and dump it. And now you can start that session up in French. Simple as that.
You will still be missing all the labels but if you now also copy the labels and then dump again they will show up. The text in the label will still be in Dutch but they are in the 'French language domain' and only need translation.
You probably need to do the same with some menus and of course the report(s) you are looking for but as long as you are planing on using a limited number of components it should be enough. Don't forget that you need to dump/compile before you can use the component.
/Thomas
en@frrom
5th July 2007, 15:27
Thomas,
First of all one remark regarding your suggestion part to create the system languages 4 etc..:
Obviously the languages are available in my system, otherwise I wouldn't be able to use brp.open.language() in regular 3GL/4GL scripts. It is just the objects that are not available in those languages, because we use Baan in one language (1) only.
As for the rest: nice try, thank you, but no thank you...
I am not going to create all my language dependant components to other languages, just for the sake of printing 1 or 2 reports via AFS in customer language. If I feel the urge to do so I have two much better and less dramatic options first: I can either make a few small changes in the script I'm calling in order to enable importing a language as a parameter, and using brp.open.language() instead of rprt_open(). Or second, and better option (I don't have to touch the standard software) I create a new report in system language, which will contain the report in the other language. Through AFS I will set, depending on the BP's language, the desired report. It is not extremely neat, and it's not the way I like seeing it, but if Baan does not leave me any other options (technically), I will do it that way...
Regards,
Eli Nager
gentercz
12th July 2007, 16:41
Hi all,
we have exaclty the same problem.
We must print out delivery notes twice, first in the customer's language (e.g. Italian), then in our system language (german).
I have no problem starting the session twice, but then how to change the language code.
Like Eli, i neither want to modify the sales order language inbetween....
So Eli, you are not alone ... with your problem and with your lack of solutions !!!
Any more ideas ?
Jochen
george7a
12th July 2007, 17:03
Here are my two cents:
Why don't you execute the same script (or a different one) through another BW with a user that is defined to use the "other" language from the main script?
The dos command to execute the script again from the main script through a different user will be something like this:
bw.exe OtherLanguage.bwc ScriptCode2
You will have to save your password for that BWC file.
So at the end of your main script you will execute that command and the script will run again in the other language. I know it is not elegant but it should work...
I hope it helps,
- George
P.S. If you decided to run the same script, be careful not to go to an infinite loop.
en@frrom
13th July 2007, 08:39
George,
Like already mentioned several times in this thread, this will not work, since my language dependant components are not available in BaaN in that other language, which will result in errors when the system tries to read forms. So in addition it would require me to make those components available in those languages just for the sake of printing a report through AFS.
I then much rather opt for what I mentioned in my last post:
If I feel the urge to do so I have two much better and less dramatic options first: I can either make a few small changes in the script I'm calling in order to enable importing a language as a parameter, and using brp.open.language() instead of rprt_open(). Or second, and better option (I don't have to touch the standard software) I create a new report in system language, which will contain the report in the other language. Through AFS I will set, depending on the BP's language, the desired report.
Kind regards,
Eli Nager