Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Dynamic text labels in composite report

10 posts in DataWindow Last posting was on 2008-03-27 12:03:57.0Z
Bob Conroy Posted on 2008-03-20 20:42:20.0Z
Reply-To: "Bob Conroy" <bob.conroy@mindsparx.com>
From: "Bob Conroy" <bob.conroy@mindsparx.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Dynamic text labels in composite report
Lines: 22
Organization: MindSparX
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e2cc2c$1@forums-1-dub>
Date: 20 Mar 2008 12:42:20 -0800
X-Trace: forums-1-dub 1206045740 10.22.241.152 (20 Mar 2008 12:42:20 -0800)
X-Original-Trace: 20 Mar 2008 12:42:20 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86498
Article PK: 415758

I am trying to change the text of my datawindow labels dynamically at
preview/print time to support multi-language requirements from composite
reports.

I was trying to loop through the text controls on the reports to check the
default text, then I will compare against my language cross reference table
in memory to switch the value to another language. But I can't find a
command that gets me more than the object listing of the main datawindow.

Can someone give me the command to list all the text controls in every
report in my composite so I can loop through and then modify the text to the
correct language. (I have the language mapping in memory already)

The dw_1.object.datawindow.objects gives me a list of objects in the main
report (ie dw_1, dw_2, dw_3...) How do I get a list of the controls within
those objects?

Thanks

- Bob


Jason 'Bug' Fenter [TeamSybase] Posted on 2008-03-20 21:09:48.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <jason.fenter@teamsybase.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Dynamic text labels in composite report
References: <47e2cc2c$1@forums-1-dub>
In-Reply-To: <47e2cc2c$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e2d29c$1@forums-1-dub>
Date: 20 Mar 2008 13:09:48 -0800
X-Trace: forums-1-dub 1206047388 10.22.241.152 (20 Mar 2008 13:09:48 -0800)
X-Original-Trace: 20 Mar 2008 13:09:48 -0800, vip152.sybase.com
Lines: 27
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86499
Article PK: 415761


Bob Conroy wrote:
> I am trying to change the text of my datawindow labels dynamically at
> preview/print time to support multi-language requirements from composite
> reports.
>
> I was trying to loop through the text controls on the reports to check the
> default text, then I will compare against my language cross reference table
> in memory to switch the value to another language. But I can't find a
> command that gets me more than the object listing of the main datawindow.
>
> Can someone give me the command to list all the text controls in every
> report in my composite so I can loop through and then modify the text to the
> correct language. (I have the language mapping in memory already)
>
> The dw_1.object.datawindow.objects gives me a list of objects in the main
> report (ie dw_1, dw_2, dw_3...) How do I get a list of the controls within
> those objects?
>
> Thanks
>
> - Bob

You'll need to do a GetChild() for each datawindow within your composite
report. Once you have a reference to the child datawindow, you'll need
to query that for text objects and cross-language translations. You're
very close... you just skipped that one (composite-specific) step.


Bob Conroy Posted on 2008-03-21 02:59:21.0Z
Sender: 4979.47e30454.1804289383@sybase.com
From: Bob Conroy
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Dynamic text labels in composite report
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47e32489.4ba9.1681692777@sybase.com>
References: <47e2d29c$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 20 Mar 2008 18:59:21 -0800
X-Trace: forums-1-dub 1206068361 10.22.241.41 (20 Mar 2008 18:59:21 -0800)
X-Original-Trace: 20 Mar 2008 18:59:21 -0800, 10.22.241.41
Lines: 55
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86501
Article PK: 415762


> Bob Conroy wrote:
> > I am trying to change the text of my datawindow labels
> > dynamically at preview/print time to support
> > multi-language requirements from composite reports.
> >
> > I was trying to loop through the text controls on the
> > reports to check the default text, then I will compare
> > against my language cross reference table in memory to
> > switch the value to another language. But I can't find a
> command that gets me more than the object listing of the
> > main datawindow.
> > Can someone give me the command to list all the text
> > controls in every report in my composite so I can loop
> > through and then modify the text to the correct
> > language. (I have the language mapping in memory
> > already) The dw_1.object.datawindow.objects gives me a
> > list of objects in the main report (ie dw_1, dw_2,
> > dw_3...) How do I get a list of the controls within
> > those objects?
> > Thanks
> >
> > - Bob
>
>
> You'll need to do a GetChild() for each datawindow within
> your composite report. Once you have a reference to the
> child datawindow, you'll need to query that for text
> objects and cross-language translations. You're very
> close... you just skipped that one (composite-specific)
> step.

