Computed field in a datawindow

How do I make a computed field in a datawindow editable?


0
Shobana
11/18/1998 6:11:52 PM
sybase.powerbuilder.general 62418 articles. 14 followers. Follow

10 Replies
644 Views

Similar Articles

[PageSpeed] 36

You can't. But you can create computed column. It has a tab order. Go to
SQL painter of datawindow, go to computed, place 0 for number type of
editable column, '' for string type of editable column

--
Mahendra Dhamdhere, CPDA
Email:nospam_mahendrad@hotmail.com
Pl. Remove nospam_ from email id

Shobana Juliana wrote:

> How do I make a computed field in a datawindow editable?





0
Mahendra
11/17/1998 3:22:51 PM
>How do I make a computed field in a datawindow editable?
You don't.

If you need for the user to be able to edit a non-DataBase field, then add a
garbage column to the DataWindow.  The user will be able to type in there,
but the value won't be saved to the DBMS.

To add a column, hit the SQL button, then choose "Convert to Syntax" (I
believe off the Design menu).  Add columns as appropriate.  The following
example assumes MSS.
Select table.name,
          table.id,
          "this will be a string column",
          123456780,   // This will be an extra numeric column
          Convert(DateTime, "1998/01/01")  // This will be an extra DateTime
Column

To fake out the "computed field" portion, you can put your calculation code
in the ItemChanged event so that your new columns are set as appropriate.


Dale Fox, CPD

Shobana Juliana wrote in message <#OtqKMjE#GA.151@forums.powersoft.com>...
>
>


0
Dale
11/17/1998 3:28:10 PM
--------------840CAB29D573648C83379EE0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

S. Juliana

It cannot be called a computed-field if it is editable. I do not know
your requirement. But maybe using a computed-column may help.

S Rao

Shobana Juliana wrote:

> How do I make a computed field in a datawindow editable?



--------------840CAB29D573648C83379EE0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
S. Juliana

<P>It cannot be called a <B>computed-field</B> if it is editable. I do
not know your requirement. But maybe using a computed-column may help.

<P>S Rao

<P>Shobana Juliana wrote:
<BLOCKQUOTE TYPE=CITE>How do I make a computed field in a datawindow editable?</BLOCKQUOTE>
&nbsp;</HTML>

--------------840CAB29D573648C83379EE0--

0
Sudhir
11/18/1998 7:47:15 AM
Cngratulations Mr. Fox. You just allowed somebody to break the spine of
encapsulation.
Dale Fox wrote in message <0CGVJTjE#GA.302@forums.powersoft.com>...
>>How do I make a computed field in a datawindow editable?
>You don't.
>
>If you need for the user to be able to edit a non-DataBase field, then add
a
>garbage column to the DataWindow.  The user will be able to type in there,
>but the value won't be saved to the DBMS.
>
>To add a column, hit the SQL button, then choose "Convert to Syntax" (I
>believe off the Design menu).  Add columns as appropriate.  The following
>example assumes MSS.
>Select table.name,
>          table.id,
>          "this will be a string column",
>          123456780,   // This will be an extra numeric column
>          Convert(DateTime, "1998/01/01")  // This will be an extra
DateTime
>Column
>
>To fake out the "computed field" portion, you can put your calculation code
>in the ItemChanged event so that your new columns are set as appropriate.
>
>
>Dale Fox, CPD
>
>Shobana Juliana wrote in message <#OtqKMjE#GA.151@forums.powersoft.com>...
>>
>>
>
>


0
dm
11/18/1998 2:43:26 PM
I could swear that you were being a smart-butt, but as you used the term
"encapsulation" incorrectly, that can't be it.
Try looking up the definition of a word before using it eh?  Encapsulation
means that a programming object hides the inner workings of it's
functions/services and variables, and is sometimes also called "data
hiding".  Unless you're using global functions, DW's are self-contained, and
thus are encapsulated by nature.

I would have agreed if you had said that my suggestion removes DBMS
platform-independence though...

Dale Fox, CPD



dm wrote in message ...
>Cngratulations Mr. Fox. You just allowed somebody to break the spine of
>encapsulation.



