I have two formula field "#Total" and "#SalesTaxVlaue",
I have create one more formula field called "#NetAmount"
I want to insert sum of both "#Total" and "#SalesTaxVlaue" in "#NetAmount"
Please Help me..
Doesn't sum({#Total}) + sum({#SalesTaxVlaue}) as content of #NetAmount formula work? If you want to show it on some group footer, then you have to include group name into sum(field, group) expression too.
Or, if I have misread your question and you don't need sum over many rows, then simply {#Total} + {#SalesTaxVlaue} should be good enough :)
Related
I've made a crosstab in crystal report like below:
However, as you can see, the ordering is weirld (i.e. the correct one should be like below:)
And the ordering is stored in another field called order, I took a look in the crystal report's cross-tab expert sorting option, it doesn't allow me to order by another column, it only allows me to sort either ascending or descending, how can I set the ordering by another column?
Crosstab's sorting is based on the rows order, if you want to sort it in your on you have to add some extra rows and have to suppress subtotal and Label in Customize Style of Crosstab Expert
Example:
If you have 3 rows(A,B,C) to display and you have to sort it in order like B,C,A then you have to add 2 new rows(B,C) now your Crosstab looks like (B,C,A,B,C) now you have to suppress Rows B and C you meet your both requirements for sorting and display order
But This solution have some limitations like
if you want to export the report in Excel then it will add extra cells in grand total.
otherwise you are good to go.
Example:
If you have 3 rows(A,B,C) to display and you added one row and you suppress it to solve your sorting issue then in Excel its grand total looks like
A B C
a 1 3
b 2 2
---------------------------
Total: 3 5
Yes, you can not sort on another column. You must use any of one column as a header.
In Crystal report, sorting happened based on header column's value (That's why you see as per alphabetic).
I also face this issue and how I solved, that I am explain. You have to use a formula which have order, but either hide it or use a value like in this link.
https://scn.sap.com/thread/3341846
Second option as per this link. (I think first you check this)
http://www.codeproject.com/Tips/493334/Custom-sorting-for-Crystal-Report-Cross-Tab
https://scn.sap.com/thread/1172741
open crosstab expert, highlight the column that you want to reorder, go to Group Options and select in specified order. This will open another tab where you will have your available values listed there. Using the arrows on the right side you can move up or down your values and accommodate them in the order you want them to be displayed.
Simple way would be take order column from stored procedure to cross tab and set the order according to that column.
Then supress the order column and reduce the width of that column to minimum pixel so that it doesn't appear in cross tab.
Make the field you want to sort by a group field and hide it. To hide it, in the Crosstab Expert > Customize Style dialog select this group then use the Group Options area to Suppress Subtotal and Supress Label. Worked for me.
Use the order field as the grouping column and change the label for said column to show the actual sizes. The labels can be changed in Crosstab Expert, Grouping Options and then the tab Options.
I am wondering if we can sum by item number which looks like sum(quantity, item#) but I don't know if I want it to sum the quantity specific from date A to date B how can i do that. Please let me know if you figured out.
Create a formula field:
//{#quantity}
If {view.date_field} In Date(2013,06,01) To Date(2013,06,30) Then
{view.item_quantity}
Insert a group on the {view.item_number} field (Insert | Group...)
Insert a summarized field on the formula field (Insert | Summary...), specify the group that you just created.
the answer lies within your question, the formula that you have written is called conditional sum.
sum(quantity, item#);
create a formula writing exactly the same thing, but replacing the arguments with the actual database fields which I assume would make the formula, somewhat like this.
sum({view.item_quantity}, {view.item_number});
hope this helps...
I want to change a value of a formula through another formula in Crystal Reports.
I have a problem: i have a string column in DB and is saved for example "Cars" or "Doors" or ..
and on the report i have all the categories written in Normal Textboxes. (Like a RadioButtonList).
and want if the Column is "cars" it will check next to the cars TextBox. (Like a RadioButtonList)
i thought that i make one Formula named main_Categ , and one formula next to each Category TextBox and i will write in the main_Categ Formula
if the Column = "cars" then CarsFormula="1"
else if the Column = "Doors" then DoorsFormula="1"
and so on .
what do you think ?
I think it would be simpler just to have a formula for each checkbox. In each formula simply put: {table.field}='doors' for example. This will return true/false.
Your approach seems to introduce unneccessary complexity.
Each formula MUST evaluate itself.
Create 2 formulas
CarsFormula {column} ="cars"
and
DoorsFormula {column}="doors"
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).
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});