Subject | Please Help with Design Issue |
---|---|
Author | ehandbury |
Post date | 2002-06-06T01:17:04Z |
Hello,
(IBO4_Gc, BCB4, FB1)
I have a design issue that I have been grappling with for some time
and would appreciate some help.
I have to loop thru' a small table and perform some PresentValue
and FutureValue calcs on each row and display the results in a grid.
The results do not get sent back to the server... they are strictly
display-only. In addtion, multiple users could be doing these calcs
at any time. So my series of designs is as follows:
Design #1
---------
I used calculated fields on the dataset to put the calculated
values. This worked but the problem is that I need to use
OrderingLinks/Items on these fields which is not allowed on Calc'd
fields. So Design #1 is out.
Design #2
---------
I created a selectable SP which brings back all required plus a
couple of dummy fields which will hold the calculated results. I was
going to loop around like:
while(!BufferEOF) {
BufferFieldByName("DUMMY1")->Asxxx = Value;
BufferNext();
}
The problem is that (from reading the IBO-FAQ), Buffers are read-
only and the grid doesn't pick-up any of the new values in the dummy
fields. So Design #2 is out.
Design #3
---------
I thought about doing all the calcs in a SP but the problem is that
IB/FB does not have any advanced financial forumlas like
FutureValue/etc. So Design #3 is out. (Although I could create my own
UDFs, but there must be an easier way.)
Design #4
---------
Create a Dummy table which will contain the calculated results. So
I will bring this small table to the client, perform the calculations
on each row, and insert the results into this dummy table. Then the
grid will display this dummy table. This works but is extremely ugly
since it involves writing all results back to the server and there is
the possibility that multiple users are doing these calcs so the
dummy table has to also include the USERKEY of the particular user.
As I said, this works but I hate it.
So... does anyone have a design for this scenario, that works and
is not ugly.
Thanks. Eric.
(IBO4_Gc, BCB4, FB1)
I have a design issue that I have been grappling with for some time
and would appreciate some help.
I have to loop thru' a small table and perform some PresentValue
and FutureValue calcs on each row and display the results in a grid.
The results do not get sent back to the server... they are strictly
display-only. In addtion, multiple users could be doing these calcs
at any time. So my series of designs is as follows:
Design #1
---------
I used calculated fields on the dataset to put the calculated
values. This worked but the problem is that I need to use
OrderingLinks/Items on these fields which is not allowed on Calc'd
fields. So Design #1 is out.
Design #2
---------
I created a selectable SP which brings back all required plus a
couple of dummy fields which will hold the calculated results. I was
going to loop around like:
while(!BufferEOF) {
BufferFieldByName("DUMMY1")->Asxxx = Value;
BufferNext();
}
The problem is that (from reading the IBO-FAQ), Buffers are read-
only and the grid doesn't pick-up any of the new values in the dummy
fields. So Design #2 is out.
Design #3
---------
I thought about doing all the calcs in a SP but the problem is that
IB/FB does not have any advanced financial forumlas like
FutureValue/etc. So Design #3 is out. (Although I could create my own
UDFs, but there must be an easier way.)
Design #4
---------
Create a Dummy table which will contain the calculated results. So
I will bring this small table to the client, perform the calculations
on each row, and insert the results into this dummy table. Then the
grid will display this dummy table. This works but is extremely ugly
since it involves writing all results back to the server and there is
the possibility that multiple users are doing these calcs so the
dummy table has to also include the USERKEY of the particular user.
As I said, this works but I hate it.
So... does anyone have a design for this scenario, that works and
is not ugly.
Thanks. Eric.