Ok I tried that
dw_print_rpt.GetChild(s_child, child_dw)
s_child_objects = child_dw.Object.DataWindow.Objects
and that command isn't allowed (incompatible property
object)

Also tried: s_child_objects =
child_dw.Describe("dw_print_rpt.Object." + s_child +
".DataWindow.Objects")
but that returns "!"

Sorry if this is basic, I am new at manipulation.


I also see in the documentation that if one of my reports
is also a composite I can't get more levels?

"Nested reports You cannot use GetChild to get a
reference to a report in a composite DataWindow when the
report itself is a composite or nested DataWindow."

Is this going to limit me from changing language within
these reports, or has someone found a way aoround this
issue?


Jeremy Lakeman Posted on 2008-03-23 10:46:00.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Dynamic text labels in composite report
References: <47e2d29c$1@forums-1-dub> <47e32489.4ba9.1681692777@sybase.com>
In-Reply-To: <47e32489.4ba9.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e634e8$1@forums-1-dub>
Date: 23 Mar 2008 02:46:00 -0800
X-Trace: forums-1-dub 1206269160 10.22.241.152 (23 Mar 2008 02:46:00 -0800)
X-Original-Trace: 23 Mar 2008 02:46:00 -0800, vip152.sybase.com
Lines: 65
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86510
Article PK: 415775


Bob Conroy wrote:
>> Bob Conroy wrote:
>>> I am trying to change the text of my datawindow labels
>>> dynamically at preview/print time to support
>>> multi-language requirements from composite reports.
>>>
>>> I was trying to loop through the text controls on the
>>> reports to check the default text, then I will compare
>>> against my language cross reference table in memory to
>>> switch the value to another language. But I can't find a
>> command that gets me more than the object listing of the
>>> main datawindow.
>>> Can someone give me the command to list all the text
>>> controls in every report in my composite so I can loop
>>> through and then modify the text to the correct
>>> language. (I have the language mapping in memory
>>> already) The dw_1.object.datawindow.objects gives me a
>>> list of objects in the main report (ie dw_1, dw_2,
>>> dw_3...) How do I get a list of the controls within
>>> those objects?
>>> Thanks
>>>
>>> - Bob
>>
>> You'll need to do a GetChild() for each datawindow within
>> your composite report. Once you have a reference to the
>> child datawindow, you'll need to query that for text
>> objects and cross-language translations. You're very
>> close... you just skipped that one (composite-specific)
>> step.
>
> Ok I tried that
> dw_print_rpt.GetChild(s_child, child_dw)
> s_child_objects = child_dw.Object.DataWindow.Objects
> and that command isn't allowed (incompatible property
> object)
>
> Also tried: s_child_objects =
> child_dw.Describe("dw_print_rpt.Object." + s_child +
> ".DataWindow.Objects")
> but that returns "!"
>
> Sorry if this is basic, I am new at manipulation.
>
>
> I also see in the documentation that if one of my reports
> is also a composite I can't get more levels?
>
> "Nested reports You cannot use GetChild to get a
> reference to a report in a composite DataWindow when the
> report itself is a composite or nested DataWindow."
>
> Is this going to limit me from changing language within
> these reports, or has someone found a way aoround this
> issue?

One of these might work for you
dw_report.describe(s_child+'.object.datawindow.objects')
or;
dwobject ldw_child
ldw_child=dw_report.object.__get_attribute(s_child,false)
ldw_child.object.datawindow.objects

(the __get_attribute functions is undocumented and may not work in
future versions...)


Bob Conroy Posted on 2008-03-24 18:43:03.0Z
Reply-To: "Bob Conroy" <bob.conroy@mindsparx.com>
From: "Bob Conroy" <bob.conroy@mindsparx.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47e2d29c$1@forums-1-dub> <47e32489.4ba9.1681692777@sybase.com> <47e634e8$1@forums-1-dub>
Subject: Re: Dynamic text labels in composite report
Lines: 27
Organization: MindSparX
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e7f637$1@forums-1-dub>
Date: 24 Mar 2008 10:43:03 -0800
X-Trace: forums-1-dub 1206384183 10.22.241.152 (24 Mar 2008 10:43:03 -0800)
X-Original-Trace: 24 Mar 2008 10:43:03 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86512
Article PK: 415774

