Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i display a formula fied based on each change in the data base

Status
Not open for further replies.

urgent72

Programmer
Jun 3, 2004
15
US
HI,
I have a report that i am working in crysatl reports 10.
What the report has is four different records namely

Header
-IHS Details1
Details2
Trailer
So i have created 4 different formulas for each type of record and iam manipluating the data in these formulas for each record.
The problem i am having is The management want the unique IHS record to be displayed for all the database records when ever there is a change in on of the fields in particular the field is BAN.

Currently i am putting the IHS formula field in ReportHeader and it is being displayed only once.When i put in Detail section it is being displayed for each and every record.
What i am looking is it should be displayed only oncefor each Ban and there can other detail records for that BAN
and when ever a new ban value comes in the IHS formula record should be displayed only once.
I did not know how to put in the section expert as this formula field is not being displayed.
Any suggestions from the EXPERTS and Crystal GURUS in here
Please help.
 
Try inserting a group on your BAN field and then place the IHS formula in the BAN group header. For further help, you should provide the content of all formulas and the section in which you are placing them.

-LB
 
HI,

I tried grouping with bill.statement_no and place the formula field in the group hearder but i am still getting the records being displayed for each and every record.Do you still need to know all the fields that are being calculated in this formual??
 
HI, The IHS formula that i am using looks like this
WHILEPRINTINGRECORDS;
Stringvar v_ihs:='IHS';
NUmbervar v_ihslen:=len(v_ihs);
Stringvar v_custno:=trim({@f_custno});
Numbervar v_custnolen:= len(v_custno);
Stringvar v_invno:=trim({@f_invno});
Numbervar v_invnolen:=len(v_invno);
Stringvar v_custname:= trim({EV_4.SUBSTR(BAN_LIST.COMP_BILL_NAME_LINE2,1,40)});
Numbervar v_custnamelen:= len(v_custname);
Stringvar v_invdate:= (trim(totext({@f_invdate})));
Numbervar v_invdatelen:=len(v_invdate);
Stringvar v_invtot:=trim(totext(totext({@f_inv_tot})));
Numbervar v_invtotlen:=len(v_invtot);
Stringvar v_fdrltax:=trim(totext({@f_frdltax}));
Numbervar v_fdrltaxlen:=len(v_fdrltax);
Stringvar v_statetax:=trim(totext({@f_statetax}));
Numbervar v_statetaxlen:=len(v_statetax);
Stringvar v_othertax:=trim(totext({@f_othertax}));
Numbervar v_othertaxlen:=len(v_othertax);
Stringvar v_surchargetax:=trim(totext({@f_surchrgtax}));
Numbervar v_surchargetaxlen:=len(v_surchargetax);
Stringvar v_filler=' ';

Stringvar v_term:='X';


if v_ihslen < 3 then v_ihs:=v_ihs + ReplicateString(" ",3-v_ihslen)
else v_ihs:=v_ihs[1 to 3];

if v_custnolen < 10 then v_custno:=v_custno+ReplicateString(" ",10 -v_custnolen)
else v_custno:=v_custno[1 to 10];

if v_invnolen < 10 then v_invno:=v_invno+ReplicateString(" ",10 -v_invnolen)
else v_invno:=v_invno[1 to 10];

if v_custnamelen < 40 then v_custname:=v_custname+ReplicateString(" ",40 -v_custnamelen)
else v_custname:=v_custname[1 to 40];

if v_invdatelen < 10 then v_invdate:=v_invdate+ReplicateString(" ",10 -v_invdatelen)
else v_invdate:=v_invdate[1 to 10];

if v_invtotlen<14 then v_invtot:=v_invtot+ReplicateString(" ",14-v_invtotlen)
else v_invtot:=v_invtot[1 to 14];

if v_fdrltaxlen<14 then v_fdrltax:=v_fdrltax+ReplicateString(" ",14-v_fdrltaxlen)
else v_fdrltax:=v_fdrltax[1 to 14];

if v_statetaxlen<14 then v_statetax:=v_statetax+ReplicateString(" ",14-v_statetaxlen)
else v_statetax:=v_statetax[1 to 14];

if v_othertaxlen<14 then v_othertax:=v_othertax+ReplicateString(" ",14-v_othertaxlen)
else v_othertax:=v_othertax[1 to 14];

if v_surchargetaxlen<14 then v_surchargetax:=v_surchargetax+ReplicateString(" ",14-v_surchargetaxlen)
else v_surchargetax:=v_surchargetax[1 to 14];
v_filler:= v_ihs+totext({@f_custno})+totext({@f_invno})+({@f_custname})+v_invdate+totext({@f_inv_tot})+totext({@f_frdltax})+totext({@f_statetax})+totext({@f_othertax})+totext({@f_surchrgtax});
Numbervar v_filler1:=len(v_filler);
if v_filler1 <579 then
v_filler:= totext(v_filler + ReplicateString(" ",579-v_filler1));

v_term:=v_filler+v_term;
v_term;

 
You should probably place the formula in the detail section and then place the following formula in the group footer for BAN:

whileprintingrecords;
Stringvar v_term;

Then suppress the details by going to the section expert (format->section)->details->suppress.

I don't have a clue what you're trying to do with this elaborate formula, but I will guess that you need a formula to reset these variables, which should be placed in the group header.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top