Hello all!
I've a question: I have a report which uses among others the table Item as DataItem. I've created a nice Product Specifications report to send to customers, but now some international customers want them also. So, for me the challenge is to make it multilangual. I've used the captionML of all fields to translate the report, but now I want to set the language using a request form.
- I've created the form
- Declared in Globals the Option variable 'optionLanguage' and set the OptionSting 'NLD, ENU'
- I've inserted to Option Buttons and set the SourceExp to 'optionLanguage' and the Optionvalues of both the buttons to respectively 'NLD' and 'ENU'
- I've inserted a line of code on the OnOpenForm() action of the request form: 'OptionLanguage := 0;' to make the first button default
So now I need to retrieve the selected value from the form. But then I need to store the value into the variable 'optionLanguage'??? Or how do I continue from here. I know that I can control the language of the report with the line of code 'CurrReport.LANGUAGE := ....'. But how do I get from where I am now to the point that it is a working request form! Please help me out! Thanks in advance!
"Make it idiot-proof and someone will invent a better idiot..."
0
Answers
And after that I have to get the value in the OnPreReport trigger of the report?!
In the How Tos I only find procedures to pass parameters between different objects, but that's not the case, right? Sorry for all the questions!
Kind regards,
- Instead of removed the line of code from the OnOpenForm() trigger of the Request Form and added the line to the OnInitReport() trigger of the report. I changed it to 'OptionLanguage := OptionLanguage::NLD;' to set the default language.
- On the OnPreReport() trigger of the report I've added the line 'CurrReport.LANGUAGE := Languagerec.GetLanguageID('ENU');'. Now my report is running in English language.
- Now, I wanted to replace the 'ENU' parameter with the value of the selected Option Button. So first I replaced it simply with the name of the Option variable: 'OptionLanguage', but then I got some error about the fact that the requested parameter should be a CODE type, but I'm using an OPTION type. So then I've used the FORMAT function and this made the line like this: 'CurrReport.LANGUAGE := Languagerec.GetLanguageID(FORMAT(OptionLanguage));'. Now it is working fine and I'm going to do some finetuning, to make it look nicer!
Thanks everybody for the support!