0
Dale
11/18/1998 3:27:27 PM
Hello Dear Mr. Fox,
Somebody else, not the recipient of your post, used your answer to pass
datawindow values , without using accessors. I am humbly sorry for the
inconvenience of not pointing out the whole situation but I hope that now it
is clarified. Actually my point is that I read many advices from
knowledgeable people like you which answer to questions like:"I have a
datawindow and I don't like its behaviour, how can I break it ?"
BTW, encapsulation also means hiding the values of the attributes of an
object if I remember correctly(It's true that I have a lousy memory)

DM

Dale Fox wrote in message ...
>I could swear that you were being a smart-butt, but as you used the term
>"encapsulation" incorrectly, that can't be it.
>Try looking up the definition of a word before using it eh?  Encapsulation
>means that a programming object hides the inner workings of it's
>functions/services and variables, and is sometimes also called "data
>hiding".  Unless you're using global functions, DW's are self-contained,
and
>thus are encapsulated by nature.
>
>I would have agreed if you had said that my suggestion removes DBMS
>platform-independence though...
>
>Dale Fox, CPD
>
>
>
>dm wrote in message ...
>>Cngratulations Mr. Fox. You just allowed somebody to break the spine of
>>encapsulation.
>
>
>


0
dm
11/18/1998 3:29:24 PM
>used your answer to pass
>datawindow values , without using accessors.
I don't know what you mean by 'accessors'; hopefully you've solved the
problem.

>Actually my point is that I read many advices from
>knowledgeable people like you which answer to questions like:"I have a
>datawindow and I don't like its behaviour, how can I break it ?"
Programmers never try to use a tool differently than they are supposed to do
they? :)  I've seen a number of those types of questions too...

>BTW, encapsulation also means hiding the values of the attributes
You're right.


Dale Fox, CPD



0
Dale
11/18/1998 5:52:24 PM
My point is: why answer? because sooner or later you'll be forced to
maintain something like this:-(
On the other hand I have to admit that it sounds so egotistical that I
retract everything I wrote. I didn't do it.
Dorin Mera
dmera@shlrmoc.com

Dale Fox wrote in message ...
>>used your answer to pass
>>datawindow values , without using accessors.
>I don't know what you mean by 'accessors'; hopefully you've solved the
>problem.
>
>>Actually my point is that I read many advices from
>>knowledgeable people like you which answer to questions like:"I have a
>>datawindow and I don't like its behaviour, how can I break it ?"
>Programmers never try to use a tool differently than they are supposed to
do
>they? :)  I've seen a number of those types of questions too...
>
>>BTW, encapsulation also means hiding the values of the attributes
>You're right.
>
>
>Dale Fox, CPD
>
>
>


