Jasper Reports, Expanding a Band Based on the Data in a Chart - jasper-reports

Is there a way to get a band to resize based on the amount of data presented in a gantt chart? I can get the number of rows that are in the chart, if that helps. It seems like there should be a way around this.
In otherwords, how does one dynamically resize a chart in JasperReports?

The solution to this is to put a text band right beside the chart and estimate the appropriate height, use a scriptlet to generate enough text that would end up being close to the right height. On the text box, stretch on oversize, and the band will increase. Stretch the chart to the band height.

Related

is Crystal Report generate stacked bar chart of this style? Sample is attached in image

I Need a report in crystal Report with the attached image style. Can Crystal reports support it?
I assume you also need to show an indicator for the current patient score. Perhaps also a marker for a target/previous/benchmark value.
Since the scales are static, you can underlay a static image for each type of scale. You can then superimpose a dynamically positioned "marker" image (e.g. vertical line or arrow) using Crystal's support for dynamic expression. Here is an example of such a solution:
Another option, if you are flexible about the type of chart, is to use a bullet chart. They are an excellent choice for showing these type of performance ranges with intuitive performance & benchmark markers. There is at least one Crystal Reports User Function Library (UFL) that supports creating bullet charts in Crystal Reports. Here is an image of a report with bullet charts:

Make Height of Field Dynamic?

I am trying to get a field in my parent report to adjust its height dynamically based on the height of a SubReport in the same row. The SubReport could return anywhere from 1 to about 20 rows, and I want the field in the parent report to adjust based on the height of the SubReport.
Further, and I am pretty sure this is not possible, can I center the text in this field vertically? I think CR only allows for horizontal alignment.
This is in CR 2013 sp7
Neither of these are supported by Crystal. Once the report data is generated and ready to display, vertical placement is largely automatic.
In theory, auto-generating line breaks in your field could push things down and simulate vertical alignment, but it would require extensive use of shared variables. Perhaps it's time to consider a different design for your report?

jfreechart pie chart fixed pie radius

I have dynamic pie set and if there are a lot of series then pie get small.
How to set fixed pie chart radius.
A PiePlot grows to fill the space available, so you'll need to give it room to grow. Some possible approaches:
Override getPreferredSize() and use a suitable layout, as shown here among other suggestions.
Display the legend items in an adjacent component, as shown here, leaving the chart alone to fill it's container.
Reposition the legend within the chart, as shown here for the default RectangleEdge.BOTTOM.

Aligning BIRT charts regardless of the legend size

I have created a BIRT report with multiple charts.
All the charts include different data but for the same time span.
So i want to make the x axis of the charts align with each other so it is easy to read all the charts at once.
But the series names of these charts are different from each other.And some charts gets dynamic series names in which the length cannot be predicted.
Even though i align the charts with same width and height because of the series names the legend gets too lengthy and the alignment gets ruined.
According to the requirements given to me legend should be placed at the right side of the chart.
Is there a way to fix the size of the legend without truncating the series names.May be a way to wrap the series names so the size of the legend will be same for all the charts and the charts will be aligned nicely.
From your Eclipse designer:
Edit charts -> Format charts -> Legend -> Layout -> Wrapping width
Set a wrapping width value as expected, for example try 60.
You might also have to increase the bottom inset of legend entries to avoid overlapping:
Edit charts -> Format charts -> Legend -> Entries -> Bottom inset
From your Eclipse designer: set Format Chart->Legend->Entries->Ellipsis property to possible max length of your dynamic legends. and the problem will be solved.
As this property work as follows:
The default value is "1". Int attribute "Ellipsis" specifies the behavior of shortening the legend item's text with ellipsis if there is not enough space to display the whole text. Value 0 indicates that the feature is disabled, and the legend item will either be displayed with whole text or be dropped. A positive value n represents the minimal count of characters to be displayed before the ellipsis, which means the legend item will either be dropped or be displayed with at least n characters.
Hope this will solve your problem. It worked for me.

How to increase Height and Width of Crosstab Cell in Crystal report dynamically according to text size?

How to increase Height and Width of Crosstab Cells in Crystal report dynamically according to text size. I have already checked the "Can grow" property to true for individual cells but have no change.
I am new in crystal reports. Please help me.
Don't think you can. You only get to set the height and width of one crosstab cell at design time. You may have to consider a different approach that 'simulates' different column widths in the crosstab.