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.
Related
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
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.
Is it possible to fix the height of page header or any other solutions?
My problem is I need to do this list of persons in page header
Boy Janna
Girl Leo
Ana Erick
Mina Carlo
Lea Shena
But it must be like this
(for page 1)
Boy Janna
Girl Leo
Ana Erick
(next page)
Mina Carlo
Lea Shena
If number of person is 6 or lower it will only appear in first page (if two page report the second page must have blank person). If the number of person is more than 6 the number 7 person and up will appear to next pages and so on.
The maximum row is 3 per page
This Sub report is in Page header in main report
I put this code in supress of Sub Report for Persons. If I don't tick the Can Grow and adjust the text box (it only shows 6 names) and other names are now missing and not appearing in the next page. If I tick can grow and remove the below supression code what happens is it shows repeated name each page.
if PageNumber = 1 then
false
else if PageNumber = TotalPageCount then
true
else
true
Thanks in advance
yes you can do it in group header or footer and the process you followed won't give you correct results. Follow below process.
In grouper header or footer take a sub report and place only those fields in the sub report that you want to display.
In sub report place the field in detail section and then go to
Right click Details --> section expert --> paging --> tick the check box visible records
In the space provided input number of records you want to view per page and no go to preview.
You can see those many records per page in group.
This is working solution I tried group header and group footer of a group.
Let me know if you face any issue.
I'm using Jasper iReports 5.2.0 and I want to print a list on odd pages of the report and a static text on the even pages.
To achieve this I created a report with my query of a list with 100 sequential rows and put it in the Detail 1 and my static text in Detail 2.
Then I added:
Print When Expression = $V{PAGE_NUMBER}%2 != 0 to Column Header and Detail 1
and Print When Expression = $V{PAGE_NUMBER}%2 != 0 to Detail 2
and also maximized Detail 2 Band Height (without this I will loose more rows)
Everything show in the right pages but report aren't showing all rows.
I mean, if my query return 100 rows, 1-100
1st page show 1-20
2nd page show static text
3rd page show 22-40
4th page show static text
5th page show 42-60
...
What should I do so that row be printed in the right page?
You should do the following:
Create 2 Detail Bands:
a) Detail1 - For static even pages (!make sure this detail band is first). Maximize it's size - to use whole page, put your static text on it. Set PrintWhenExpression = $V{PAGE_NUMBER}%2 == 0 on band
b) Detail2 - For your data, do not use any PrintWhenExpressions on it
How it works: wholepage DetailBand1 is shown only on even pages, because it takes whole page, your data detail band (Detail2) is moved to even page, so everything works as expected, and no records are missed.
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