Summary band subreport displays only last value - jasper-reports

I am displaying list of string values in detail band of the report , it works fine. And i want to draw 5 graphs in summary band. I tried in summary band it took all the values and generated report but summary band height was limitted. so i drawed only three graphs in that space. I moved to sub report to draw all the 5 graphs.
i passed values to subreport through parameter map. I got all the 5 graphs, but the graph is drawed using the last value passed to the subreport. I want to draw the graphs with all the values passed to it. How to to this ?

Try to use the same datasource as you're using in your main report. Should work fine.
You can achieve this using the property $P{REPORT_DATA_SOURCE} in your subreport data source expression, but don't forget to set the connection type as well.

Related

X Y scatter chart with groups

Here's a sample from my table:
Energy Data Ratio
1, 1/1/2017, 1
2, 1/1/2017, 2
1, 1/2/2017, 1
2, 1/2/2017, 2
I want to group by Energy and show the Date and Ratio. I've gotten to the point where the chart in the Report Header will show the right grouping in the chart legend, but it only does the first date then stops. Ie it only shows 1/1/2017, and not subsequent dates.
On change of: Energy
Show values:
mIrradDate (a formula which returns the irrdate date, a trick to enable 'don't summarize')
mRatio
How can I show all the data?
Crystal evaluates things top to bottom, and gains data as it goes through the report. So by placing it in the Report Header, it reads one record, prints your chart, then reads the rest of the records. (If you put it in the Report Footer, it'd evaluate after all the data was read, and show all the records.)
You can try any of the following:
Place the chart in the Report Footer instead
Evaluate whileprintingrecords
Configure a near-identical subreport that suppresses everything but this scatter plot in the footer. Then place the whole subreport in the header of your main report.

How to setup a jasper report with any length of height?

Say that a jasper report should be generated to a thermal printer. The detail band may be 1 row or 200+ rows.
How to generate jasper report with its height fitting to the row count instead of printing white-spaces in the end?
Set the pageHeight to just one row and then use
isIgnorePagination="true"
When isIgnorePagination is true the report will be generated in a
single page.
Hence, if just one row, it will have the height of one row, if more rows it will not create new pages but generate a continues layout.
For example see: http://jasperreports.sourceforge.net/sample.reference/nopagebreak/

Jasper sub report border line not covering all tuple height

All Works fine but, rows margin do not cover all height. as shown in attached these two pictures.
How I am doing: I put rectangle in detail band, than sub report and other fields. on all fields, sub-report and rectangle i also apply stretchType="RelativeToTallestObject and isStretchWithOverflow="true" for warping up the text which works fine. I am facing this problem still unresolved.
As per my understanding: sub-Report fields are also stretchType="RelativeToTallestObject but didn't detect or get stretched of its main-report column. while if sub-report need extra space it will show properly. I have tried almost every thing available in iReport-Designer.
Drop figures. Use borders, preferably via report styles.

Detail band resize dynamically vertically when textfield is NULL

I have a JasperReports report build with iReport. I have the normal Detail band but below i have a textField named observations there is sometimes the Observations textField is empty or NULL. I have put both inner components namely textfields, lines into frames something like.
I also set using Print When Expression the below frame the one who holds the Observations textField to appear only when there is data on it this is working very good but the space holds by the frame is still on the Detail and we are losing some space and it's kind annoyng to see this blank space.
Is it possible for the report to "delete" the idle space hold it by the hidden frame?
My report's design:
The generated result (PDF file):
I don't think it's possible to alter the height of a band depending on its content but you can actually have multiple detail bands. So add a new one, move your observation text field into it and set the print when expression of the second band.

Crystal Reports columns in details band, change direction

here's what I am trying to accomplish:
I'm working on a single page report using Crystal Reports 2008, and at the bottom right corner of a page, I have a subreport that puts 1/2" square bitmap images in details-band columns that might print one image, or up to five horizontally. Right now, they print left to right.
What I would like to do is have them start from the right side of the subreport, i.e. the first image in the right corner, and additional ones print to the left. Is there a way to make this happen? I've tried changing Section Expert > Details/Layout > Printing Direction between the options "Across then Down", and "Down and Across", no luck with that.
thanks in advance
I was able to get this approach to work:
create a subreport that contains the image in the Details section. Add a suppression formula to the Details section that reads: RecordNumber<>1;
hide all sections but the Details section
size the subreport to fit the image (1/2" width)
move the subreport to the right edge of the relevant section
link the main report to the subreport
right click the subreport and save it to your Desktop
insert a subreport and choose the one that you just saved
size it to fit the image and move it adjacent to the first one
edit the subreport, hide the non-Details section, change the Details' suppression formula to RecordNumber<>2
repeat steps 5-9 for the remaining 3 images (changing the suppression formula)
The idea is that each subreport retrieves all of the image row for the related row in main report. you suppress all rows in each subreport but the one that you want to display.