crystal report - Subtract result for each item - crystal-reports

On Crystal Report, I want to show
My_Qty, which is {Table.1st_Qty}-{Table.2nd_qty}, for each item.
My desired outcome is
Item 1 5 0 5(My_Qty_1)
Item 2 6 0 6(My_Qty_2)
But my current CR shows
Item 1 5 0 11
Item 2 6 0 11
Is there anyway that I can adjust {Table.1st_Qty}-{Table.2nd_qty} to print out what I want?
I have tried 'Running Total Fields' but no luck. I've been googling around but can't find an answer for my case.
Thank you so much in advance!

use whileprintingrecords:
It will do sum while reading data from start to end.

Related

How to I separate numbers?

How do I separate a combination of numbers AND move them into specific cells based on their variable?
For instance Cell A! contains the numbers: 3, 4, 10, 58, 26
Title tabs are: 0>2 3-18 19-54 55+
I want each number for over 10,000 lines to be moved so that I do not have to do it manually. Is there a way?
I've tried to what if but I am not an expert on this particular kind of problem.
If this is in Excel and your table looked something like this at the start
#A 0>2 3-18 19-54 55+
3
4
10
58
26
Try putting something like this in each cell under each title, then copy all the way to bottom of columns.
=IF(AND(A1>0 ,A1<3),A1,0)
=IF(AND(A1>2 ,A1<19),A1,0)
=IF(AND(A1>18 ,A1<54),A1,0)
=IF(AND(A1>54),A1,0)
Result will be the number in col A1 moves or a 0

How to hide a particular row in croostab in jasper report by passing a value as true or false?

I have a croostab in which based on requirement I have to hide a particular row value. How can I do this?
Suppose there are 4 rows -
apple bengaluru 5
samsung delhi 7
vivo mumbai 8
xiomi chennai 6
Sometimes I have to hide the 2nd row and sometimes 3 or 4 based on passing a value true or false.
You can use printWhenExpression attribute
To print the row only when the report parameter myBoolean is true :
<printWhenExpression><![CDATA[$P{myBoolean}]]></printWhenExpression>
If you want to hide it without removing its place from the page, see this thread

Multiple Grid in Crystal Reports in Group Head

I want to have the following result out of my data:
Header 1 Header 3 Foo 11
Car 1 Foo 1 Foo 12
Car 2 Foo 2
Car 3 Foo 3 Header 4
Car 4 Foo 4 Bar 1
Car 5 Foo 5 Bar 2
Foo 6 Bar 3
Header 2 Foo 7 Bar 4
House 1 Foo 8 Bar 5
House 2 Foo 9
House 3 Foo 10
I cannot do it in details section with the Format with multiple columns because I need to group some values for the group headers.
Is it possible to get the result above? With breaks to the next column as you can see in the group with the "foo" and not break to the next site.
I am using Crystal Reports 11.5 and I tried it with subreports (they allow no break column).
Solution:
As Chris said here, I tried it with "Format Groups with multiple columns" in the Details area and I removed the duplicates with the following formula in "surpress" in details area:
if({#counter} = 1) then
false
else
{#var}=previous({#var})
where counter is a counter for the type I want to display, in my case it were ids of people. The counter is needed to display the first dataset, otherwise it is surpressed too.
Have you tried "Format Groups with multiple columns"?
It's an option visible in the Layout tab of the Section Expert after you select "Format with multiple columns" on the details section. See this documentation and look at the image about halfway down the page to see it in the dialog.

Remove pageheader ad page footer from crystalreport

i must print a report from my application like this :
section1(reportheader)
section2(pageheader)
section3(detailes)
some data
....
...
....
section4(report footer)
section5(page footer)
in design area ,i set distance between section1 and section2 to zero,and between section2 and 3 and section 4 and 5 to zero too,but when i tried to print i got 2.2 cm gap from header and 2.2 cm gap from footer and my print messed, how do i remove this white spaces from my page?
In Design view Right Click on the section you need and Select "Suppress". So the sections you suppressed will not be visible in your report.
Try this and get back with your results.
i done this all,my sections of header and footer became gray, but nothing happened,for more information: my page size is h:42,30 V:55 and it has no margins. i checke off the noprinter .... and i chosed my printer model Epson LQ 2190 ESC/P2 my repoort is for a raw form that in every row it has five block that every bloak paced by some information ,my paper size is for five row of this blocks, still, now in my header's report i got 2.2 cm white space and after 4 row printing , i got 2.2 cm in footer and between row 4 and 5 i got 4.4 cm free space

How to show $0 in edit running total in crystal report when using condition?

editing running total i use condition equal to true or false.
it is normal that it is blank in report,
but do not know how to show $0 when it is null and where to add formula
create formula field
iif(condition, something, 0)