Actually I am generating receipt and it looks like this in 2 columns:
-------------------------
| Receipt 1 | Receipt 2 | // Group Header Section for Receipt-No
|_______________________|
| Item 1 | Item 1 | // Group Detail Section
| Item 2 | Item 2 |
| Item 3 |------------
------------- Receipt2 |
| Receipt1 | Total | // Group Footer Section for Receipt-No
| Total |___________|
|____________
When number of items in Detail section are not equal then Group Header-Footer are not displayed in the same line.
How its possible to achieve it in this way:
-------------------------
| Receipt 1 | Receipt 2 |
|_______________________|
| Item 1 | Item 1 |
| Item 2 | Item 2 |
| Item 3 | |
-------------------------
| Receipt1 | Receipt2 |
| Total | Total |
|_______________________|
Is it possible for you to put the totals and header in different sections from that of item details. This should result in the the totals showing up aligned as expected.
If you are asking help on Crystal Report and it's a design problem, please show your design better, we need to see the lines and the details between each section to help you well.
To achieve what you want, the lines for your Group Detail section needs to be until the beginning of your Group Footer section. ( the line must begin in the GroupDetailSection and finish in the beginning of the GroupFooterSection )
Related
I'm working on an existing report created using Crystal Reports.
In this report, a new column was added, but, the value of the column/row surpasses the default design of the report.
NOTE: The following example is in the "Details section" of the report
and is equivalent of the rows of a table.
Example:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
| Item 2 | Text 2 |
|___________| Text 3 |
| Item 3 | Text 4 |
| Item 4 |________________|
|___________| Text 2 | // Row 2 - might be bigger "height" than "Name" column.
| Item 5 | Text 1 |
| Item 6 | Text 2 |
|___________|________________|
The desired rendered result is:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
| Item 2 | Text 2 Text 3 |
|___________|________________|
| Item 3 | Text 4 | // Row 2
| Item 4 | |
|───────────|────────────────|
| Item 5 | Text 2 | // Row 3 - all rows / columns has appropiate design size.
| Item 5 | Text 1 |
| Item 6 | Text 2 |
|___________|________________|
I had tried:
Removing box objects: the original report uses them for set a black border on the "details section" - resulting in the example above.
By removing the box objects, I set the border of the data fields - or textboxes - directly. This leads to border lines didn't increase/expand to the next row.
Example of the modification made - described in the point # 2 - not consistent design:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 2 | Text 2 | // Row 2
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Text 3 | Text 3 | // Row 3
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 4 | |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 5 | Text 1 |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
| Item 6 | Text 2 |
|___________|________________|
Use the "Can Grow" option for each datafield - no results adjusting the size of the other columns to be the same as the "Worker type" new column.
Search on internet and here, in Stack Overflow: no results so far.
I don't know how to proceed for set the same size for all datafields/textboxes in the report.
Is there a way to set all files to have equal size in Crystal Reports?
After search deeper in both Google and in Stack Overflow (and honestly, after a weekend break), I found the solution:
In this answer says:
Do not use borders of text box to make cell borders, instead use lines
to create borders one horizontal line above the text boxes and one
below the text boxes. both lines having width long as the detail
section. and for vertical borders use vertical lines. that starts from
top of group header section and ends at bottom of detail section. now
when the height of cell increases when the content is large then all
the rows will be set accordingly.
This this in mind, I have to use the "Line Object" and draw the lines that divides the rows, then, by selecting the lines drawn and press "Format Multiple Objects", I marked/checked these two options on the Line - Format Editor window:
Extend to Bottom of section when Printing
Repeat on Horizontal Pages
I think the first one is the one who makes the "magic" - i.e, extending the line, but, just to be sure, the second option should be marked too.
After these changes, I did get the desired result:
____________________________
| Name | Worker type | // (Worker type) is the new column
|___________|________________|
| Item 1 | Text 1 | // Row 1
| Item 2 | Text 2 Text 3 |
|___________|________________|
| Item 3 | Text 4 | // Row 2
| Item 4 | |
|───────────|────────────────|
| Item 5 | Text 2 | // Row 3 - now all rows / columns has appropiate design size.
| Item 5 | Text 1 |
| Item 6 | Text 2 |
|___________|________________|
Trying to group dynamically depending on the field I sum using Summary. Example: table looks like
Person | Date 1 | Category 1 | Date 2 | Category 2 |
John | 1/1/2010 | minor | 1/1/2015 | major |
Paul | 1/1/2010 | minor | 1/1/2015 | minor |
I want to group dynamically by [major; minor] using sum of entries, like:
| 1/1/2010 | 1/1/2015 |
major | 0 | 1 |
minor | 2 | 1 |
This is a simple example but there could be dynamic categories from the input dataset, not just 2 hardcoded values.
Not sure if this is possible in Crystal Reports.
Thanks!
pals!
I have a very special requirements for my report. Let's look at report at first:
___________
| |
| header |
| |
| row |
| row |
| row |
| footer |
| footer |
|_________|
This is my typical page in perfect case with all rows, header and footer on same page. Sometimes I have too many rows for one page and my report looks like this:
__________
| |
| header |
| |
| row |
| row |
| row |
| row |
| row |
|________|
__________
| row |
| row |
| row |
| row |
| row |
| row |
| row |
| footer |
|________|
__________
| footer |
| |
| |
| |
| |
| |
| |
| |
|________|
And I can't just insert splitter between last row and footer because my requirements is:
- Headers page must have at least one row
- Footers page must have at least one row
So, I can' find solution to this problem. My footer can be splitted in two pages. My footer can be without rows and this is very bad for printing XLS file. I can use PDF instesad of XLS, but I have same problems. Does anybody have ideas how to solve this problem?
-----=== UPDATE ===-----
So, mr. dada67 provides great solution. We can put group into document and group will do what we need with expression = '1' (Looks like we select all elements). But there are some update to my question.
What if my every row is and subreport with some rows inside? When I use group in master report, Jasper process my every subreport with all his rows as an single row. Can I force Jasper to think that single element is not an whole subreport element but a single row from subreport?
-----=== UPDATE 2 ===-----
So, solution is here. When you need to move last row of your last subreport to next page with some footer - you just need to create group inside subreport with espression = '1' (to gather all rows) and settings from correct answer from dada67. This force jasper to draw footer after every subreport, but you can hide footer in all subreports except last.
Thanks to dada67!
JasperReports 6.4.3 introduced two new group attributes called minDetailsToStartFromTop and preventOrphanFooter which are used to specify if group headers and footer need to be accompanied by one detail band (or more in the case of headers).
So you can create a group in the report with a constant expression, set the two attributes and use the group header and footer band(s).
As in
<group name="Group" minDetailsToStartFromTop="1" preventOrphanFooter="true">
<groupExpression><![CDATA[1]]></groupExpression>
<groupHeader>
...
</groupHeader>
<groupFooter>
...
</groupFooter>
</group>
I'm creating a crosstab report showing the survey history for gopher tortoises (if you must know what that is) monitoring stations. Not all stations are monitored for a given survey and sometimes when we monitor we don't find any and thus record a 0 which is a valid result.
In the crosstab when the station isn't used I would like it to say "N/A" or some other equivalent, but when it's a zero I want it to stay as zero.
I've found so much on how to change a null to a zero, but nothing when you want to keep the zero and somehow note the null.
Below is what the crosstab should look like. You'll see that the 0 in Station4 on 1/1/2004 is "real" (meaning we didn't find any) but all of the N/A's are when we didn't use the station.
Survey Dates
| | 1/1/2000 | 1/1/2002 | 1/1/2004 | 1/1/2006 |
|----------|----------|----------|----------|----------|
| Station1 | 9 | 5 | N/A | N/A |
| Station2 | 5 | 7 | 2 | 6 |
| Station3 | N/A | N/A | 6 | 9 |
| Station4 | 10 | 9 | 0 | 11 |
This is what the Oracle table look like for the 1/1/2000 survey as an example
| SurveyID | StationID | Number |
|----------|-----------|--------|
| 1 | 1 | 9 |
| 1 | 2 | 5 |
| 1 | 4 | 6 |
So, basically how to I keep the zero's and put some text in the nulls in a CR crosstab?
Thanks!
Because CR doesn't differentiate between nulls and actual zeros in the crosstab, you can try replacing actual zero values with a placeholder so you can tell the difference. Note that this solution will only work if you are trying to display the values and not do any aggregate calculations.
First, create a formula that will replace the zeros with a placeholder value. In this case, I'm using -1 since that number should never appear in the database.
//{#Survey Num}
local numbervar totalSurvey;
totalSurvey:={Table.ActiveBurrows} + {Table.InactiveBurrows};
if totalSurvey=0 then -1 else totalSurvey
Use this formula to create your crosstab. Now you need to set a display string so that everything appears correctly. Right-click one of your crosstab cells → hit "Format Field" → select the "Common" tab → then create a "Display String" formula. That formula should be something like:
if currentfieldvalue=-1 then "0" else if currentfieldvalue=0 then "N/A" else totext(currentfieldvalue,0,'')
Now you're basically just printing the real values over top of the placeholders.
I have an invoice that runs off of a crystal report and I want to tweak it, but can't seem to figure it out.
I have paper that has a sticker at the bottom (to put on boxes and such). I have a label which is a report footer on the report that always prints at the bottom of the page so that it will fit on the sticker. On the back of the invoice I print the return policy and other information so we can save on paper. The invoice has a list of items and prices and normally there is no problem. However, every once in a while there are so many items that it forces the label onto the next page (which is the back of the sticker).
--------------------------------------------------------------------
| |
| |
| |
| |
| Item 1 Price |
| Item 2 Price |
| Item 3 Price |
| Item 4 Price |
| Item 5 Price |
| Item 6 Price |
| etc. |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|-------------------------------------------------------------------|
| |
| |
| |
| Sticker |
| |
| |
| |
---------------------------------------------------------------------
Q:Is there a way to force a report footer to print only on odd pages so that the label will always be on a sticker?
Things I've tried:
On the label section I've tried the "New Page Before" if pagenumber mod 2 = 0
Creating a new report footer section above the label that's the same size as the label that prints a new page after if pagenumber mod 2 = 0 and is suppressed if pagenumber mod 2 = 1. I've tried a couple of variations of this, i.e. making the section always print on the bottom of the page, forcing the label to print of the bottom of the next page and stuff like that but none of it worked.
Perhaps I'm on the right track and missing something simple, or maybe I'm not even close. Either way any help would be much appreciated!
If I understand you right, try this solution
Move the Sticker to the Page Footer and hide it on odd pages.
Steps:
Open report desing mode
copy the sticker to page footer.
go to Section expert
Suppress [x-2] on formula and place if pagenumber mod 2 = 0
run report