Crystal Report: Get Minimum Date - crystal-reports

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/

Related

calculating the percentage based on the number of records in the 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.

Crystal Report how to change the display order in a group

I have a crystal report like below image:
The report is group by "Quot No.", by default it's ordered by "Times Used" (8th column)
How can I change the ordering so that it will order by "Total amount"?
The total amount is a field in the report which is the sum of a field named "quotamt" in the datasource:
I've tried looking in the change group options, took a look at the "Use a formula as group sort order", but the formula only provides three options (ascending, descending, original order), and is unable to sort by another column
The desired result is:
How can I do that?
What I suggest, rather than doing this task in crystal report, good to done at sqlserver side means database side.
This is simplest suggestion when you have this type of situation.
You can give the condition on sqlserver side too. and get the data order same as you want.
Yes, this can be done in report side, but it take time for this.
Don't use formula as group sort order instead from the dropdown use Specifed Order and in the window specify the order you need

Crystal Reports Record Selection and Summary Field conflict

I am really new to Crystal Reports and I am looking for any suggestions on how to approach the following issue:
I currently have a report that uses a record selection to limit the results by date. I would like to include in this same report a summary a total count of all the records (ignoring the record restriction). Unfortunately (although somewhat expected), the summary calculates the total after the record restriction is applied. Is there any way to get around this? In case my question is a bit unclear I've included a generic example below:
I have a report that pulls info from a database with a total of 10 records.
I select a specific date range, and it only returns 3 records
I would like to include in the report footer that 3/10 records are getting returned.
This is bit tricky to perform in crystal reports as record selection is compulsory applied. However you can overcome this by using sub report.
Calculate the report footer using report.
This will surely work

How do I do a CR-type formula in SQL Server Reporting services?

In Crystal Reports, I could define a formula that would evaluate for each detail line. For example, if I had a query that would return a PatientId, an ObsTerm name, and an ObsTerm value, I could define a formula called {#Hispanic} that had the value:
If {Command.OBSNAME} = "HISPANIC" Then
{Command.OBSVALUE}
Else
" "
Then, in the group footer, I could take Maximum({#Hispanic}, {Command.PATIENTID}) to see if I had gotten a value returned for the patient's ethnicity - either I'd get the value (assume only one, since that's how I built the query) or a blank.
I'm trying to convert a CR report over to SSRS 2008R2: how would I do the above? Thanks.
Add a calculated field to your data source (called 'Hispanic' or whatever) with a formula of:
=IIF(Fields!OBSNAME.Value="Hispanic",Fields!OBSVALUE.Value,"")
In your report, add a parent group to your detail row and type [Max(Hispanic)] into a field in the group row. You may then want to hide the detail row and show only the aggregate data. I think there's probably a much easier way to do what you want but it's not clear from your question.
I made the transition from Crystal to SSRS and it is a hard road. You need to unlearn all your Crystal (especially formatting).

Crystal Report-Running Total

I have a problem with running Total in Crsystal report9
if their is no values available for a Paticular field how can we return the running total as '0'
Instead of display the Running Total directly in your report create a Formula Field based on the Running Total and drag it into the report.
Your formula should look like this (Crystal Syntax)...
if ISNULL({#RunningTotalField}) then
"0.00"
else
ToText(RunningTotalField, 2)
If there is no data for that particular group, then Crystal won't show it easily. Your options are :
1) Use subreports to display the values for a particular group, and keep the main report just looking at the table(s) containing the group headers.
2) Use a stored procedure as the source so you have full control over the SQL that is run.
The problem is that as soon as you use a field to group, Crystal will only return records where that field has been used. If it was simply in the Details section you could modify the link to a LEFT JOIN and it wouldn't matter, but the group forces the INNER JOIN which means the groups without data are not returned.
Unfortunately Running Totals don't show up if there are no records that match your criteria. An alternative is to use a set of formulas calculated in various sections of the report. The technique is widely described in the Crystal literature. For example, this TekTips gives a very succinct overview of your options.
You set up an initialising formula in each header, with the evaluation time directive "WhilePrintingRecords". This approach was the only one available for doing running totals in the "good ol' days" before RunningTotal objects were available.