Replace formula in Crystal Report - crystal-reports

How to correct this formula in Crystal Report Design?
WhilePrintingRecords
formula = Replace ({Command.Comments},"Based On ","")
OINV.Comments
Remarks:
ABC XXXX. Based on Sales Order Number
to be printed as Based on Sales Order Number
Kedalene

Related

This field cannot be summarized in crystal report errors

I was be able to output a crystal report and this is about accounting logic.
some of the column appear in my crystal report is eg.
accountname debit credit
cash..........1000...300
I want the column debit minus column credit (1000-300)
if the result is positive (+) then 700 will appear in that debit column
If the result is negative (-) then the value appear in credit column and i wan to remove the negative sign. So above value 1000 and 300 is not what i wan to show and debit or credit will be 0 eg
accountname debit credit
cash...........700......0
Above case is ok so far and now i end up like this
In crystal report formula editor i have #creditbalance, and inside it has formula:
if Sum ({Entries.Debit}, {Entries.AccountName})>Sum ({Entries.Credit}, {Entries.AccountName}) then
formula= Sum ({Entries.Debit}, {Entries.AccountName})-Sum ({Entries.Credit}, {Entries.AccountName})
end if
So it can give me as i wanted to show (the 700 and 0 part)
The problem is i create another formula
#TotalDebitBalance
Sum ({#DebitBalance})
It error said "This field cannot be summarized", Then how to sum up the value i get from #debitBalance.
Note: #TotalDebitBalance i plan to put it at report footer section where all grant total usually placed there, where #debitbalance i put it at Group Header section.
Right click the report.
Insert.
Summary Fields.
Select the formula you have done on the field and change from max to sum
Change Location to Group Footer
Do the same again and this time select the Report Footer
You will have two fields, one for the group footer and other for report footer, hope this helps.
It doesn't say but I'm assuming the report is grouped by {Entries.AccountName}. In addition to Waqar's solution, I'd replace the formula with something easier.
{#DebitBalance}
IF {Entries.Debit} > {Entries.Credit} THEN
{Entries.Debit} - {Entries.Credit}
ELSE
0
{#CreditBalance}
IF {Entries.Debit} < {Entries.Credit} THEN
ABS({Entries.Debit} - {Entries.Credit})
ELSE
0
In the details section, replace the {Entries.Debit} and {Entries.Credit} with {#DebitBalance} and {#CreditBalance} repectively. This will give you the
cash...........700......0
Then do as Waqar mentioned to summarize the formula. It's easier to use the Group... and Summary... features than to do it manually in the formulas.

Calculate Sum In Crystal Report

I am working on Crystal report 2010 and I have Header group for each Bill detail.
It's working fine but how To Calculate sum for each group in Crystal Report?
Right Click on Field which u want to sum,
And insert Summary ,
Then in summary Loaction Field , Select the Group
THus u can solve ur problem

Formula to Sum "amount" column in Crystal report

I have a column name as "Amount" in CR. I need to sum that column.
I created a new formula and tried sum( { MycolumnName} ) and it says
"A number field or currency amount field is required here"
Is there any way to apply conversion in formula itself.
Why create a formula when you can just create a summary field by selecting your column and going to the menu and selecting Insert Summary, Insert Subtotal or Insert Grand Total depending on your needs? You can place the summary field in a group section as a subtotal, or in the report footer as a grand total.
If you need to apply a conversion in the formula, you can use CCur like this:
sum( CCur({ MycolumnName}) )
More information on converting types in Crystal Reports can be found here.
Change the type xs:string to xs:decimal of the column MycolumnName in xs:element in .xsd page

Crystal Reports Xi - Sorting a CrossTab Report by a Summary Field

So I have a simple crosstab report that calculates number of sales in the columns, and the rows are each office. The last column on the right is a total column, which contains a summary field (via a count of the identity field) that adds up the total number of sales per office.
How can I sort the crosstab data so the office with the most sales is the top row, and the rest in order under it?
Try this: Right-click on the crosstab. Go into the Group Sort Expert menu. There you will see options to display the top N rows, Sort All by the aggregate of a field of your choice, etc.
(I'm using Crystal XI. If your version is different, this may not work exactly)

Crystal Reports: Is it possible to sum for more than one column?

I work on an accounting project in .NET.
I want to sum all transaction and its opening balances.
I use summary but it Allows only one column..
You can summarize within formulas, so long as the formula field is present in the report footer. When using Sum() CR knows to evaluate the expression for all records returned.
So you would create a formula for the report footer, and the formula code would be something like:
Sum({#TransactionAmt1}) + Sum({Transactions.Amount}) + Sum({#AnotherFormula});