Great, thanks, second one worked.
Now I use that second object list to get the text controls from the report
and I use a describe to get the value, but when I do a modify it does not
update the report.

dw_report.GetChild(s_child,child_dw)
s_label = child_dw.Describe("txt_ctrl.Text")
s_new_label = ...conversion function
child_dw.Modify("txt_ctrl.Text='" + s_new_label + "'")

Any suggestions here? The object seems to be in memory correctly since the
describe worked, and the modify command does not fail, but the report does
not have the new text.

Thanks again

> One of these might work for you
> dw_report.describe(s_child+'.object.datawindow.objects')
> or;
> dwobject ldw_child
> ldw_child=dw_report.object.__get_attribute(s_child,false)
> ldw_child.object.datawindow.objects
>
> (the __get_attribute functions is undocumented and may not work in future
> versions...)


M. Searer Posted on 2008-03-26 14:07:27.0Z
From: "M. Searer" <nospam@nospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47e2d29c$1@forums-1-dub> <47e32489.4ba9.1681692777@sybase.com> <47e634e8$1@forums-1-dub> <47e7f637$1@forums-1-dub>
Subject: Re: Dynamic text labels in composite report
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47ea589f$1@forums-1-dub>
Date: 26 Mar 2008 06:07:27 -0800
X-Trace: forums-1-dub 1206540447 10.22.241.152 (26 Mar 2008 06:07:27 -0800)
X-Original-Trace: 26 Mar 2008 06:07:27 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86519
Article PK: 415779

I always do a dw.groupcalc() to force recalcs and repaints in datawindows
Try on both the child and the main datawindows.

setredraw(true) may also help

"Bob Conroy" <bob.conroy@mindsparx.com> wrote in message
news:47e7f637$1@forums-1-dub...
> Great, thanks, second one worked.
> Now I use that second object list to get the text controls from the report and
> I use a describe to get the value, but when I do a modify it does not update
> the report.
>
> dw_report.GetChild(s_child,child_dw)
> s_label = child_dw.Describe("txt_ctrl.Text")
> s_new_label = ...conversion function
> child_dw.Modify("txt_ctrl.Text='" + s_new_label + "'")
>
> Any suggestions here? The object seems to be in memory correctly since the
> describe worked, and the modify command does not fail, but the report does not
> have the new text.
>
> Thanks again
>
>> One of these might work for you
>> dw_report.describe(s_child+'.object.datawindow.objects')
>> or;
>> dwobject ldw_child
>> ldw_child=dw_report.object.__get_attribute(s_child,false)
>> ldw_child.object.datawindow.objects
>>
>> (the __get_attribute functions is undocumented and may not work in future
>> versions...)
>
>


BOB Posted on 2008-03-26 15:22:50.0Z
Sender: 5895.47e846d0.1804289383@sybase.com
From: Bob
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Dynamic text labels in composite report
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <47ea6a4a.63e.1681692777@sybase.com>
References: <47ea589f$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 26 Mar 2008 07:22:50 -0800
X-Trace: forums-1-dub 1206544970 10.22.241.41 (26 Mar 2008 07:22:50 -0800)
X-Original-Trace: 26 Mar 2008 07:22:50 -0800, 10.22.241.41
Lines: 98
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86520
Article PK: 415781

That did not seem to change the results either. Here is my
function now.

STRING s_child2, s_child2_type
STRING s_objects, s_child, s_child_objects, s_text_ctrl,
s_child_type, s_label, s_new_label, l_s_modify, s_objects2
LONG l_left, l_right, l_left2, l_right2
DataWindowChild child_dw
DwObject ldw_child

s_objects = dw_print_rpt.Object.DataWindow.Objects

l_right = 0
DO
l_left = l_right + 1 // Bump past ~t.
l_right = Pos ( s_objects , "~t" , l_left )
IF l_right > 0 THEN
s_child = mid ( s_objects , l_left , l_right - l_left )
ELSE
s_child = mid ( s_objects , l_left )
END IF

s_child_type = dw_print_rpt.Describe(s_child + ".type")
IF s_child_type = 'report' THEN
dw_print_rpt.GetChild(s_child, child_dw)
ldw_child = dw_print_rpt.object.__get_attribute(s_child,
false)

