Data Table
pack_ID qty
1 3
1 4
1 9
2 10
3 1
3 3
I want to display the following in Crystal Report
pack_ID qty
1 16
2 10
3 4
How ?
Insert group on pack_id, insert field summary (sum(qty)) into group footer, hide details section.
simple to do in the sql:
SELECT pack_ID,SUM(qty) FROM Table GROUP BY pack_ID
There is one another way to implement this solution is that if you have less pack_id and need to show this details into particular section instead of dynamically to show the sum of each and every records. Below are the steps:
Create formula Qty_Count_Pack_1 which will store the number of quantity with pack_id 1. You need to create number of formula as per number of pack_id.
if ({command.Pack_Id}) = 1) THEN
{command.Qty}
else
0
Use Summary formula field to sum the Qty which will give the summary of qty for pack_Id 1.
Sum({#Qty_Count_Pack_1},{command.pack_ID})
There are 2 steps as:
Insert Group of pack_ID
Copy qty from detail block to Group of pack_ID the same line
so u can see result as u expect.
Related
I wish to display in the group footer the sum of the sold qty column (which is easily done) and then only the last value of the on hand qty column.
I think a variable can do this, but not sure how to do it as I'm new to Crystal and its variables.
Here is an example
Sold qty On Hand Qty
details 1 5
2 3
============================================
GF Total 3 3
============================================
details 6 10
3 7
============================================
GF Total 9 7
Put the field {yourTable.OnHandQty} in the group-footer.
This will show the last detail value and will work as long as there's no suppression on details.
Note: The "last record" is determined by the sort within the group. This means that if the sorting is changed, the wrong value will be displayed.
Yes !! You can do this using variables.
Step 1: Create a Formula Field Named as OnHand
OnHand
shared numbervar OnHand;
Onhand := (Your Table Field) + Onhand +;
Place this one in Details section and suppress it (Right Click
Formula --> Format Field --> Common --> Supress)
Step 2 : Create one more formula to display the result
PrintOnHand
shared numbervar OnHand;
OnHand;
Place this formula in Group Footer
Step 3 : Create one more formula Clear
Clear
shared numbervar OnHand;
OnHand :=0;
Place this formula in group Header and suppress it. (This is to clear the Onhand
Value for every records or group).
I have a data set with 13 rows, each representing a product type. Those 13 products then divided into 3 groups (an image of the data is attached below),
the first 7 products are in Group1
the next 3 products are in Group2
the last 3 products are in Group3
My task at hand is to insert a row that gives the subtotal of the first 7 products (i.e., Group1 in the table), then another row that gives the subtotal of the first 10 products (i.e., Group 1 & Group 2), and the grand total (i.e., all 3 groups). The first subtotal row should be inserted after Group1, and the second subtotal row should be inserted after Group2.
Any advise of how to achieve this would be greatly appreciated!
In the Format tab of menu bar select totals -> add all subtotals
FORMAT -> TOTALS -> ADD SUBTOTALS.
I've got data as picture below, i'm using crystal report to display statistic report from that data.
i want to count MRN which got 2 until 5 rows of episode number only.
currently im doing
1) group MRN in crystal report and count(episode number).
2) create 1 formula like :
if count(episode number) >=2 and count(episode number)<=5 then count(episode number)"
3) put the formula to report and try to insert summary to count that formula, but no selection summary appear for that formula.
Can you give me an idea how to count MRN with 2 until 5 episode only? refer to picture for clear explanation
In Crystal you can use two condition types to sort which records are being showed:
Record selection formula
Group selection formula
Both are located in the menu Report > Selection formulas
In your case you can define a group on field MRN and create a Count field inside that group. To show only groups where the count is between 2 and 5, use the Selection Formula > Group condition in the Report menu.
Count ({EpisodeNo},{MRN}) <=5 and Count ({EpisodeNo},{MRN})>=2
I am making a report in "SAP Crystal Reports" and I need to calculate the sum total of the group field. Report is grouped by user name, I made the "Running Total Fields" field and it calculates all of them as in example below:
UserName 1 2
3
1
-----------
6
UserName 2 1
2
-----------
9 <------- I need here 3
Does anyone know how to solve this?
Thanks in advance.
Two options:
edit the running total field and reset it after each group (it is now generating a total for all records).
use a summarized field - select the field in the details section and choose Insert | Summarized Field...
I would also suggest reading a book on the topic.
hi all i wana ask a question about crystal reporting in vs 2008
lets say i have a report with these data
customer_ID Customer_Name Order_amoont Order_Date
(#group1 VipCustomer)
1 xyz 3 1/1/2010
2 abc 4 2/2/2010
5 sds 21 3/12/2009
(#Group2 NormalCustomer)
3 tyt 2 3/3/2010
4 ha 4 21/3/2009
i want only to display records where Order_Date year is in 2010 only so i went to the section expert and i added a condintion in suppress formula Year(order_Date)=2010 and i get the result ,,the question is how to count how many vip customers ordered in 2010 only and how many normal customer order in 2010 only ,,then i want the total number of both type of customers to be displayed to have a report like that::
customer_ID Customer_Name Order_amoont Order_Date
(#group1 VipCustomer)
1 xyz 3 1/1/2010
2 abc 4 2/2/2010
subtotal 2
(#Group2 NormalCustomer)
3 tyt 2 3/3/2010
subtotal 1
total 3
i know that answer ,and i will answer it
1-make a conditional formula field and add to it this condtion
if year(Order_Date)=2010 then 1
2-then add summary to the formula filed
--to get total place this summary in the report footer
--to get sub-total place this symmary in group footer
there is also another way to do it
by using running total field and it evaluate section us the formula year(Order_Date)=2010
then to get total place the running field in report footer
to get sub-total make a new running field the same as the 1st but in the reset section check on reset of change of group and place this field in group footer
thnx