Display records side by side - crystal-reports

I use a DataTable to bind my crystal report. It contains columns for credit and debit. If either one is zero, so is the other. Therefore every column contains either credit or debit information. I want to display something like:
Bank Name(Credit)|CreditAmt|BankName(Debit)|DebitAmt
My first column needs to display credit records with the bank name, and the second column displays Credit Amount and same logic for Debit amount - which displays in 3rd and 4th column.
My output currently looks like:
HDFC Bank | 550 |(blank) | 0
blank) | 0 | 500 | HDFc bank
I get blank a space and 0 in any section either credit or debit - because I only get the credit or debit amount per record. Therefore it puts 0 and blank spaces for other sections. How can I suppress th blank section to look like the following?
HDFC Bank | 550 |(blank) | 500 |HDFc bank

What you need to do is summarize your transactions by a common column to both your Debit and Credit. I assume Bank Name is the common link. Then summarize your Debit and Credit. Here are the steps to take:
Menu Insert->Group (Select the column common to your Dr. and Cr.)
Menu Insert->Summary (Select your Dr. Column and use SUM)
Place the results on the Group Header line
Menu Insert->Summary (Select your Cr. Column and use SUM)
Place the results on the Group Header line
Hide your details line
Now to further your understanding of what we are doing here, suppose you wanted to summarize by the accounts per bank. You'd do step 1, then insert another group by Account and then add the summarized Dr. & Cr. to the Account Group Header.
Cheers.

Grouping solution is great.
Another possible solution is:
- creating a formula field called NextDebit that gets Debit value from the next line Next(Debit)
- show in Detail Section Credit and NextDebit
- suppress details where Credit = 0
Another solution i working on the query, so that you'll have just the data you need in the way you need to work on.

Related

Crystal Reports - Running Total is duplicating if a group has more than 1 "detail"

I have a report that I am trying to get working in Crystal. Basically the report is about gifts (I work for a non-profit). I grouped the report by Payment Method, and then Gift ID, which is a unique field in the .MDB file used to fuel the report.
I want to keep gifts with the same payment method together, which is why I first grouped by that. Then I grouped by Gift ID. the "Details" of my report is a field called Soft Credit Donor, which will list out as many donors that were given soft credit on the gift. There could be 0, there could be multiple...I show running totals in the Report Footer. I have a Gift Count (a Distinct Count of Gift ID, evaluating on each record, resetting Never), a Sum of all Gifts (a sum of Gift Amount, evaluating on Change of Field - Gift ID, resetting Never). These 2 fields work fine.
Then I get to where I want a running total based on each Payment Method. I am able to easily show the # of gifts per payment method. I do this with 4 separate running total fields (one for each payment method). I am doing a Distinct Count on GIft ID, evaluating on a formula (payment_method = "Business Check", "Personal Check", "Credit Card", etc...and Resetting Never.
My issue is when I try to do a $$ total for each payment method. In this case I am seeing that my running total is duplicating if there is more than 1 "detail" or soft credit donor. My running total field is doing a sum of the Gift Amount field, evaluating on a formula (payment_method = "business check", etc...), and I've played around with the Resetting. If I choose Resetting Never, then I am seeing the money being double or triple, etc...counted. Depending on if gift has more than 1 "detail". If I choose to reset on change of field and I set that to either Payment_Method or GiftID, I get a blank running total.
One thing to mention is that my MDB file has multiple tables that are all left outer joined to the main table which holds the Gift ID and Payment method fields. So there is a Soft_Credit table that holds the Gift ID field, along with the each name of the Donor who gets a soft credit. I'm not sure if that matters or not.
I'd appreciate any help!
You can put this in a formula:
If {payment_method} = "Credit Card" Then 1 Else 0
Use this formula as sum in the running total.
Use "on change" on the id field.
User "never reset" for the total sum.
You have to create one formula and one running total for each payment method.

Crystal Reports how can I suppress a group where only one detail record exits

I have a report that groups our invoices by invoice number and details by doc type, original, credit, and rebill.
I want the report to show only those invoices where all three doc types exit.
Obviously 99% of our invoices do not have credit and rebills. Thanks for any help.
Create an invoice group counter by doc type and place a formula on your invoice group Section Expert, suppress condition that suppress that section if invoice group counter <> 3. This is a solution only if your invoice always have original, credit, and rebill one time. If you could have 2 or more originals, credits, and rebills this won't work.

crystal report group on multiple criteria

