I'm creating a report in Crystal. It's a pretty basic report: I have two groups based on the same date field: year and month.
Those two groups serve as a way of organizing my details. I have the details hidden so they can be drilled down upon.
So when you first view the report, you just see the year(s) for group 1, and then the months for group 2.
If I wasn't using the grouped dates in this way, and was just creating a basic table, I would put the field headers in the page header section, which would automatically put the field headers on every page. However, since I have the grouped dates (hiding the details) on my first page, I can't put the field headers in there.
As a result, I created two detail sections (A and B). I put my field headers in A with the suppress formula (not onfirstrecord). This serves my purpose, but for when the report details fill up multiple pages, my Details A sections will only display on the first page.
Is there some formula or other way for me to:
1) Keep my field headers in Details A, but repeat the field headers on each new page?
2) or, move my field headers to the Page Header section, but somehow suppress it when my groups are being displayed on my main page (where the year and month groups can be drilled down on)?
Thank you!
You may want to use a repeated group header.
To do this open the Change Group Options dialog (right click on a group header, then choose Change Group). On the Options tab check Repeat Group Header On Each Page.
Put your headers for your detail section in a group header (maybe an additional one just for this purpose). Repeat this header on each page.
You can even detect if the header is printed the first time or if it is repeated using InRepeatedGroupHeader. This way you can implement a 'continued' on a repeated group header.
I want to display a footer note at the end of each record. Most records only span one page so the footer displays at the end of the page. Although some records span two pages (because of a lot of data) and the footer display on both pages.
What I want is to only have the footer display on the last page if the record spans two pages.
I've placed my information in the page footer but can't figure out how to make it appear on the last page of each record.
Any ideas?
Thanks
You can achieve it in two ways.
Use grouping if each record has a unique column. Insert a Group for that unique column. You can use Group Expert to achieve that. Hide/suppress the Group Header Section and put your footer information in the Group Footer Section.
If grouping is not achievable then you can sub-section your Details Section. To achieve that Right click on your Details section and select Insert Section Below. A new sub-section under details will be created. Writer your footer information in this sub-section. If there are multiple sub-section of Details Section then this footer sub-section must be the last sub-section.
To move your sub-sections / groups up and down you can use options available in Section Expert
I have set the "Stretch With Overflow" option True to some text fields (Denomination, From, To, Stock, Amount). There is one text field which is placed below these text fields ($F{grandTotal}). The below situation occur when I generate the report.
Can anyone please suggest what should I do to avoid this circumstance?
And this is the scenario of my report design.
I have found the answer to this problem. Here is what I've done-
Right click on report name and select Add Report Group
Select a group name and click next.
Check Add Group Footer option.
Then place the $F{grandTotal} in the group footer and Voala! it's done.
Here is what happens: The group is added with respect to the detail band. So, my $F{grandTotal} field is placed perfectly after the detail band column values are generated.
Thanks...
Move grandTotal to summary or ColumnFooter Band. In this use case I would suggest using a variable that aggregates "total" field so You don't need grandTotal field, unless grandTotal aggregates values not shown on report...
I dragged a field into the details section, but it shows only one row and repeats everything that is there in the details section and then it shows the next row. I want that CourseID2 should come just below CourseID1 and nothing else should be repeated.
The way you have your tables joined is causing your "extra" records. If you're not understanding your join and you're looking for a quick-fix/hack to your problem, you can simply add a group on your CourseID field and move your "detail" fields into the new Group Header section. After that, Suppress your Detail section and Group Footer section. This will leave just your Group Header section showing on the report, and it's impossible to get duplicate records from your Group Header section.
You need to develop a better understanding of your data though, and how your joins affect the outcome of your query.
Ok, this might be a weird request, but is it possible to essentially flatten my dataset inside a crystal report?
I have a datatable in C# that was created with a join, so when it hits the report its 2 records. Most of the columns have identical data, with the last few displaying a different address.
Instead of printing the detail section multiple times with mostly similar data, I need to display 1 'record' with the common data printed once, and each records address arranged next it. As in, all the common fields displayed in one area, and then next to that the address fields from the record where 'AddressType = 1', then next to that the address fields where 'AddressType = 2'
Is this a subreport thing? Because even with subreports I can't get it to only print 1 detail section with the data from just the first record.
Is this even possible with crystal? For long drawn out reasons, I can't flatten the data before it gets to the report.
Ok, someone here in the office showed me the way, so I'll put this out there.
Given data with cols A,B,C all common and D,E different across multiple rows, this is how I 'flattened' the dataset in crystal:
Create a group based on col A, and put A,B,C inside that group header - get rid of the details section entirely
Create a subreport in the group header for each row of data, in my case 2 subreports
Inside each subreport, put fields D,E. Important: There are NO links for these subreports!
For each subreport go into the Select Expert and create a condition that shows only 1 particular row of data. This conditional will have the same field for each subreport, but different values. In my case it was AddressType='A', and AddressType='B'
This will produce 1 report, with A,B,C listed once, and D,E listed once for each subreport(once for each row of data)
This was confusing, time consuming, and I hate crystal reports now more than ever.
It would be pretty ugly, but you could add a group for each common field in Group Expert and then display the data for the common fields in the last group header. So if your common fields are field1 through field5, you would create five groups and put all five fields in the group header of field5. Then you would put the unique address fields (call them field field6 through field8) in the details section.
Now the trick is getting everything to line up correctly. You can set "underlay following sections" on the group header for field5; this will cause field1 through field5 to "fall down" into the details section. You just need to make sure that field6 through field8 are all to the right of field1 through field5 so the text does not overlap.
Now, if you want the two address records to print horizontally, I think you will need a subreport with multiple columns for that. But the same principle applies -- just make sure the subreport is to the right of field1 through field5 so the data doesn't overlap.
Have you tried the suppress if duplicated option on each non-address field?
Otherwise, you could group by the common id, put the common fields in that header, and then display the multiple addresses in the details section.
Or, you could remove the addresses from the datasource and use a subreport to fetch this data for each record. This would bypass the join and be the slowest option performance wise, due to having to select the addresses for each record.
Ok, firstly let's see if I understand this right :
You want a report that would be in the format
MainDetails Address(type1)
MainDetails Address(type2)
to instead be in the format
MainDetails Address(type1) Address(type2)
?
Assuming there are only two address types, you can do the following :
1) Group by Main details (whatever the unique entry is
2) Put the address details in the group header next to them, on the right
3) Also put the address details in the details section, but positioned as if they were in the Address(type2) column positions, so it looks like :
GH MainDetails Address
D.......................................Address
4) Next, add a sort to the report on the AddressType field, so that AddressType=1 shows first.
5) Add a conditional suppression formula to the Details section saying {AddressType=1}
6) Using the Section Expert, in the Group Header tick the 'underlay following sections' box
This should work as long as the number of addresses is either 1 or 2.