How to hide/show drill down subreports in Jaspersoft Community Edition? - jasper-reports

I have a report which has a main report, and would have a second detail band which would be a subreport call to another jrxml file.
The report and subreport are showing properly. But now i want to hide the subreport on load and would only show up when the statement no is clicked and be hidden when clicked again, is there some javascript/jquery trick i could add into jasper?
sample:
id statement_no name company
1 123-4 John Carp Carp Solutions
statement_no type amount
123-4 BILL 456.12
123-4 CHARGE 14.05
2 145-9 Jenny Jones Alias Investments
3 111-2 Lo Yee Alain Bank
statement_no type amount
111-2 BILL 150.00
111-2 CHARGE 2.00
note: I am using the Community edition which does not support Visualize.js

Related

Printing a sub report data horizontally

I have a requirement where in I need to print the data in my sub report in horizontal order rather than vertical.
However the master data is still to be presented in vertical order.
The report presentation is something like this below where the Subject column would grow horizontally for each record.
I have tried keeping the Subject records as a subreport to the main report but it does not get printed horizontally.
TeacherId TeacherName Subject1 Subject2 Subject3
1 Tom Physics Chem Bio
2 Sofie Eng History Geography
3 Monique Eng Chem Physics
Checked a few existing answers but no clue.
Any help would be thankful.
I would share the changes done to achieve the above output if it helps anyone:
Create the report to be embedded as a subreport as an independent report.
Change the printOrder to "horizontal" and Columns: n (where n can be any value greater than 1)
Save the jrxml file.
In the master report add the sub report element. while adding chose the option "just add the subreport element".
Go to the Properties tab of the subreport element do the following changes as below:
Subreport Expression: $P{SUBREPORT_DIR}+"SubReportfileName.jasper"
DataSourceExpression: new net.sf.jasperreportsengine.data.JRBeanCollectionDatasource($F{subjects})
, here subjects is the field name for the BO Subjects present as an association in Teacher BO.

Crystal Report: Comparing 2 Years item performance based on QTY sold

I am new to crystal.
I have to show the top 217 items based on the quantities shipped in 2014 and side by side 2013.
Is there way to put in one report the data.
Item1 in 2103 may not be the same as 2014.
I get the data from invoice history detail table, and add the qty shipped from all item and then sort the top 217 items on basis of the sum.
I can have them in 2 reports or the previous year data from sub-report,but then the sub report data will appear as row after the current year. however how can I put them in 1 report side by side for a better comparison.
Thanks for your help
Steps:
Create a report that does what you want for a single year (say 2013)--you'll probably want to use a top-N grouping.
Create a second report, without a datasource
import the first report into the second one (call it 'year N-1'); don't link the sub-report to the main
import the first report into the second report a second time (call it 'year N'); don't link the sub-report to the main
edit the second sub-report and set the date to 2014
If you want the report to be more flexible, create a parameter in the main report (named 'year'). Link this parameter to each of the sub-reports, changing the respective, record-selection formulas to use the value to calculate the correct date ranges.

How do I get a 3 page report in Jaspersoft iReport Designer 4.7

First of all: I've read this question but it is not working for me.
What I need:
I have an SQL query that returns a 3 column set with about 50 rows that looks like this:
year | month | number
2012 | 1 | 35
2012 | 2 | 24
2012 | 3 | 127
and so on. Now I need two different representations of this data. The first one is a 2D bar chart and the second one a table with the numbers presented. I managed to do both, but what I'd like to have for the whole report is, to have 3 pages in total.
First page should be a simple cover page with the title of the report, which I can get by simply adding the title band, as far as I've understood. The second page should be the bar chart (filling the whole page) and the third page should be the table (also filling the whole page).
I've tried the following and didn't get the result I need:
Created 2 subreports (1 for bar, 1 for table), added them both in a main report (in the details band) with a page break in between. The result was 2 pages, but the chart and the table filled only half of their page. When I tried to resize the subreports to the full size of the page I got the error message that they're out of range...
Created 1 report with 2 detail bands. Added the chart into the detail band 1 and the table into the detail band 2. This worked for both elements to be the full size of the page, but the whole compiled report now has 100 pages --> 2 pages for one row in my sql set
So how can I accomplish what I need!? Is it even the right tool to use? Or should I simply create two reports, export them as PDFs and combine the PDFs by hand?
My suggestion - in your SQL query, add a fourth column that concatentates your year and month (let's call that year-month). Create a detail band with the following fields: year, month, number. Create a summary band for your chart with year-month as your x-axis and number as your y-axis. Make the title and summary bands the size of your output paper. In iReport, right-click on the name of your report and go to the Properties box for the report. Check the box for "Summary on a new page."

Calling SSRS report from another report

I an new to working with SSRS and creating reports.
I have created a simple 1 page report from one datasource and 6 detasets.
Report takes one parameter: EmployeeId -- and generates 1 page report for that employee.
So far all good!!
Now, I want to create another report which takes a DepartmentId. This report should generate report for all x number of employees in the department and have x number of pages.
Is there any way I can reuse the report I created earlier (the one with EmployeeId as parameter) to generate the later report I described?
Thank you :)
You could probably use a subreport, if the DepartmentId is available per Employee (i would assume it is) then that would probably be your best bet
How about you inclue the employees department ID on the detail report for the Employee, then you put an action on this field and set as target the department report. Passing the clicked Department ID to the department report and you got a nice solution.

Crystal Reports subreports

Here is the scenario where I need help
I ve got a report - XYZ Summary Report (with embedded sub-report) and the XYZ Details report (the sub-report)
The requirement is that the XYZ Details report be a sub-report to XYZ Summary Report and also be available as a Stand Alone report through a Parameter.
Report Information:
1) A Parameter allowing the user to select the report they would like to run, either the XYZ Summary Report or the Agreement Details Report.
2) The XYZ Details Report should also be a sub-report to XYZ Summary Report which would allow the user to launch the XYZ Details Report through the XYZ Summary Report by selecting the linked Document Number.
I dont know if I am clear here. Let me know if you need more informaion
The combination of being able to drill down to the agreement details interactively, and being able to specify whether to run the report at detail or summary level makes this quite tricky - the former is implemented in Crystal using Hide functionality, while the latter requires conditional Suppression.
I recommend not doing the detail report in a subreport if you can avoid it - I find them awkward to develop and maintain. Additionally, due to the need to drill down interactively or at initial run-time, you will need to link to the subreport twice - once for the drill down, and once for the parameterised selection of the detail report. Consider linking the Documents table to the Agreement Details table, instead.
If you have to go down the subreport route, then:
Set up your parameter with an appropriate name (eg ReportType).
Group the main report by Document Number (if it isn't already) and place the detail items in the group header section, with the group footer section suppressed.
Split the details section of the report into two subsections.
Set the first details sub-section to Hide (Drill-Down OK) and add the subreport to it, with appropriate links on Document Number.
Set the second sub-section to be conditionally suppressed (in the Section Expert dialog) based on the value of the parameter, and add the subreport to it, with appropriate links on Document Number.
Alternatively, consider the method suggested by PowerUer, in the comments.