This is a strange scenario that I'm having trouble working out:
I have a report that needs to show the summary of donations that each board member gave/got in any fiscal year. They get credit for hard credit donations, soft credit donations, and solicited donations. Meaning their record ID number is in 3 columns throughout the spreadsheet.
So, my data looks like this:
Soft Credit ID/Hard Credit ID/Solicitor ID/Gift Amount
1/-/-/$50
-/1/-/$100
-/-/1/$250
I need to be able to group these records together because they each have the ID # "1" in the record (but in a different column each time). I need to group these records together, so that it shows the summary for each board member, with the details below:
Board member ID 1: Total Giving $400
Soft credit - $50 - 4/1/13
Hard Credit - $100 - 3/29/13
Solicitor Credit - $250 - 7/2/13
(^These don't need to be summaries, this just needs to list all gifts and which kind of credit they give)
I'm having trouble because I don't see a way to group based on the ID, in different fields. I tried grouping based on a formula for each board member (formula read {Hard Credit ID}="1" OR {Soft credit ID}="1" OR {solicitor credit}="1") but it didn't work and it creates a hierarchy that I'm not looking for. Apologies for the formatting - I can't find instructions on how to make that block above appear as a table.
One way to do it, depending on your source DB, is to use a SQL Expression to condense the three fields:
coalesce({table.SoftCreditID},{table.HardCreditID},{table.SolicitorID})
Or you can do it in a regular formula:
if not(isnull({table.SoftCreditID)) then {table.SoftCreditID}
else if not(isnull({table.HardCreditID})) then {table.HardCreditID}
else {table.SolicitorID}
Replace nulls in the three fields with 0 and then concatenate. You will then have a possibility of three values in the new field: 100 010 001
If you concatenate the three ID fields into a new field without replacing the nulls then you will get "1", "1" and "1". If you replace the nulls with 0, then you will get "100", "010", and "001". Now, you can group-by on the new field and you will get subtotals, or skip-group-by and just list the detail. To extract the description of the code, if we are only talking about 3 possible values, you can use nested if statements to examine first value and test if it equal to "100", else test if equal to "010", else test if equal to "001", else error. Or a case statement, syntax examples here: Select/Case in Crystal Reports or Crystal Reports SELECT CASE statement

This field cannot be summarized in crystal report errors

I was be able to output a crystal report and this is about accounting logic.
some of the column appear in my crystal report is eg.
accountname debit credit
cash..........1000...300
I want the column debit minus column credit (1000-300)
if the result is positive (+) then 700 will appear in that debit column
If the result is negative (-) then the value appear in credit column and i wan to remove the negative sign. So above value 1000 and 300 is not what i wan to show and debit or credit will be 0 eg
accountname debit credit
cash...........700......0
Above case is ok so far and now i end up like this
In crystal report formula editor i have #creditbalance, and inside it has formula:
if Sum ({Entries.Debit}, {Entries.AccountName})>Sum ({Entries.Credit}, {Entries.AccountName}) then
formula= Sum ({Entries.Debit}, {Entries.AccountName})-Sum ({Entries.Credit}, {Entries.AccountName})
end if
So it can give me as i wanted to show (the 700 and 0 part)
The problem is i create another formula
#TotalDebitBalance
Sum ({#DebitBalance})
It error said "This field cannot be summarized", Then how to sum up the value i get from #debitBalance.
Note: #TotalDebitBalance i plan to put it at report footer section where all grant total usually placed there, where #debitbalance i put it at Group Header section.
Right click the report.
Insert.
Summary Fields.
Select the formula you have done on the field and change from max to sum
Change Location to Group Footer
Do the same again and this time select the Report Footer
You will have two fields, one for the group footer and other for report footer, hope this helps.
It doesn't say but I'm assuming the report is grouped by {Entries.AccountName}. In addition to Waqar's solution, I'd replace the formula with something easier.
{#DebitBalance}
IF {Entries.Debit} > {Entries.Credit} THEN
{Entries.Debit} - {Entries.Credit}
ELSE
0
{#CreditBalance}
IF {Entries.Debit} < {Entries.Credit} THEN
ABS({Entries.Debit} - {Entries.Credit})
ELSE
0
In the details section, replace the {Entries.Debit} and {Entries.Credit} with {#DebitBalance} and {#CreditBalance} repectively. This will give you the
cash...........700......0
Then do as Waqar mentioned to summarize the formula. It's easier to use the Group... and Summary... features than to do it manually in the formulas.

Selectively showing groups in Crystal Reports

I have a report which displays information by group; I'd like to not show any group that doesn't have at least two items in it. Is there an easy way to do this?
Example:
Bob
3/1
4/3
Joe
3/2
3/7
3/9
Mark
5/9
James
John
8/17
9/2
Grouped on name, should not show Mark or James.
If your report is simplistic enough, you can get away with just suppressing the Group Header, Group Footer, and Details sections by using a summary function like count({table.somedate},{table.dudesname}) < 2. Note that the second parameter to a summary function has to be a field being used to group on.
Your mileage may vary with doing it this way. If you are displaying calculated summaries in the report footer, for example, it won't make sense to just suppress these groups as their data will still affect any report-level summary. The other problem you might run into is needing to use a distinct count on some field instead of just a count, depending on your table joins.
You could create a group-selection formula (Report | Selection Formula | Group...):
Count({table.field_to_count}, {table.grouped_field}) < 2