cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports XI - How to create a new field using a formula field

Former Member
0 Kudos

I'm quite new to CR, but have been learning quickly!

I would like to know how to automatically create a new record/field based on another field in that row...

I have a report showing the following data:

Run Code Start KM Stop KM Status

H2 100 150 Partial

H2 150 155 Partial

H2 155 160 Partial

S3 120 150 Completed

The status is generated by comparing the 'Start KM' and 'Stop KM' against fields in another table called 'Start Odo' and 'Stop Odo'

In this example...

H2 has 'Start Odo' and 'Stop Odo' values of 90 to 160, therefore there is still 90-100 to check. The 'Start KM' and 'Stop KM' is equal to the 'start Odo' and 'stop Odo' for S3, therefore it shows completed.

My question is how do you create a formula field, which will add an entire row...displaying the values 90-100.

I've been trying to use a conditional check in the 'Start KM' column, that sees if status is equal to partial than if start km is greater than start odo (Which is the reference km) then display the value of start odo in the new row. I'm stuck at how to create a new row.

I want the final result to look like this...

Run Code Start KM Stop KM Status

H2 90 100 Partial

H2 100 150 Partial

H2 150 155 Partial

H2 155 160 Partial

S3 120 150 Completed

Any suggestions would be more than appreciated

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Adi

Looking at your examples it seems that you want to add a row to the existing recordset (rows fetched from the database).

If it is the case (even if based on a formula) then you can not do it within crystal. Crystal is designed to display data and ideally it should not generate the new data.

However, as per your requirement you can try to add this logic at database end. May be a command object within Crystal Reports can help you.

Let me know if you do not understand anything.

Regards

Nikhil

Answers (1)

Answers (1)

Former Member
0 Kudos

Please explain this statement once again

"H2 has 'Start Odo' and 'Stop Odo' values of 90 to 160, therefore there is still 90-100 to check."

Thanks