s_child_objects = ldw_child.object.DataWindow.Objects
l_right2 = 0
DO
l_left2 = l_right2 + 1 // Bump past ~t.
l_right2 = Pos ( s_child_objects , "~t" , l_left2 )
IF l_right2 > 0 THEN
s_child2 = mid ( s_child_objects , l_left2 , l_right2 -
l_left2 )
ELSE
s_child2 = mid ( s_child_objects , l_left2 )
END IF
s_child2_type = child_dw.Describe(s_child2 + ".type")
IF s_child2_type = 'text' THEN
s_label = child_dw.Describe(s_child2 + ".text")
s_new_label =
g_nv_lx_mgr.fnv_process_msg(a_language,s_label, s_new_label
)
l_s_modify = s_child2 + ".Text = '" +s_new_label + "'"
child_dw.Modify(l_s_modify)
END IF
LOOP WHILE l_right2 > 0
child_dw.groupcalc()
END IF
LOOP WHILE l_right > 0
dw_print_rpt.groupcalc()

RETURN 0

Everything seems to be working up to the child_dw.Modify.
Is there a place in the debugger that I can look to see the
child_dw controls and their current attributes?

> I always do a dw.groupcalc() to force recalcs and repaints
> in datawindows Try on both the child and the main
> datawindows.
>
> setredraw(true) may also help
>
> "Bob Conroy" <bob.conroy@mindsparx.com> wrote in message
> news:47e7f637$1@forums-1-dub...
> > Great, thanks, second one worked.
> > Now I use that second object list to get the text
> > controls from the report and I use a describe to get
> > the value, but when I do a modify it does not update
> the report. >
> > dw_report.GetChild(s_child,child_dw)
> > s_label = child_dw.Describe("txt_ctrl.Text")
> > s_new_label = ...conversion function
> > child_dw.Modify("txt_ctrl.Text='" + s_new_label + "'")
> >
> > Any suggestions here? The object seems to be in memory
> > correctly since the describe worked, and the modify
> > command does not fail, but the report does not have the
> new text. >
> > Thanks again
> >
> >> One of these might work for you
> >>
> dw_report.describe(s_child+'.object.datawindow.objects')
> >> or; >> dwobject ldw_child
> >> ldw_child=dw_report.object.__get_attribute(s_child
> ,false) >> ldw_child.object.datawindow.objects
> >>
> >> (the __get_attribute functions is undocumented and may
> not work in future >> versions...)
> >
> >
>
>


Chris Pollach Posted on 2008-03-25 12:59:25.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47e2cc2c$1@forums-1-dub>
Subject: Re: Dynamic text labels in composite report
Lines: 74
Organization: STD Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e8f72d$1@forums-1-dub>
Date: 25 Mar 2008 04:59:25 -0800
X-Trace: forums-1-dub 1206449965 10.22.241.152 (25 Mar 2008 04:59:25 -0800)
X-Original-Trace: 25 Mar 2008 04:59:25 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86514
Article PK: 415772

Bob;

FYI .. here is what I do for multi-language reports ...

Approach #1

1) Create a retrieval argument (ie: "ra_language") in all your DWO's.
2) You will get a warning that the RA is not mapped when you exit the SQL
painter. Ignore that.
3) In any given DWO, create a Text control for each alternate label's
language.
For example: "First Name:" in English
"PreNom:" in French
4) For each label, create an expression for the "visible" property that
addresses its language.
French => IF (ra_language = "F", 1, 0)
English => IF (ra_language = "E", 1, 0)
5) For each child DWO within the parent DWO - pass the parent "ra_language"
RA to the child DWO.

Now all you have to do is DC.Retrieve ( "E", [args...]) where the constant
"E" can be a variable that contains the application user's language
preference. The parent DWO then passes the language to all its child DWO's
as well. Each DWO is then encapsulated to respond accordingly. This approach
can be extended to as many languages as desired.

Approach #2

1) Create a "shell" parent DWO for your nested or composite report.
2) Create a DWO for each language (ie: dw_Child1_e, dw_child1_f,
dw_child1_g, etc).
3) Use the DC.Modify ( "Create report (band= .....dataobject= .....") syntax
to add the child DWO as required.
- assign the DWO name + "_x" language id via your code based on the
current language of the user.


Food for thought.
HTH

--
Regards ... Chris
http://chrispollach.pbdjmagazine.com
,\|/,
(0 0)
-(_)-

