Crystal Reports Incorrect Grand Total - crystal-reports

I tried looking for the answer but all the questions were more complicated, needing more complicated answers.
I'm trying to find the sum of a column in Crystal Reports, putting it into the footer, but when I do it gets a grand total that is totally incorrect. For example, i want to find the sum of the column balance, which has only got one row with £0.68, but CR puts £69.36. I have had to suppress the duplicates, so that probably has something to do with it, but since i'm new to everything code related I need some help.

The duplicate values you are seeing most likely are not a bug, but rather are data columns that have a many-to-one relationship with other data columns in a joined data table. Which is when grouping your data becomes necessary. For example, within a database one Invoice record typically joins with 1 or more Invoice Detail records. Each Invoice Detail record will have the same Invoice Number, and you will have duplicate Invoice Number values in your report. You say you begin by filtering your report to a single customer, but if that customer has more than one invoice, without a grouping level on Invoice Number, then the details section is the only place you can print the Invoice Number and it will duplicate over and over again for each item on the invoice that is defined on your Invoice Detail table. By grouping on Invoice Number you can use the group header section to print data fields that have a 1-to-1 relationship with any one invoice without duplicating them. Then you can use a summary field in the group footer section that properly reflects your grouped data without counting the duplicate values.

Related

Linking tables where record in one table has a prefix and other does not

I am creating a report which will allow me to reprint invoices using information from two different tables from Sage 300 accounting/job costing sofware.
I have one table that has an invoice number of "123456" and another table that has an invoice number of "SM123456" referring to the same invoice. The second tables adds the "SM" so that it knows that the invoices was sourced from a particular module. Is there any way to link these?
I have tried creating a report with a formula to remove the SM from one of the tables so that it can be linked to a subreport. However the subreport that I want to print is already using subreports and the second tier subreports are not printing data that is needed.
I am open to any other suggestions.
Thank you,

MS Word mail merge, multiple columns into rows, dynamic table

im creating a invoice template for mail merge using Word. In my source excel sheet, each row represent different invoice, but each invoice can have one or two items. I want to list this items in dynamic table inside my Word document. So if particular invoice has one item, i want the table to have one row, if the invoice have two items i want the table to have two rows. Columns in my source excel are: InvoiceNumber, Date, InvoiceItem1Value, InvoiceItem2Value. So the last two columns represents my invoice items, if they are both filled, then the table in my output document will have 2 rows, each containing one of the value. If only one column will be filled, then the output table will have only one row with a value from that filled column. Can you tell me how to do that?
What you are seeking is a Many-to-one mail merge. Mail merge wizard by default performs one-to-one mail merge i.e. it creates one document for each row in Excel. In your case if an invoice has two items, it will create two documents.
If you are looking for an online many-to-one mail merge, try EDocGen. If your organization is less rigid with security, you may also try add-ins from Graham Mayor and Doug Robbins. Incidentally, I published a blog for many-to-one mail merge few weeks back with a similar use case.

Crystal Reports Record Filtering using and

Currently I have a crystal report that only shows orders which included a "Storm Door" OR a "Sunroom Component". However I would like it to only show orders that include BOTH "Storm Door" AND "Sunroom Component" within a order. Any suggestions on how the code for this might look?
I think you have answered your own question - If you want the report to retrieve records where BOTH products were ordered, you would use an AND statement - {Categories.Description} = "Storm Doors" and {Categories.Description} = BetterView Sunroom Compnents". However, the issue with duplicate records sounds like a problem with the design of the report. You could try a few things
Look at the table joins and verify they are setup correctly; if you have a 'one to many' join setup, you may be retrieving multiple rows for each record. If you joined Customer to Orders on the Customer_ID, you would get every single order for each customer, etc.
Click Database > Select Distinct Records - Depending on how your report is configured and which fields you are displaying, this may remove the undesired duplicates.
Change your grouping order - Instead of grouping by Category (Storm door, Subroom), group by Customer and then count the number of orders or use an aggregate function to give you the information you need.

Removing duplicate record text but keeping unique values

In our system, it shows each charge as a record, despite the account being the same.
Crystal reports image
How would I go about doing this?
Also, is there a way to show it like this even though they are all seperate records?
Option 2
You can solve this using sub reports.
In main report take distinct record and place the fields Account and city in detail section.
Now take sub report and place it after the first 2 columns in detail section but take care that you won't select the option distinct records that means you retrieve all records. In sub report place Charge type, charge fields

Crystal Reports: Need to use a summary field as part of the Record Selection Formula

I have a fairly basic report that needs to show events with a total spend of >$200K OR event attendance >60ppl. The attendance portion is no problem, as it's a simple text field in the table. The expense spend is a field that has to be summed before it can be used, coming from a separate table with multiple entries per event. I have no problem doing this in a summary field dropped in the eventID header or even using a subreport and passing a shared variable to the main report. The problem I run into is that I cannot access this summary field in the report record selection to extract the either or records. Any idea how I can do this accurately?
Create a sql-expression field for total spending:
//{%total_spending}
(
SELECT sum(Amount)
FROM Meeting_Expenses
WHERE MeetingId=Meeting.Id
)
Use fields in record-selection formula:
{Meeting.actual_attendance}>60
AND {%total_spending}>200000