Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: formula problem Post Reply Post New Topic
Author Message
manho88
Newbie
Newbie


Joined: 09 Mar 2010
Location: Hong Kong
Online Status: Offline
Posts: 6
Quote manho88 Replybullet Topic: formula problem
     Posted: 09 Mar 2010 at 1:25am

Hi All,

 

I have already searched some forum, but still can't figure out what going wrong. Can anyone help me?, please

 

I create a view from access named “StatementReport” and have the following field.

<InvNo>

<CustNameC>

<JobItemNo>

<InvDate>

<JobTypeId>

<JobPrice>

 

I create three parameter as CustName, StartDate, EndDate, then I create a Group to group <InvNo> as the report detail and a Running Total Fields for calculate the total of <JobPrice>.

 

For now the report is fine. Showing the grouped <InvNo> and the total amount of <JobPrice>

 

Then, I want to calculate the <JobPrice> by the condition of <JobTypeId>.

 

First, I create a new Running Total Fields

Field to summarize = StatemetnReport.JobPrice

Type of summary = sum

 

Second, I create a formula as following

 

whileprintingrecords;

 

global numbervar type1_sum :=0 ;

 

if {statementRe.JobTypeId} = 1 then

    type1_sum := type1_sum + {statementRe.JobPrice};

 

type1_sum;

 

After completed the formula, and i press Ok button.

A dialog appear "Warning: Reset/evaluate condition formula contains variables. Do you want to keep it?"

 

No matter i click Yes or No, I still can't get anything display on the field.

 

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Mar 2010 at 7:07am
You do not need all that in the RT formula.As I read this you want a SUM of the process with Rows that have a Job ID type of 1
 
in the RT

Field to summarize = StatemetnReport.JobPrice

Type of summary = sum

Evaluate for = use a formula / {statementRe.JobTypeId} = 1
Reset= (use NEver if you want it for the Report footer and all records or use on a group if you want to palce it in a GF for sums per grouping


Edited by DBlank - 09 Mar 2010 at 7:07am
IP IP Logged
manho88
Newbie
Newbie


Joined: 09 Mar 2010
Location: Hong Kong
Online Status: Offline
Posts: 6
Quote manho88 Replybullet Posted: 09 Mar 2010 at 7:58am

Thank very very very much DBlank

I have spending 8 hours for this,
I can't sleep if the problem not solved, now i can go to sleep.  : )
 
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum