I am using Vaadin charts from vaadin 7.7.6. When I create a chart where I have several values obtained in different dates, the chart is created correctly. Here I put an image of the obtained result where each value is a pair to be represented.
The issue comes, when I want to convert this chart to a PDF file or create a web service that returns this chart as an image to be included elsewhere.
For creating an image from the chart, I use the SVGGenerator as recommended in the documentation. In general, it works really fine and I am able to create PDFs with charts inside. But with this chart I have an issue if the X axis is using dates. Here I copy the chart after converted to SVG:
(I have removed some chart controls as the Navigation and the Range selector because are useless in an image or PDF).
At the image we can observe that now in the X axis the dates are not showed correctly. I have checked for several hours the issue, and I am pretty sure that the issue is related to the SVGConversor.
Reading the SVGConversor code, I found a withLang(String lang) method. My thought was that maybe, if I set the language, the date is showed correctly (something similar to localization). I am not able to found any documentation of the value needed to this function and therefore, I have tried some values such as en, en_EN, en-EN, English, .... But does not matter the value I put there, always this error is launched:
java.lang.RuntimeException: SVG generation failed: ReferenceError: Can't find variable: en
Still, I am not sure that the withLang(String lang) method is the solution to my issue.
The question is: How can I show the correct dates in the X axis of my chart when converted to SVG?
Seems that the solution at the end was really easy. The issue is that I have not set the xAxis type. It is not a problem when using the chart in a Vaadin view, but it is mandatory for the SVGConverter to know the axis. Then adding this line of code:
chart.getConfiguration().getxAxis().setType(AxisType.DATETIME);
Fix the issue with the SVGConverter. Now the chart is represented correctly in my PDF documents.
Related
I'm having trouble with a combination chart. I'm using the old-school chart because same vis in the Legacy Visualizations and New Visualizations forces a second values axis with a different scale on the right. I don't want that.
The trouble I'm having is that not all of the observations are showing up. I have a page with a chart and a list. Both use the same query, but some observations are missing from the chart.
[MATSLabNumberNumeric] = cast ( substring ( [MATS Lab Number], 6 ), int ) where MATS Lab Number is like FA0200088 (for the first observation in the list). All observations are displayed if the MATS Lab Number is used, but not if MATSLabNumberNumeric is used.
I tried resizing the chart, but as expected, changing the layout had no effect on the data being presented. It just made the columns wider or narrower.
I have had the same results in all combinations of these:
Cognos Analytics 11.0.13
Cognos Analytics 11.1.7
Interactive Viewer
Compatible Viewer
11.4 styles
10.x styles
combination chart
bar chart
column chart
area chart
line chart
Any idea what could be causing this? Is there a property I inadvertently flipped?
You can try adjusting the width of the chart under the Size and Overflow property.
I have several bar charts, all configured to show Data Labels.
The data labels object box is showing (I can also apply Fill and Border colors to it). However, this object is always EMPTY. Regardless of what I tick to show (e.g. Values, Values from Cells, Series Name, etc...) - it is always empty, with the minimum (shrunk) width (as it should expand per the value presented). If I tick to show the "Legend Key" - a colored square does show to the left of the empty label box.
There's no issue with the font definition, or colors, but it seems as if some underlying theme-wide setting is causing this behavior with all charts on this Workbook.
I have a matching Workbook before some formatting (branding) were applied, in which Data Labels are working just fine. I compared all Data Labels settings and options - they are identical.
Any idea where else can I look?
Thanks!
Updating here that the issue is solved.
I believe it is some sort of a bug in Excel 2016.
I deleted the Data Labels and Re-created them, now it is working normally.
I have to delete per each chart where this problem was evident.
I know how tricky it is to align things in a way that allows a clean export to excel, however, on this one I am stumped and have never seen it before.
Anyone know why the excel rendering extension insists on inserting a column like in the attached image?
Things that I have tried.
Set the table's position to 0,0.
Removed all borders and padding.
Set the report margins to 0,0,0,0
NOTE : I am using the EXCELOPENXML rendering format as opposed to EXCEL in order to support *.xlxs.
Groupings:
First Column in the Designer:
The report was being rendered as a sub report and was placed in a rectangle and aligned right in the main report, however, the rectangle was one twip off from left align. Once I aligned the rectangle in the main report, the phantom column disappeared.
I have several custom screens which have grids. On all but one of them I can resize the columns. In the one where I can't resize, I'm using BLC code to determine when to hide the column and what to display as the name of the column. I do this as follows:
PXUIFieldAttribute.SetVisible<xTACOpenSourceDetail.string03>(OpenSourceDataDetail.Cache, null, true);
PXUIFieldAttribute.SetDisplayName<xTACOpenSourceDetail.string03>(this.OpenSourceDataDetail.Cache, ossd.String03);
All my grids are set up the same way, except for this one difference. Is there an attribute or property I can set to make sure these columns are sizable as well?
After dissecting this for a while, The solution I've come up with was to re-create the entire screen from scratch. This corrected the issue, and I can only conclude that something became corrupted within the original screen and could not be refreshed or recompiled. It is still unknown what caused the issue to begin with.
I have an Excel file generated by JasperReports. What you can see here is the Excel's column will be display ### if the number is too long. I don't want to resize the width of column, i just want to display the number without seen as ### and stretch the height. I have tried set the column to Stretch with overflow and Stretch type = Relative to band height
This is the screenshot:
You will need to set the appropriate Jasper Reports excel property on your report element, or on the whole report iself. Documentation: http://jasperreports.sourceforge.net/sample.reference/xlsfeatures/
Specifically
net.sf.jasperreports.export.xls.column.width.ratio
If these properties are not available in your JasperReports version, you may have to simply fiddle around with the sizing to get something decent.