Repeated values in subreport. Too many pages - jasper-reports

I have a report with 2 suppliers. I want to show items ordered by the 2 suppliers. For that I am using a subreport.
For the 1st supplier there are 15 rows and second has 1.
But there are 2 many pages displayed. i.e. 92 pages. The values are repeated. Also a lot of empty pages are shown.
Please advise.
https://www.dropbox.com/s/i5n3z80m7c2itlt/Complex1.jrxml
https://www.dropbox.com/s/5qm5o9cz1yatfad/subcomplex.jrxml

Mithnil,
In the complex1.jrxml query, how many rows are returned? You put the subreport in the detail band, and without any report groups it will execute whatever is in the detail band for each row of the report query. Maybe you need to work on the query to only include one row per vendor.

Related

How to use a report as subreport (with additional info) multiple times in a maintainable way?

So basically I have a report. I need this report to be printed as a 'set of reports'. Except that for each time the report is printed, there has to be a specific numbering at the bottom of the page. Where it would look something like this:
Page 1: Report + Page footer text 'Number 1'
Page 2: Conditions
Page 3: Report + Page footer text 'Number 2'
Page 4: Conditions
Page 5: Report + Page footer text 'Number 3'
Page 6: Conditions
And so on, for an undetermined amount of times..
In order to achieve this, I have created a main report, which currently contains 20 subreports, in order to achieve 20 pages (but I really I'd like this to be dynamical, maybe to be able to set the number of copies or something). Where each subreport consists of the single mentioned report (through the subreport 'Choose an existing report' option), with a custom text at the bottom.
The problem with this is that I can't maintain this. Every time an adjustment needs to be made to the original report, I will need to access 10 subreports and make the very same change or reload the report into this subreport.
What alternative ways of achieving my goal can you suggest, because this feels really 'dirty'. Thank you for reading.
I run Version 14.0.2.364 of Crystal Reports 2011
To achieve this, you need to use group and detail section in main report. For making adjustments with paging, each section has his own
page before
page after
reset page
So to help you a bit, you need to have your data in one datasource, and group by
Report/Conditions. For each group you can have only 1 subreport which will have link for that specific subreport (e.g. where barcod of smth is 1234) and there show your subreport data. For page number i would advise you to use my approach (for grouping) and then for page number you display group number (and that solves you all formulas for calculating pages).
If you are not familiar with grouping in Crystal, you can group your records in report by some fields by following image below
To summarize, try to define by which fields your reports has 20 subreports (probably some keys from database) and then group by that fields, examine advances of section expert and paging and you should be done in few hours making your report readable and easy to maintain.
Hope it helps

subreport in Detail band getting displayed repeatedly

I have a subreport included in the Detail band of the parent report. The SQL query in the parent report returns multiple rows. And so my subreport also gets displayed as many times as the records returned by parent SQL query. I want to display subreport only once irrespective of the records returned by SQL query in parent report. I have tried moving subreport to columnfooter section but then i get a "Subreport overflowed on a band that does not support overflow" error.
Any pointers to get it working will be really helpful.
Ok to start with: a subreport has a different Dataset (SQL query) then the parent report. If you use an query, the subreport is shown as many times as there are records as a result of the query. This is actually what it's meant for and that's the same as with parent reports.
What you want to achieve if I unerstand you correctly, is that you have the supreport outputted once and the main report outputted as many times as there are records returned. What I would suggest is:
Why don't you turn it around? Would solve all your problems and you use the programm as how it's meant to. You can do it like this:
Put the query that returns mulptiple record in a subreport, change layout so it matches your current parent report.
Put the data that should be displayed only once in you parent report Query (LIMIT bij 1 if it can return multiple records but you need the first). And put the necessary textfields etc. in the main report before or after the subreport.
Hope it helps! Let me know

Crystal reports and subreports speed

I created a report in Crystal Report. It has two subreports.
GROUP Customer
GROUP FAMILY
DETAIL ITEM
The detail is for Items. This detail is inside a group. It has totals.
FOOTER A GROUP FAMILY
totals Item detail
FOOTER B GROUP FAMILY
Subreport 1 Totals by adj (it display the detail of a third table and the totals)
FOOTER Customer
Subreport 2.
Totals by item. (it display the details and the totals)
The report is 48298 records.
The tables have indexes.
Why it takes 30 minutes to run the report? Is this time "normal"?
How can I display in a footer the detail of other table?.
Can I set a field in the footer that calls a Store Procedure and returns all values like a detail?
Each of the subreports will be executed for each customer. I am surprised that you are not running out of memory. My guess is that the number of customers / families is relative small (less than 300). The report is slow because it queries the database twice for each customer. Try to prepare the data inside the main report.

Details rows inside tablix SSRS Reporting service, Records with Details rows under it

Now it is a report with a tablix in which the records are like every row has some details rows under it. and the details row can have one or more records based on the main tablix rows
To elucidate the problem, plz have a look
Did some search here and there, but not able to figure out how to accomplish this.
Sub-reports inside the tablix cell, but how will it keep the track of the current row
One thing more : Do I need to create two separate datasets for this and bind accordingly or write query as a single dataset and do some grouping ?
any ideas !
P.S: SSRS r2 environment, native mode reports for web application
You can achieve this with one Dataset and one Tablix.
The Dataset will have all the columns in the report, with multiple rows for each BIL value.
The Tablix will have four rows and one group based on BIL.
The first row will be the Tablix header row, with the main column header details.
The next two rows will be group header rows. The first row will contain the group details, BIL, No Bayar, etc. The second row will contain the detail row header details.
The last row will be the detail row which will contain the COL1 and COL2 detail values.
You will see something like this (you'll need to fill in the TextBox details as appropriate):
create report with subreport will solve your problem
you can create one report with one dataset with (BIL NoB NoW Est TotalXYZ) columns.
Now link that subreport with the BIL
Now link subreport with main report the BIL (FK)
Hope this help

In Crystal Reports, can you group by two tables which are both many-to-one with the top group?

I am working on a Crystal Report that breaks down data first by Receipt ID, and then I need two groups both under Receipt ID, but that aren't related to each other.
So instead of three levels of grouping, I need to somehow have only two levels like following:
Group: Receipt_ID
Group: Receipt_Detail.Line_Number
Group: Receipt_Deduction.Description
Here is an example of what it should look like:
Receipt ID Line Number Weight Dollar Amount
091911001
1 17,640 $2116.80
2 16,860 $1180.20
3 17,200 $1204.00
MAC Peeler Rate 17,640 0.0027
MAC Juicer Rate 34,060 0.0011
091911007
1 40,000 $10050.00
2 13,500 $2600.00
MACMA Rate 53,500 0.0350
And so on.
Is there anyway to do this sort of thing in Crystal Reports 10?
A subreport! That would be the cleanest way.
In the receipt ID footer, insert a subreport.
In the subreport, use the Receipt_Deduction table.
In Subreport Links, select records in the subreport based on Receipt_ID = Receipt_Deduction.Receipt_ID
Move your deductions content to the subreport's detail section.
In the parent report, remove the Receipt_Deduction group, and perhaps the detail table too.
If you want, you could even move your detail content to the Detail section, so you can remove the Receipt_Detail group.