Hide Column conditionally in crystal report - crystal-reports

I have data like below:
**Account Name****Total****Remarks**
Account01 100 Remarks1
Account01 100 Remarks2
Account02 30 Remarks3
Account02 30 Remarks1
Account02 30 Remarks2
Account02 60 Remarks3
Account03 50 Remarks1
Account04 50 Remarks2
How can I create a formula so the result shows as below:
**Account Name****Total****Remarks**
Account01 100 Remarks1
Account02 30 Remarks2
Account02 60 Remarks3
Account03 50
Account04 50

It seems the result shows two parallel blocks of data.
The left block contains the distinct pairs of account name and total.
The right block contains the distinct remarks.
If this is what you want (which is akward, but if this is your business rule...), here is how to get it in Crystal Reports:
Suppress the details section.
In the report header section, put two subreports side-by-side and do their layouts as follows.
In the left subreport, create a group by "account name" and a group by "total".
In the group-by-total header section, put the fields "account name" and "total". Do not use the details section - suppress it. Do not summarize total, just put it there.
In the right subreport, create a group by "remarks".
In the group-by-remarks header section, put the field "remarks". Do not use the details section - suppress it.

Related

Crystal Report: skip page if detail section is null

I have a subreport to filter the processing of specific products within a selected week set by the user. The subreport has 5 groups section and a detail section.
Specifically, the groups filter the data like this:
Group1: filters the starting date of the process
Group2: filters the products' group
Group3: filters the products' code
Group4: filters the products' number
Group5: filters the products' sub-number
I use group1 section for writing some simple text. In the detail section, I put some fields. Now when I have no record in the detail section, the sub-report prints the text of group1. For example, because in the day of the print there isn't any processing work.
How can I skip the page if the detail section has no records? (Or perhaps it is necessary to suppress the group1?)
Try to right click on the section, go to section expert, and check suppress blank section. This should hide the section if there are no values for that particular day
You should try supressing the group 1 if the details section is null. I'm not sure that you can actually skip a page.
If you are wondering how to know if the details section is null, maybe using a shared variable inside that section, which will count how many records will be inside the details section, to be used in the supression formula for the group 1.

Crystal Report Group Fields Summery in Header?

I have four groups. I am trying to do an accumulative summation between grownups.
Ex:
group1: A = 140
group2: A = 70
group3: A = 20
group4:
A = 10
group4:
A = 10
group3: A = 50
group4:
A = 20
group4:
A = 30
group2: A = 70
group3: A = 20
group4:
A = 10
group4:
A = 10
group3: A = 50
group4:
A = 20
group4:
A = 30
Here is a snapshot of my real report:
I have tried to using Summerize fields to sum the first level and it worked. I then tried to sum the Summzrize fields, but its not possible to sum those. I tried TotalRunningFields, but they display the results in the footer only. I tried using custom formula, but i wasn't successfully.
Can anybody give me a way of doing this. Also, if an example would be great.
Actually after a while, i tried to think of another way to implement the report. Crystal Report tells you not to do any grouping on the data but makes it hard for you to implement your logic based on grouping.
What i did in th end is that i have created a view, and then created several procedures that selects from this view. Each select have the necessary grouping. After that, i made sure that each select contains the ID's that can implement the hierarchy i want.
I mapped the all procedures and used the SMART Linking feature in the Crystal Report. This relived me from implementing any formulas or any extra logic in the report it self.
Everything is Possible
Create formula fields according to your total groups.
edit each group to:
sum({Filed Name},{DataTable1.Groupname})
Your choice: either you can put in each formula field in respective group OR on footer.
regrds;
AJAY
Normally footers will be processed after processing headers, hence it is not possible to insert summaries in headers.
But there is one way where create a sub report and place it in report header with same design and calcualte all values in footers, Now in main report create the same grouping hierarchy now just pass the sub report values to main report header and show.
Note: this will affect performance as two reports need to run

Change groups on new page

I need to create a summary page in crystal reports where it groups all the details with the same ItemName and calculates the totals
Data Example:
Balls 50
Balls 75
Food 10
Dolls 45
Food 68
On the last page in the report I need it to say
Balls 125
Food 78
Dolls 45
The report is already grouped by another detail, is there anyway to change what the report is grouped by on the last page?
Insert a cross-tab object in the report footer. Use the text field in your example as the 'row' field in the cross-tab. Use the numeric field in your example as the 'summarized' field. Leave the 'column' field blank.

Crystal Reports 2008 running total using datediff returns only 1

I have a running total set to count employees with less than 30 days between two events. While the report has groups, I have the running total set to never reset. I am using a formula in the Evaluate section that is as follows:
DATEDIFF("d",{Employee.DATE_Event1},{Employee.Date_Event2}) < 30.
This running total returns 1 when placed in the report header and 1400 when placed in the report footer. 1 is far too low and 1400 is far too high. The requester wants the total in the report header. Thoughts?
if you keep your formula in header.. it will display 1st record and if you place in footer then it will display last record.. that is how it works.. so you get 1 and 1400...
You are trying to display a value when it is not actually calculated because as the running total reaches the footer value then you will get the fully calculated value....
what you can do is create a sub report and place it in header and supress the sub report... Perform the same calculation that you do in the main report and pass the sub report value to main report and take one more section of header after sub report section and display there your value..
With this approach load on database and report will increase as you are performing the same operation twice

How to get individual group totals in report

I have a jasper report being made with iReport, which is basically a list of pages received the day prior. The report has total pages for the whole day and then individual totals for each group of page types.
The requirements state I need to display all the totals above the listed records and groups (ex. display in the title band). I created a variable for the total of all pages and that works but am having trouble getting each individual group total.
It should look like:
Total pages received: 50
Total GROUP_A: 20 Total GROUP_B: 30
When I try to use the variable set up for group totals, it only gives me the last used group, so it would say 30. I'm unsure how to create a variable to get the total for only a specific group.
I could include in my SQL result set the totals but was asked to do it within iReport.
If I understand the problem right you need to put a copy of the variable that you are using in the group and put it in your title band. the trick is on the object in the title band make sure you have set the evaluation time & evaluation group group or report depending on what you are truing to get a total of.