"Bob Conroy" <bob.conroy@mindsparx.com> wrote in message
news:47e2cc2c$1@forums-1-dub...
>I am trying to change the text of my datawindow labels dynamically at
>preview/print time to support multi-language requirements from composite
>reports.
>
> I was trying to loop through the text controls on the reports to check the
> default text, then I will compare against my language cross reference
> table in memory to switch the value to another language. But I can't find
> a command that gets me more than the object listing of the main
> datawindow.
>
> Can someone give me the command to list all the text controls in every
> report in my composite so I can loop through and then modify the text to
> the correct language. (I have the language mapping in memory already)
>
> The dw_1.object.datawindow.objects gives me a list of objects in the main
> report (ie dw_1, dw_2, dw_3...) How do I get a list of the controls
> within those objects?
>
> Thanks
>
> - Bob
>


Bob Conroy Posted on 2008-03-25 13:59:10.0Z
Reply-To: "Bob Conroy" <bob.conroy@mindsparx.com>
From: "Bob Conroy" <bob.conroy@mindsparx.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <47e2cc2c$1@forums-1-dub> <47e8f72d$1@forums-1-dub>
Subject: Re: Dynamic text labels in composite report
Lines: 93
Organization: MindSparX
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47e9052e$1@forums-1-dub>
Date: 25 Mar 2008 05:59:10 -0800
X-Trace: forums-1-dub 1206453550 10.22.241.152 (25 Mar 2008 05:59:10 -0800)
X-Original-Trace: 25 Mar 2008 05:59:10 -0800, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86515
Article PK: 415773

Thanks for the suggestions. I have a similar fallback in mind, which is to
change my text labels to computed fields and call a function which will
accept the original text and a language parameter (as suggested below) and
return the translated values. I have approx 100 reports that may need to be
translated, so I developed a cross reference table which the users can
populate with as many languages as desired, whenever they decide. So I am
trying to create a generic solution that does not require me to know the
translated values at development time. These reports are already developed
in English, and I was trying to not modify the originals but handle the swap
in the scripts. It will take me much longer to go in to each report and add
new fields, or change text controls to computed columns, not to mention it
will make the formatting much more difficult.

Thanks again.

"Chris Pollach" <cpollach@travel-net.com> wrote in message
news:47e8f72d$1@forums-1-dub...
> Bob;
>
> FYI .. here is what I do for multi-language reports ...
>
> Approach #1
>
> 1) Create a retrieval argument (ie: "ra_language") in all your DWO's.
> 2) You will get a warning that the RA is not mapped when you exit the SQL
> painter. Ignore that.
> 3) In any given DWO, create a Text control for each alternate label's
> language.
> For example: "First Name:" in English
> "PreNom:" in French
> 4) For each label, create an expression for the "visible" property that
> addresses its language.
> French => IF (ra_language = "F", 1, 0)
> English => IF (ra_language = "E", 1, 0)
> 5) For each child DWO within the parent DWO - pass the parent
> "ra_language" RA to the child DWO.
>
> Now all you have to do is DC.Retrieve ( "E", [args...]) where the constant
> "E" can be a variable that contains the application user's language
> preference. The parent DWO then passes the language to all its child DWO's
> as well. Each DWO is then encapsulated to respond accordingly. This
> approach can be extended to as many languages as desired.
>
> Approach #2
>
> 1) Create a "shell" parent DWO for your nested or composite report.
> 2) Create a DWO for each language (ie: dw_Child1_e, dw_child1_f,
> dw_child1_g, etc).
> 3) Use the DC.Modify ( "Create report (band= .....dataobject= .....")
> syntax to add the child DWO as required.
> - assign the DWO name + "_x" language id via your code based on the
> current language of the user.
>
>
> Food for thought.
> HTH
>
> --
> Regards ... Chris
> http://chrispollach.pbdjmagazine.com
> ,\|/,
> (0 0)
> -(_)-
>
>
> "Bob Conroy" <bob.conroy@mindsparx.com> wrote in message
> news:47e2cc2c$1@forums-1-dub...
>>I am trying to change the text of my datawindow labels dynamically at
>>preview/print time to support multi-language requirements from composite
>>reports.
>>
>> I was trying to loop through the text controls on the reports to check
>> the default text, then I will compare against my language cross reference
>> table in memory to switch the value to another language. But I can't find
>> a command that gets me more than the object listing of the main
>> datawindow.
>>
>> Can someone give me the command to list all the text controls in every
>> report in my composite so I can loop through and then modify the text to
>> the correct language. (I have the language mapping in memory already)
>>
>> The dw_1.object.datawindow.objects gives me a list of objects in the main
>> report (ie dw_1, dw_2, dw_3...) How do I get a list of the controls
>> within those objects?
>>
>> Thanks
>>
>> - Bob
>>
>
>


