From: Geoff Schaller on
Roger.

Of course you can.

Geoff


"Roger Lawton" <nsproger(a)nspsomax.com> wrote in message
news:i0a8ci$3m8$1(a)speranza.aioe.org:

> Bill:
>
> Not sure if this is your problem but since you changed the column CategoryID
> to CategoryName by using an expression, this column is not a "real" column
> in the server. Therefore it cannot sort by that column.
>
> We use VO2Ado servers in our system and we have similar situations. If I
> want to sort by a description of something (which like you is stored in
> another table) I do an inner join when I do the select and then it is a
> "real" column in the server and can be sorted.
>
> HTH
>
>
> --
> Roger Lawton
> Product Manager
> SOMAX, Inc.
>
>
> "Bill Tillick" <wtillick(a)gmail.com> wrote in message
> news:75154f5f-ddf2-4395-8c3c-93c6c5d15538(a)y32g2000prc.googlegroups.com...
>
> > Hello again,
> > I have a SQLServer (VO2.8) attached to a bBrowser3. The server
> > contains a CategoryCode that I now 'translate' into a CategoryName by
> > using a codeblock to lookup the CategoryCode in a reference table.
> > This is now working fine.
> >
> > I separately use a CaptionClick method to reorder the rows according
> > to which Caption was clicked. I use the Event from the click to
> > determine which column was clicked by examining the
> > oEvent:column:FieldSym and then send an appropriate OrderBy to the
> > server.
> > This worked fine UNTIL I changed the Category column from ..ID
> > to ..Name by using the aforementioned CodeBlock. I first thought that
> > the solution would be to assign a Hyperlabel when I create the column
> > - but that didn't work??
> >
> > So, my question is, how can I detect that the Category caption was
> > clicked (without resorting to using the column number which could
> > change in the future)?
> >
> > Thanks,
> > Bill
> > --------------------------------
> >
> > Relevant code is:
> > (a) creating the column
> > oColumn := bDataColumn{ self:oDCbBrowse, self:server, {|s,oWin|
> > oWin:GetCatName() }, #EXPRESSION, self}
> > oColumn:Hyperlabel := HyperLabel{#CategoryName}
> >
> > (b) testing the CaptionClick
> > DO CASE
> > CASE oEvent:column:FieldSym == #ProductID
> > self:Server:OrderBy(#ProductID )
> >
> > CASE oEvent:column:FieldSym == #ProductName
> > self:server:OrderBy( #ProductName )
> >
> > CASE oEvent:column:FieldSym == #ProductDescription
> > self:server:OrderBy( #ProductDescription )
> >
> > CASE oEvent:column:FieldSym == #CategoryName (This used to be
> > #CategoryID)
> > self:server:OrderBy( #CategoryName )
> >
> > CASE oEvent:column:FieldSym == #ManufacturerID
> > self:server:OrderBy( #ManufacturerID )
> >
> > CASE oEvent:column:FieldSym == #ProductPrice
> > self:server:OrderBy( #ProductPrice )
> > ENDCASE
> >

From: Roger Lawton on
Geoff:

How do you use the orderby method of the AdoServer on a column that does not
exist in the recordset?

Am I missing something here?

Regards

--
Roger Lawton
Product Manager
SOMAX, Inc.

"Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
news:Hl9Wn.950$vD2.587(a)news-server.bigpond.net.au...
> Roger.
>
> Of course you can.
>
> Geoff
>
>
> "Roger Lawton" <nsproger(a)nspsomax.com> wrote in message
> news:i0a8ci$3m8$1(a)speranza.aioe.org:
>
>> Bill:
>>
>> Not sure if this is your problem but since you changed the column
>> CategoryID
>> to CategoryName by using an expression, this column is not a "real"
>> column
>> in the server. Therefore it cannot sort by that column.
>>
>> We use VO2Ado servers in our system and we have similar situations. If I
>> want to sort by a description of something (which like you is stored in
>> another table) I do an inner join when I do the select and then it is a
>> "real" column in the server and can be sorted.
>>
>> HTH
>>
>>
>> --
>> Roger Lawton
>> Product Manager
>> SOMAX, Inc.
>>
>>
>> "Bill Tillick" <wtillick(a)gmail.com> wrote in message
>> news:75154f5f-ddf2-4395-8c3c-93c6c5d15538(a)y32g2000prc.googlegroups.com...
>>
>> > Hello again,
>> > I have a SQLServer (VO2.8) attached to a bBrowser3. The server
>> > contains a CategoryCode that I now 'translate' into a CategoryName by
>> > using a codeblock to lookup the CategoryCode in a reference table.
>> > This is now working fine.
>> >
>> > I separately use a CaptionClick method to reorder the rows according
>> > to which Caption was clicked. I use the Event from the click to
>> > determine which column was clicked by examining the
>> > oEvent:column:FieldSym and then send an appropriate OrderBy to the
>> > server.
>> > This worked fine UNTIL I changed the Category column from ..ID
>> > to ..Name by using the aforementioned CodeBlock. I first thought that
>> > the solution would be to assign a Hyperlabel when I create the column
>> > - but that didn't work??
>> >
>> > So, my question is, how can I detect that the Category caption was
>> > clicked (without resorting to using the column number which could
>> > change in the future)?
>> >
>> > Thanks,
>> > Bill
>> > --------------------------------
>> >
>> > Relevant code is:
>> > (a) creating the column
>> > oColumn := bDataColumn{ self:oDCbBrowse, self:server, {|s,oWin|
>> > oWin:GetCatName() }, #EXPRESSION, self}
>> > oColumn:Hyperlabel := HyperLabel{#CategoryName}
>> >
>> > (b) testing the CaptionClick
>> > DO CASE
>> > CASE oEvent:column:FieldSym == #ProductID
>> > self:Server:OrderBy(#ProductID )
>> >
>> > CASE oEvent:column:FieldSym == #ProductName
>> > self:server:OrderBy( #ProductName )
>> >
>> > CASE oEvent:column:FieldSym == #ProductDescription
>> > self:server:OrderBy( #ProductDescription )
>> >
>> > CASE oEvent:column:FieldSym == #CategoryName (This used to be
>> > #CategoryID)
>> > self:server:OrderBy( #CategoryName )
>> >
>> > CASE oEvent:column:FieldSym == #ManufacturerID
>> > self:server:OrderBy( #ManufacturerID )
>> >
>> > CASE oEvent:column:FieldSym == #ProductPrice
>> > self:server:OrderBy( #ProductPrice )
>> > ENDCASE
>> >
>

From: Geoff Schaller on
Roger,

That wasn't his issue. He renamed the column in the browser, that is
all. Now he needs to detect the column clicked so that he can reissue
the orderby. The orderby will still be in the original column name. But
you can also easily alias any column and using CTE you can now order by
the aliased name if you want to.

Geoff



"Roger Lawton" <nsproger(a)nspsomax.com> wrote in message
news:i0bb6h$qu5$1(a)speranza.aioe.org:

> Geoff:
>
> How do you use the orderby method of the AdoServer on a column that does not
> exist in the recordset?
>
> Am I missing something here?
>
> Regards
>
> --
> Roger Lawton
> Product Manager
> SOMAX, Inc.
>
> "Geoff Schaller" <geoffx(a)softxwareobjectives.com.au> wrote in message
> news:Hl9Wn.950$vD2.587(a)news-server.bigpond.net.au...
>
> > Roger.
> >
> > Of course you can.
> >
> > Geoff
> >
> >
> > "Roger Lawton" <nsproger(a)nspsomax.com> wrote in message
> > news:i0a8ci$3m8$1(a)speranza.aioe.org:
> >
>
> >> Bill:
> >>
> >> Not sure if this is your problem but since you changed the column
> >> CategoryID
> >> to CategoryName by using an expression, this column is not a "real"
> >> column
> >> in the server. Therefore it cannot sort by that column.
> >>
> >> We use VO2Ado servers in our system and we have similar situations. If I
> >> want to sort by a description of something (which like you is stored in
> >> another table) I do an inner join when I do the select and then it is a
> >> "real" column in the server and can be sorted.
> >>
> >> HTH
> >>
> >>
> >> --
> >> Roger Lawton
> >> Product Manager
> >> SOMAX, Inc.
> >>
> >>
> >> "Bill Tillick" <wtillick(a)gmail.com> wrote in message
> >> news:75154f5f-ddf2-4395-8c3c-93c6c5d15538(a)y32g2000prc.googlegroups.com...
> >>
>
> >> > Hello again,
> >> > I have a SQLServer (VO2.8) attached to a bBrowser3. The server
> >> > contains a CategoryCode that I now 'translate' into a CategoryName by
> >> > using a codeblock to lookup the CategoryCode in a reference table.
> >> > This is now working fine.
> >> >
> >> > I separately use a CaptionClick method to reorder the rows according
> >> > to which Caption was clicked. I use the Event from the click to
> >> > determine which column was clicked by examining the
> >> > oEvent:column:FieldSym and then send an appropriate OrderBy to the
> >> > server.
> >> > This worked fine UNTIL I changed the Category column from ..ID
> >> > to ..Name by using the aforementioned CodeBlock. I first thought that
> >> > the solution would be to assign a Hyperlabel when I create the column
> >> > - but that didn't work??
> >> >
> >> > So, my question is, how can I detect that the Category caption was
> >> > clicked (without resorting to using the column number which could
> >> > change in the future)?
> >> >
> >> > Thanks,
> >> > Bill
> >> > --------------------------------
> >> >
> >> > Relevant code is:
> >> > (a) creating the column
> >> > oColumn := bDataColumn{ self:oDCbBrowse, self:server, {|s,oWin|
> >> > oWin:GetCatName() }, #EXPRESSION, self}
> >> > oColumn:Hyperlabel := HyperLabel{#CategoryName}
> >> >
> >> > (b) testing the CaptionClick
> >> > DO CASE
> >> > CASE oEvent:column:FieldSym == #ProductID
> >> > self:Server:OrderBy(#ProductID )
> >> >
> >> > CASE oEvent:column:FieldSym == #ProductName
> >> > self:server:OrderBy( #ProductName )
> >> >
> >> > CASE oEvent:column:FieldSym == #ProductDescription
> >> > self:server:OrderBy( #ProductDescription )
> >> >
> >> > CASE oEvent:column:FieldSym == #CategoryName (This used to be
> >> > #CategoryID)
> >> > self:server:OrderBy( #CategoryName )
> >> >
> >> > CASE oEvent:column:FieldSym == #ManufacturerID
> >> > self:server:OrderBy( #ManufacturerID )
> >> >
> >> > CASE oEvent:column:FieldSym == #ProductPrice
> >> > self:server:OrderBy( #ProductPrice )
> >> > ENDCASE
> >> >
>
> >

From: BillT on
Geoff,
I am not sure what other code you are wanting; the section (b)in the
code included at the end of my original message (after where I signed
off) is the column detection part. Would you like something else?

I put an InfoBox at the start of CaptionClick() to show the #FieldSym
[Symbol2String(oEvent:column:FieldSym)] from the clicked column, but
it is blank for the Category column despite having specified a
Hyperlabel{#CategoryName} for the column.

By the way, what does CTE stand for in your last post?

Thanks again,
Bill
From: BillT on
Geoff,
What I thought are the relevant bits of code are at the end of my
original post after my sign-off. Do you need more than this?
(I know you regularly say SHOW US THE CODE so I did try!) Paragraph
(c) is the column detection part.

I put an InfoBox at the beginning of CaptionClick() so I could see the
#FieldSym [Symbol2String(oEvent:column:FieldSym)] but it shows blank
on the Category column (OK elsewhere), despite having
oColumn:Hyperlabel := HyperLabel{#CategoryName} when creating the
column.

By the way, what does the CTE in your last post stand for ?

Thanks,
Bill