I am using HTML5 bar charts for one of the report. I have a question on tooltip formatting option we have for charts. I need to display amount values for each of the series (coutry in my case) in the graph and the amount should be formatted based on each currency. So, the decimal format will change for each value.
Under Tooltip -> Formatting, I see an option called Value decimals which allow us to configure the decimal places. But, this is a constant value and I cannot get different decimal points for different series. I tried to use the expression in this field but it is not helping as the bar chart is present in summary band and always picks up last value. Is there any way to include custom formatting in "Point Format" option of formatting? I tried to include some HTML codes in it, but it is not working. Please do let me know if there are any other way to handle this issue.
I tried using tooltip.Formatter function, but I don't see that formatting has been applied to the chart result. Below are the values I am using in different properties.
tooltip.formatter - "(function() {return this.series.name + '<b>'+ Highcharts.numberFormat(this.point.y, this.point.exponent)+ '</b>' ; } )"
tooltip.pointFormat - <span style="color:{point.color}">●</span> {series.name}: <b> {point.y} </b><br/>
(point.exponent is a bucket property I defined for each series)
Could you please let me know what I am doing wrong here ?
This is working now. We need to enable function execution for highcharts in Jasper studio preferences and once we do that, the above solution is working fine.
Related
In my Vaadin Flow application, I'm using the Vaadin DateTimePicker component. If I select a date, it will be displayed without the leading zeros (e.g. "4.7.2021"). I would like the component to display the leading zeros (e.g. "04.07.2021"), but I could not find an API call to do so. Locale is Switzerland. Any ideas? I guess I'm missing a really easy solution to this all-day-problem…
You should use the EnhancedDatePicker https://vaadin.com/directory/component/enhanced-datepicker
There you can set pattern and even parsers. For example:
// how the date should be formatted
datePicker.setPattern("dd.MM.yyyy);
// allowed formats to enter the date
datePicker.setParsers("ddMMyy", "ddMMyyyy", "dd.MM.yy", "dd.MM.yyyy");
I'm reading currency values from a website and I'd like to do some calculations with these numbers. They come in this format:
$7,821.24
Here's an example file:
https://docs.google.com/spreadsheets/d/1vHEH_m16KXcDh7hY_BVG9lur1huFjWOnx5bWtgrdGdA/edit?usp=sharing
Now for some reason neither VALUE() and TO_PURE_NUMBER work for me (Can't parse to numberic value, telling me it's a text value).
My guess is that the comma and the $-sign confuse the formula, is there anything I can do to format this correctly? The dollar sign always appears in the values but the comma only appears separating thousands of values.
I just started using Sheets for this so I absolutely have no clue. Would really appreciate if someone could help me out.
Thanks for your time!
Issue:
It's a locale problem. The value coming from IMPORTXML is formatted as in United States locale, so your spreadsheet (which uses a different format) cannot convert it.
Solution #1. Changing locale:
If the spreadsheet locale is changed to United States or others with the same format (via selecting File > Spreadsheet settings and setting the mentioned locale), the retrieved value will be a number, and you can work with it without using any other formula.
Solution #2. Formula:
If changing the locale is not an option, one possible way to convert the value to a valid number in your locale is the following formula:
=SUBSTITUTE(SUBSTITUTE(RIGHT(A2;LEN(A2)-1);",";"");".";",")
Changing locale didn't work in my case. But I was able to split the number which google sheet isn't detecting as a real number. So split it with "," and "." and any currency sign you may have, and then combine individual values for desired output
I have a report that calculates the % of Revenue versus the total Contract Value for a job. In SSRS I have it set to a percentage with 2 decimal points. The format property is set to %0.00. Now when I export to excel it looks great in all cases but one. If the Revenue Amount is $0.00 and its divided by a Contract Value greater then $1 then the value is set to 0.0000000000000000 in Excel and not the 0.00% I expect.
How can I make it so it displays the expected 0.00%?
When creating Reporting Services (SSRS) reports, I have used FormatCurrency() and FormatPercent() around values to make the report look good. I learned that when you use those values, and export to Excel, you end up losing the ability to sum the values and what's on your SSRS report is much different on your Excel worksheet. This is because everything is exported as text.
How to solve this. Remove all the FormatCurrency() and FormatPercent() functions.
On each of your fields, highlight them, then in the properties area, there is a “Format” property. I set that to C2 (C for Currency, 2 for the number of digits after the decimal, so if you wanted zero, it would be C0). Again for Percentages, same thing, highlight all the fields, and set “Format” to P2 (P for Percentage, 2 for the number of digits after the decimal).
Have you tried using P2 in the format property?
The Standard Numeric Formats tend to render better in Excel.
UPDATE:
I have recently had an issue where I was using P1 for the format but the export would be 2 decimal places unless it rounded to 1.
The fix was to use 0.0% for the format property instead of P1. Now all of the cells have the same formatting - even the zeroes.
I tried the suggested answer and it works great for currency. I wanted just plain decimals and ended up going with " #,0;(#,0);'' ". The final parameter makes zero values invisible. Of course, there are a ton of these formats.
Text Box Properties
I got this by using the Number tab on the Text Box Properties dialogue box (right-click the text box and select Text Box Properties). Once I set it, I could return to the Properties window for the text box and see how that action got translated. Then I applied it to all the text boxes in the tablix.
Hope this helps.
TextBox Properties Dialogue Box
I have an html5 (highcharts) line chart in Jasper reports. Currently it seems like the symbols used to mark the line for each series are chosen for a fixed list, then cycled. I'd like to set the symbol for series 1, series 2... explicitly in the same way as you can for colors
e.g. colors java.util.Arrays.asList("#4572A7","#4572A7","#AA4643","#AA4643","#89A54E","#89A54E","#80699B","#80699B")
I'm aware that you can hardcode the symbol for all lines using plotOptions.line.marker.symbol.
I'm also aware of options.symbols mentioned in the api http://api.highcharts.com/highcharts#series.data.marker but I don't know how to write to this from Jasper or if this is possible.
I found a way to do this with help from Jasper support. You'd have to create a field in the query to return the correct marker for each series "circle", "square", "diamond", "triangle" and "triangle-down" etc.
Then you can add a bucket property against the series with the value of the field returned.
Then in the measure create an advanced property
Built-in Series Property Contributor
marker.symbol
refer it to the bucket property value from the series e.g.
seriesName.MarkerSymbol
This will contain the correct symbol for each series as I originally requested
While we ask a question, SO shows related questions. If we hover on the questions the content is displayed as a tooltip which contains linebreaks, indentations etc. What technique SO uses for it? How to display tooltips wit the formatting?
Other than, jquery/javascript is there any simple way to achieve it?
Was just wondering, should i ask this on Meta?
It is just a title attribute on the hyperlink, plain and simple.
<a href="..." title="The value is approximately
3.14159265
but for simplicity you can always round it
to exactly 3.0">What is the value of Pi?</a>
In IE, Chrome & Safari, it honors the line breaks a bit more strictly than say Firefox or Opera.
I took this html actually from stackoverflow. Here is no magic here:
Here's a dumb question which I can't find an answer to:
I have a table which contains 20 fields, a few of which are date/time. I am interested in pulling all the fields. I would like to … ">Selecting fields in SQL Select statements (Dumbest SQL Question)</a>
As you see, title can have line breaks!