Jeremy Lakeman Posted on 2008-03-27 12:03:57.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: Dynamic text labels in composite report
References: <47e2cc2c$1@forums-1-dub> <47e8f72d$1@forums-1-dub> <47e9052e$1@forums-1-dub>
In-Reply-To: <47e9052e$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <47eb8d2d@forums-1-dub>
Date: 27 Mar 2008 04:03:57 -0800
X-Trace: forums-1-dub 1206619437 10.22.241.152 (27 Mar 2008 04:03:57 -0800)
X-Original-Trace: 27 Mar 2008 04:03:57 -0800, vip152.sybase.com
Lines: 98
X-Authenticated-User: pb110beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:86525
Article PK: 415782

So export all the dataobjects and write an automated process to turn the
text objects in the exported files into computes...
You could automate the import and export with librarydirectory /
libraryexport / libraryimport.

Bob Conroy wrote:
> Thanks for the suggestions. I have a similar fallback in mind, which is to
> change my text labels to computed fields and call a function which will
> accept the original text and a language parameter (as suggested below) and
> return the translated values. I have approx 100 reports that may need to be
> translated, so I developed a cross reference table which the users can
> populate with as many languages as desired, whenever they decide. So I am
> trying to create a generic solution that does not require me to know the
> translated values at development time. These reports are already developed
> in English, and I was trying to not modify the originals but handle the swap
> in the scripts. It will take me much longer to go in to each report and add
> new fields, or change text controls to computed columns, not to mention it
> will make the formatting much more difficult.
>
> Thanks again.
>
> "Chris Pollach" <cpollach@travel-net.com> wrote in message
> news:47e8f72d$1@forums-1-dub...
>> Bob;
>>
>> FYI .. here is what I do for multi-language reports ...
>>
>> Approach #1
>>
>> 1) Create a retrieval argument (ie: "ra_language") in all your DWO's.
>> 2) You will get a warning that the RA is not mapped when you exit the SQL
>> painter. Ignore that.
>> 3) In any given DWO, create a Text control for each alternate label's
>> language.
>> For example: "First Name:" in English
>> "PreNom:" in French
>> 4) For each label, create an expression for the "visible" property that
>> addresses its language.
>> French => IF (ra_language = "F", 1, 0)
>> English => IF (ra_language = "E", 1, 0)
>> 5) For each child DWO within the parent DWO - pass the parent
>> "ra_language" RA to the child DWO.
>>
>> Now all you have to do is DC.Retrieve ( "E", [args...]) where the constant
>> "E" can be a variable that contains the application user's language
>> preference. The parent DWO then passes the language to all its child DWO's
>> as well. Each DWO is then encapsulated to respond accordingly. This
>> approach can be extended to as many languages as desired.
>>
>> Approach #2
>>
>> 1) Create a "shell" parent DWO for your nested or composite report.
>> 2) Create a DWO for each language (ie: dw_Child1_e, dw_child1_f,
>> dw_child1_g, etc).
>> 3) Use the DC.Modify ( "Create report (band= .....dataobject= .....")
>> syntax to add the child DWO as required.
>> - assign the DWO name + "_x" language id via your code based on the
>> current language of the user.
>>
>>
>> Food for thought.
>> HTH
>>
>> --
>> Regards ... Chris
>> http://chrispollach.pbdjmagazine.com
>> ,\|/,
>> (0 0)
>> -(_)-
>>
>>
>> "Bob Conroy" <bob.conroy@mindsparx.com> wrote in message
>> news:47e2cc2c$1@forums-1-dub...
>>> I am trying to change the text of my datawindow labels dynamically at
>>> preview/print time to support multi-language requirements from composite
>>> reports.
>>>
>>> I was trying to loop through the text controls on the reports to check
>>> the default text, then I will compare against my language cross reference
>>> table in memory to switch the value to another language. But I can't find
>>> a command that gets me more than the object listing of the main
>>> datawindow.
>>>
>>> Can someone give me the command to list all the text controls in every
>>> report in my composite so I can loop through and then modify the text to
>>> the correct language. (I have the language mapping in memory already)
>>>
>>> The dw_1.object.datawindow.objects gives me a list of objects in the main
>>> report (ie dw_1, dw_2, dw_3...) How do I get a list of the controls
>>> within those objects?
>>>
>>> Thanks
>>>
>>> - Bob
>>>
>>
>
>