calculating the percentage based on the number of records in the crystal reports - crystal-reports

In my crystal reports I have a field called "PAYMENT" it has to be displayed according to the following requirement
REQUIREMENT
if there is only one RECORD in detail section then it has to display,
PAYMENT=percentage
if there are MULTIPLE RECORDS in detail section then it has to display,
PAYMENT=percentage+(percentage(total value)+remarks)
can anyone please tell me how to do this?

You can use the following formula in CR to count the records
CountRecords
Count ({Table.PAYMENT})
PaymentDisplay
Then create another formula with your decision making:
If COUNT FORMULA = 1 then DISPLAY OPTION 1 else DISPLAY OPTION 2
I have not tested this but it should work.

Related

Crystal Reports set record number in formula

Would anyone know of a way to manually specify a record number within a formula, in Crystal Reports?
For instance, I have a report linked to an SQL server View that sits on top of a table that contains 20 records. This view selects the fields I need and then orders by the highest value to the lowest.
The report then pulls these records into the report in that order. What I would like to do is to be able to write a formula that can select a record based on its number.
I know I can reference RecordNumber in a formula (i.e. If RecordNumber = 5 Then...) but this only works in the Detail section once it actually shows record number 5, and if I place a formula in the header section it just displays False as the header only shows the first record.
I need to create a formula that sets the record number and then displays the desired value of that record number in the header (i.e. something like:
Set RecordNumber = 5
ToText ({table.value})
Can anyone help or is Crystal just not that sophisticated?

Crystal Report: Get Minimum Date

I have this concern using Crystal Report which I am not really familiar with. Here's my scenario:
I have an existing report to update, I need to add a column (ETA) which has a datetime value. It may return more than one rows per Item No, I need to get the minimum date only per Item No from the result rows.
I already tried some solution mentioned here http://scn.sap.com/thread/1952829 but found no luck.
I used a suppression formula for the Details section of the report, but haven't succeeded yet.
IF {TableName.DateField} = Minimum({TableName.DateField}) THEN FALSE ELSE TRUE
Any possible things you can suggest me to try? Thanks in advance for this :)
good to get this value from sqlserver side. you just create a function which return a single data (minimum date).
If you wish in crystal report side, it is something you make loop of hundred for a single row display. You can use running total field for this.
Select the field , select summary type and put into the detail section.
or you can create a formula with group name option like
Minimum({TableName.DateField})
http://scn.sap.com/thread/1952829
http://businessintelligence.ittoolbox.com/groups/technical-functional/businessobjects-crystal-l/unable-to-filter-based-on-the-first-date-in-list-of-dates-4912881
please check
Running total field gives options for Min, Max, etc. but not Sum
http://flylib.com/books/en/4.229.1.28/1/

How to calculate % with count base on condition?

I use crystal report, my report have 2 fields : man=3 and woman=4. I want to calculate % man? with formula field. I try count({person.sex},"man")*100/count({person.sex}) but show Error "A field is required here"? Help me!
Take 2 running total variable, put into the group footer or appropriate section (preferable on any footer- report footer will display total percentage, not group wise) and give condition as you want or check below links.
Using a Running Total in a Formula in the Details Section of a Crystal Report
How to sum running total field for each group in crystal report?
http://community.spiceworks.com/topic/117306-crystal-reports-won-t-summarize-or-running-total-my-formula-field
please check this link
http://crystalreportsblog.com/crystal-reports-running-totals/
http://www.experts-exchange.com/Database/Reporting/Crystal_Reports/Q_28044491.html

Crystal Reports is grouping by default

I have a crystal report with three columns. I want to display all the records and a total in the last row. However, my crystal report is grouping by default. I am confused
This is how I do it in the CR.
This is how it shows
Thi sis how i wanted
I want everything in a single table and a one toal for each. Why is it grouping this way? Any help would be appreciated.
EDITED
Below is how i arrived at the TOTAL
Formulas
O/S BALANCE := amount - collected.
OSBALANCE TOTAL := SUM{#O?S BALANCE});
COLLECTED TOTAL := SUM({colection})
Add a cross-tab object to the report's footer section. Use the OS BALANCE field for the rows field and the COLLECTED for the summarized field.
See that is where it makes the difference in crystal reports. I will suggest one thing place OSBalance in detail and put the total in report footer and let me know the result

Addid Static Report Titile on Crystal Report

i have faced some problem , when i want to display some static Title after i have displayed a few number of Rows . for Example , the first 4 rouws on crystal Report has header"Training " the next 4 rows mmust have "Education " Report Header.
i am trying to display the report using by calling one Stored Procedures any one who can help me please??
You could insert a new detail section above your current detail section and have the new section only be visible based on record count or some value in the data. Add a new section in the details, Format Section->Suppress and enter a formula controlling when the new section is visible. For example, a running total field named InspIDCount and this formula in the suppress section ({#InspIDCount} mod 5 <> 0) will cause a blank row every 5 records. The new section could contain a formula to display the correct "title".
I think I misunderstood your question. The number of rows for each type is probably not constant. A better way to handle this would the to insert a group into your report if the data is not already grouped. Group by the record type (Education, Training Etc). You probably want to suppress the group header but show group by footer. The footer could display a field from the database showing the type or it could display a formula (string) based on the record type. It would only take a few minutes to give this a try.