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

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,

Related

Crystal Reports Incorrect Grand Total

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.

Repeat main report rows per each subreport row

I have a JasperReports's report already implemented using below data structure which prints a main record along with its subreport records. The main and the subreport are placed in the same detail band and the subreport uses the JRBeanCollectionDataSource($F{employees}) as its data source expression $F{employees} being the collection field on the main report data type Company.
Company
Name
Location
Employees
Employee
ID
Fullname
etc.
The question is if there is an option in report to repeat the main report columns (Name, Location..) for each subreport record I have for a certain Company?
Basically, I need repeated records in the main report.
I know this is ugly and may look pointless but that is the Business Requirement! Most importantly, I don't want to touch the existing data structure as it's more complex in real case than my example.
Any hint (could be even a hack in JasperReports) is highly appreciated.
Note: I'm using iReport 3.7.3 editor.

How do i select records of crystal subreports dynamically

Good people of stack overflow.
I am stuck on this one.my crystal report is using a joined query
str = "SELECT invoices.voucher,
invoices.customer_name,invoice_details.item_name,
invoice_details.Amount FROM invoices
LEFT OUTER JOIN invoice_details
ON invoices.voucher =invoice_details.voucher "
The crystal report is grouped by voucher and the details are placed on detail section of group details to display item name and item amount.
It is working perfectly in design.
However at run time in VBNET when i select exactly the same query i get repeating line items. Example if the invoice items in invoice_details table were three in my report the three items will be repeated three times.
I have checked all over the internet for the same complain. No luck.
Someone suggested "suppress if duplicate" on an item with unique number such as voucher number. I did not get success.
Has someone met this difficulty and can you suggest how to resolve this?
If it can be of help to someone else...
My difficulty in duplicating line items was coming from using two tables, invoices and invoice_details when designing the crystal report.
And then using the link feature at crystal report design.
I had not realized i ought to have designed crystal report using a stored view (access query from the database). While using the stored view i did not do any linking at designing report but used grouping expert to group by invoice numbers.
So the report finally worked well after much frustration.

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 Report- How can i count records of users from different related tables?

I am using Crystal Report2008.I have user table, this table is linked with other table such as devises, photos, videos, emails, notes, texts by its Uid and users have record in all different tables. I want a report which shows that how many record each user has in each table.
I am also getting this error: "More than one data source or a stored procedure has been used in this report. please make sure that no SQL Expression is added an no server-side group-by is performed."
Thank You
With the tables linked, it is not possible to get an accurate count. Your joins will affect how many records are returned.
You need to write one report for each table. If there's a need to see the numbers all on one page, you could write a subreport for each table then put the subreports all together on one page.