0
dm
11/18/1998 6:40:57 PM
dm wrote in message ...
<snip>
>BTW, encapsulation also means hiding the values of the attributes of an
>object if I remember correctly(It's true that I have a lousy memory)
>
But this isn't strictly possible with a datawindow, is it?  You need to
refer to the column names in order to manipulate them.  So if the name of a
dw column changes, any window that uses it needs to be changed also.
Unless you use column numbers, which makes for unreadable code.

Just my 2d

Simon



0
Simon
11/19/1998 11:24:47 AM
Simon,
It is absolutely true what you wrote. And the datawindow is such a strange
object that Rational in their Rational Rose for Powerbuilder didn't
categorize it(at least in ver 3.0). A datawindow also couples your logic to
the GUI, probably that's why we have datastores now. Dale has a point by
using strictly the definition of hiding the guts of class. On the other
hand, I read lately some discussions about encapsulation where this is
viewed as a quality of preserving the expected functionality of a class. A
datawindow presents real(external) data. If you introduce a fake column you
introduce nonreal data and I know that it is painful to maintain such a
code.
IMHO the first principle of OO is the principle of minimal
astonishment(quoting Grady Booch). So if you deliberately restrict yourself
to the expected behavior of a datawindow you produce more maintainable code.
Dorin Mera

Simon Caldwell wrote in message ...
>
>dm wrote in message ...
><snip>
>>BTW, encapsulation also means hiding the values of the attributes of an
>>object if I remember correctly(It's true that I have a lousy memory)
>>
>But this isn't strictly possible with a datawindow, is it?  You need to
>refer to the column names in order to manipulate them.  So if the name of a
>dw column changes, any window that uses it needs to be changed also.
>Unless you use column numbers, which makes for unreadable code.
>
>Just my 2d
>
>Simon
>
>
>


0
dm
11/19/1998 2:11:33 PM
Reply:

Similar Artilces:

computed field of a computed field
Hello, I made nice datawindow with some aggregate functions to calculate a certain value at a group level. Now I want a grand total which gives me the sum of these values. Unfortunately this does not seem to be possible. So, when I have a computed field which is round (sum(file_field),0) located in the trailer band, I need a grand total of this field in the summary band. Does anyone know how to solve this ? Philip. Philip@acom.be (Belgium) Philip, in the group , you must have created a computed field having expression sum ( file_field ) for group 1 In the summery, y...

Datawindows and Computed Fields
I am using PB 8 and have several formatted datawindows providing reports for the end user. What has been requested of me and I am having trouble with is as follows. I have a datawindow with a nested datawindow. The main datawindow object contains the "parent" record and the nested one contains "child" records. Basically an Agency has subagencies. This report is to be used to create a manual. Where I am having the problem is that the page numbering is done using a computed field placed in the header (or footer or detail for that matter). I need to know the page...

Computed field in Datawindow
PB version: 6.5 A computed field in a datawindow have not a tab order. So, i can�t go to this field and do a 'Copy and Paste' of the value of this field. Thanks... try to use computed column, u can't use computed field for copy & paste as it does not have tab order, it is only for display. ...

Computed Field not computing
I have a series of computed fields that calculate percentages and then a series that total those percentages. When I add the third total percentage field (out of four total) to my group trailer, all my total percentage fields sum to 0 when they should all sum to 100. If I move the third computed field into another band then they all sum to 100 and when I put it back they all still compute to 100. Why would this happen? I know computed fields constantly re-compute, but these are not initially computing correctly based on the number of computed fields present in my group trailer band...

Computing Computed Field
I Have a computed field in tailor band of a group. I tried to sum that computed field in summary band using another computed expression ..It is displaying 0 instead of sum I appreciated any help Thanks Sue IF you use the format sum(x for group 1) in Tailor group then use sum(x for all) in summary. Stephan Donati Fortisoft Corporation "Sue Sambireddy" <SSambireddy@bankofny.com> wrote in message news:3AE83A22.AF41D7BC@bankofny.com... > I Have a computed field in tailor band of a group. I tried to sum > that computed field in summary band using a...

Computing computed field
I Have a computed field in tailor band of a group. I tried to sum that computed field in summary band using another computed expression ..It is displaying 0 instead of sum . I appreciated any help Thanks Sue You can place the expression from the second field in the first one instead of referring to it. Another option (often works) is to apply the GroupCalc DataWindow method (of course outside the expression in the script where you issue Retrieve(), for example.). Sue Sambireddy wrote: > I Have a computed field in tailor band of a group. I tried to sum > t...

datawindow columncount and computed fields
When asking the datawindow for its columns ( object.datawindow.column.count ) it counts only the 'normal' columns and not the computed, How can i build a list of columns including the computed ?? Thanks very much, Rob. Describe("DataWindow.Objects") returns a tab-delimited list of all objects. Parse this, and use Describe("<objectname>.Type") to determine whether it's a column or computed field. Simon -- Simon Caldwell Get Real Systems Ltd Holtby Manor, Stamford Bridge Road, York, YO19 5LL Tel 01904 481999 Fax 01904 481666 Visit ...

datawindow, sum on computed field.
I am trying to create a report for which I have got several group by in datawindow and also I have got few computed fields. Now I want to do sum of the one computed field in trailer band of group. When I tried to do that it says "aggregate functions can not be nested within aggregate function". So it means I can not have sum defined in trailer band for the computed field. Is there any way to do this. Himanshu, you can't sum grouped computed fields in the trailer band as PB as imposed limitations on that. But you can create computed columns and group the data in the dat...

Computed Fields in Nested Datawindows
Our problem is as follows: We have a nested datawindow which has three nested reports: A,B and C. Report A , Report B and Report C have computed fields. I would like to put the sum of these computed fields in the summary of the nested Report. How can I do this with out writing a code or rather how do I refer to these fields in the static datawindow? Thanks, Hemalatha On 24 Nov 2003 20:06:20 -0800, B.Hemalatha wrote: > Our problem is as follows: > > We have a nested datawindow which has three nested reports: > A,B and C. Report A , Report B and Report C have c...

summation of computed fields under datawindow
Just one quick & simple quesion. However, i do get stuck with this for a long time. How can i sum up the total of the computed fields? Example: ComField = sum (A for group 1) where A=column However, at the end of my report, i coded "sum(ComField for all)", i only got "0". Is there anyway syntax to sum the computed fields at the end of the report. Thanks in advance! Joe, You may have over-simplified your example, because you can just create a computed field with the expression "Sum (A for all)" and solve that particular problem. Is th...

Computed field in a N-Up datawindow
Hi Gurus, PB6.5: I have a N-up report with 5 columns; I have to calculate a result based in a column field, but cannot find the way to make a reference to the same column field in the second, third, fourth (and so on) column. gg TIA VM You have to use relative offsets, starting with 0 and adding one for each additional row in the band. So, transaction_date[0] references the transaction_date column in the first row in the band. In your case, you would use offsets 0 through 4 VM wrote: > Hi Gurus, > > PB6.5: > > I have a N-up report with 5 column...

Computed fields in Datawindows with groups
I have a sql data window and I need to get the total of a value from different rows based on another column in that row. Ex. I am trying to calculate PERC in the datawindow itself but can't seem to get the total to divide the individual values by. I have tried using groups and group totals but still can't seem to get the totals (ie total of all MTs , JMTs etc) The computed field within thr groups work correctly but the computed field in the summary band always has a value of 0.Do the group bands and summary bands work differently. count Perc (Computed field) STC ...

datawindow describe and computed fields
Hello, li_max = Integer(dw.Object.DataWindow.Column.Count) for li_col = 1 to li_max ls_colname = dw.describe("#" + String(li_col) + ".Name") next The above snippet of code yields the fields in a datawindow, but does not list computed columns. How do I get computed columns to be listed using the describe statement? -- Mark Schupay Look at dw_1.describe("datawindow.objects") "Mark Schupay" <ssd@zoominternet.net> wrote in message news:B7J4rRcvCHA.199@forums.sybase.com... > Hello, > > li_max = Integer(dw.Objec...

Datawindow computed fields cannot update
Hello!! I create a compute field in which to calculate something like avg(salary for group 1) and name it avg_salary, where salary is stored before in the databse. My problem is when I create another compute field, says max (avg_salary for all), in which to obtain the max. salary from all of the avg_salary, something happen!! The field cannot work! Can you help me?? "PatrickHo" <abc@abc.com> wrote in message news:425471ef$1@forums-1-dub... > Hello!! > > I create a compute field in which to calculate something like avg(salary for group 1) and...

Web resources about - Computed field in a datawindow - sybase.powerbuilder.general

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Intelligent Versus Surrogate Keys
Should I use business columns as primary key fields for tables in thedatabase, or generate artificial primary key values? When business-related ...

chevy volt
ProEXR File Description =Attributes= channels (chlist) compression (compression): Zip dataWindow (box2i): [0, 0, 5119, 2475] displayWindow (box2i): ...

Enable - A comprehensive solution for the localization of PowerBuilder applications Untitled Document ...
Enable is localization/ translation tool used by PowerBuilder developers to make their applications multilingual.Enable is a powerful tool that ...

comp.lang.clipper.visual-objects - Google Groups
comp.lang.clipper.visual-objects 1-20 von 33006 Themen werden angezeigt Integrity of a file marcosm...@gmail.com 09:35 Combobox value Lu 08:12 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
Developers can choose Win32 or newer style .Net development

PowerToTheBuilder - PowerBuilder UI Controls
HOME - COMPONENTS - PB UI DESIGNER - DOWNLOAD\PURCHASE - SUPPORT - FAQ - ABOUT Take Control of your UI with PB Ultimate Suite PowerToTheBuilder.com ...

Beautiful iPad Mini 3 Concept Reimagines Apple’s Tablet With iPhone 6 Design, Gold Color [Images]
The iPhone 6 may be grabbing all of the recent headlines due to its impending announcement, but spare a thought for those who prefer to stay ...

Java Networking - Real's HowTo
Real's HowTo Custom Search Java Language String and Number Applet AWT Swing Environment IO Javascript interaction JDBC Thread Networking JSP ...

Business Intelligence Products - Database Management, Data Warehousing & Mobility Software - Sybase Inc ...
Sybase offers a variety of Business Intelligence (BI) software like products for database management, data warehousing and mining, data integration ...

Resources last updated: 12/18/2015 9:38:30 AM