Crystal Reports Viewer showing thousands of pages - crystal-reports

3 page document repeating to 48,387 pages.
I have a NextGen driven form that uses Crystal Reports to generate a document. I'm not familiar with Crystal Reports, but am trying to help troubleshoot this issue.
When we try to view this 2 page document (3 if you count the blank page), it shows as 48,387 pages. I reviewed the document in the Cystal Reports Viewer and it shows the 3 pages repeating over and over again. Does anyone have any insight into why this would occur? It seems to be looping the 3 pages over and over.
It started to happen yesterday. The only thing that may have changed on the Server, is that Hurricane Irma is about to visit us in Orlando, and we know the server team has initiated some disaster recovery plans. Thank you for any advice.

This most likely is happening because of a join. If you have a sql like this
select ... from tableA inner join tableB on X=Y
and both tables contain 1 record the statement will return 1 record. If tableB contains 5 records , which satisfy the condition (X=Y) then the statement will return 5 records. Most likely somebody generated 50 thousands new records. It is possible also that the records were generated in different tables for example 10 records in tableA and 5 records in tableB may cause the statement above to return 50 records. You may also check the join clause, may be it is incorrect.

Related

Crystal Reports Filtering and Organizing data

I am writing a small Crystal Report using 2 tables (TICKET,HISTORY,CUSTOMER) from a database I was given access to. I do not have access to modify the database tables to correct the issue and I am looking to see if this is possible.
The TICKET table is my main table and has a 1 to Many relation to HISTORY table.
The CUSTOMER table has 1 to Many relation to the TICKET table.
Inside the HISTORY table, there is column called Version. Every time a HISTORY entry is added on a TICKET, the Version number is written into this field, ie 21.4, 19.7, etc.
Ideally, the version would be better suited attached to the CUSTOMER table once the entry was added into the HISTORY table, but that change has not been made.
What I am trying to do with my report is group and display my results as follows:
Version Number
Customer Name
I can get this far, but the issue I am running into is, I only want to show the customer on their latest version number and suppress all previous records so I can get an accurate count of how many and which customers are on each version. Is this possible to do?
If you are allowed to create a VIEW in the database, create one that joins Ticket to History, groups on Ticket ID, and returns the Ticket ID and the Max of the Version.
In Crystal, you can then simply joint to that View.

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.

Crystal report not showing all data

Created a stored procedure which i pushed to my crystal report. The thing is some fields are showing blank even though data is returned in the query. I have retested the query, Verify the database over and over but nothing
Thanks for all the help but I figured out the problem. I had a join on 2 tables that have the same field names which I did not rename in the query. The 2 fields that weren't showing were the ones that are similar. I renamed those fields in the select statement and my data is now showing [silly me :)]

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.

Reporting on multiple tables independently in Crystal Reports 11

I am using Crystal Reports Developer Studio to create a report that reports on two different tables, let them be "ATable" and "BTable". For my simplest task, I would like to report the count of each table by using Total Running Fields. I created one for ATable (Called ATableTRF) and when I post it on my report this is what happens:
1) The SQL Query (Show SQL Query) shows:
SELECT "ATABLE"."ATABLE_KEY"
FROM "DB"."ATABLE" "ATABLE"
2) The total records read is the number of records in ATable.
3) The number I get is correct (total records in ATable).
Same goes for BTableTRF, if I remove ATableTRF I get:
1) The SQL Query (Show SQL Query) shows:
SELECT "BTABLE"."BTABLE_KEY"
FROM "DB"."BTABLE" "BTABLE"
2) The total records read is the number of records in BTable.
3) The number I get is correct (total records in BTable).
The problems starts when I just put both fields on the reports. What happens then is that I get the two queries one after another (since the tables are not linked in crystal reports):
SELECT "ATABLE"."ATABLE_KEY"
FROM "DB"."ATABLE" "ATABLE"
SELECT "BTABLE"."BTABLE_KEY"
FROM "DB"."BTABLE" "BTABLE"
And the number of record read is far larger than each of the tables - it doesn't stop. I would verify it's count(ATable)xcount(BTable) but that would exceed my computer's limitation (probably - one is around 300k rows the other around 900k rows).
I would just like to report the count of the two tables. No interaction is needed - but crystal somehow enforces an interaction.
Can anyone help with that?
Thanks!
Unless there is some join describing the two tables' relationship, then the result will be a Cartesian product. Try just using two subqueries, either via a SQL Command or as individual SQL expressions, to get the row counts. Ex:
select count(distinct ATABLE_KEY) from ATABLE
If you're not interested in anything else in these tables aside from the row counts, then there's no reason to bring all those rows into Crystal - better to do the heavy lifting on the RDBMS.
You could UNION the two queries. This would give you one record set containing rows from each query once.