Sub Report /Main report cross tab fields difference, - crosstab

I have a main report with a cross tab that shows Income of regions
Similarly a sub report is called in the main report that shows Expense of the same regions
Now I have to show the Deficit/surplus b/w the income and expense of each region.
How do I go about it? Any suggestions? I am trying shared variable but that just gives me the total difference between the two reports.
----------
Income Expense Surplus/Def
- Region1-- 1000 Region1 -- 500 -- 500
- Region2 -- 2000 Region2-- 2000 -- 0
- Region3-- 3000 Region3 -- 2000 -- 1000
- Total -- 6000 Total --- 4500 - 1500
p.s I can't seem to indent my columns for ease of reading above.

It is difficult to manuplate these kind of calculations in cross tab.. but one way around would be.
Approach 1:
As I see your cross tabs are simple hence instead of sub report use both corss tabs in main report it self.
For difference (Surpless or deficit) use 3rd cross tab and create the same hierarchy as of the first two and write difference formula.
Approach 2:
See the post below where I gave the answer to get the cross tab functionality without using the cross tab. Check the answer part in below link
How to filter information within a Cross Tab in Crystal Reports
Let me know how it goes.

Related

Crystal Reports - Summarize Cross Tab Values

I'm using CR12 pulling from a database and trying to create a summary that will total values in a cross tab. Here is my scenario:
Report detail shows equipment used
Detail is grouped by Room and then Date/Time of session
Summary section totals up all equipment with discounts, tax, etc.,(via formulas) ending in Grand Total
Grand total is then divided by a distinct count of billing codes to calculate avg. $ amount per billing code that is due per room/date-time
This was placed in a cross tab to show Billing Code and $ Amount Due per billing code. Now I need either another cross tab or summary at the bottom of the report to show the total amount due per billing code.
Example:
Room/Date----Billing Code----Amount Per Code
101 3/2/16------ABC123----------------$50.00
101 3/2/16------DEF456----------------$50.00
102 3/2/16------ABC123----------------$25.00
TOTAL
ABC123: $75.00
DEF456: $50.00
Here is a screenshot example of what I have so far:
Report Example
Any insight provided is greatly appreciated.
Since you took a cross tab to show the individual summaries (though it can be done without a cross tab and it is more easy to show final totals in footer as well)
In report footer as well take another cross tab to show summary just take rows as billing codes and sum the amount.. which will do the task

Modifying a report to remove a record limit?

I'm trying to modify a report that shows the Top 10 Customers by Sales. Currently, the report shows the top 10 customers, and stops.
I'm trying to remove the limit of 10, so I can see all customers sales data. I can't find where the report is setting this limit. I've looked through the formula editor, and can't find any relevant formulas to this limit.
Also there are no suppression formulas.
Any ideas?
Found the answer.
Under the Report > Group Sort Expert menu, I was able to select between:
No Sort
All
Top N
Bottom N
Top Percentage
Bottom Percentage
for the group sort. I selected All, and now all my records are showing.

Cross tab issues / Crystal Report

I am using SAP crystal report(version 13.0.8.1216) for VS2010.
I have made a cross tab which shows cost centers income month wise for one year.
jan feb mar
Costcenter1 10000 1000 1200
CostCenter2 120 1300 0
Similarly I have to show expense accordingly.
My two reports work fine separately but when i make one report, subreport of the other( as my selection criteria for both cross tabs is different even though they use same tables).
The subreport cross tab doesnt not extends to the second page. Only data that can come in first page of the main report is shown .
1. 'Keeping Object Together' is unchecked ( for all sections and all reports)
2. Suppress is also off
Any ideas? I tried placing my subreport in different sections also.. nothing seems to work .
Thanks

How to select a specific record/row of data in Crystal Reports?

I have my sql database Views available to my report, but sometimes they return multiple values, for example I have one that shows me the Total Credits for a range of years.
When I click "Browse Data.." it lets me see what bits of data are available
Eg:
Credits
-------
31
45
460
But I want to select 45 (based on a customer ID)... is it possible to do this?
EDIT: An alternative is if I can link the Customer ID from two views, but only if it's not null (as sometimes there are no records in the Credits)
To avoid the problem of unintentionally "deleting" customers from the report results, first do a left outer join between the CONTRACT_VIEW and the year views, such as TOTAL_2013. In your selection formula, instead of just doing something like {TOTAL_2013.Customer_ID}=MyCustomerID, add all the nulls to it as well, so: isnull({TOTAL_2013.Customer_ID}) or {TOTAL_2013.Customer_ID}=MyCustomerID. This will prevent customers who don't have any entries in the by-year views from being removed completely from the report.

Limit rows fetched when designing a new report

Is there a way to limit the number of rows fetched from a table when creating a report with the Report Wizard?
Say I have a table with a million records. I use the report wizard to select this table and some fields. Before I can get to the step where I can use the select expert; Crystal Reports fetches everything record to render on the report. This can take 5 - 10 minutes of just waiting.
Is there some setting to limit how many records can be fetched during design time? Or is there some other approach?
Use a Record Selection Formula
Here is some reference but you may want to google "Crystal Reports Record Selection Formula"
http://www.tek-tips.com/faqs.cfm?fid=3826
A simple setting can limit the records!! Here it is, if you're using .Net 1.1 (similar set of options in higher frameworks too!).
Solution 1: Right click on the report layout > Reports > Top N/Sort Group Expert > Choose Top N in the Dropdown that asks for the type of filtering/ sorting you wish to do > Set the Value of top N (100 for ex.) > Uncheck the option that includes other records. You report will be filtered for only the top N records from the Dataset.
Solution 2: Using the Record selection formula where you limit the No. of records on a particular Report/Sub report. Right click on the report layout > Reports > Record Selection Formula > Enter the formula as "RecordNumber <= N". That's it. The number of records fetched from the Datasource will be only upto N.
Cheers!