IllegalStateException: Unable to parse JSON chart configuration

Hello,
i have a problem in report chart show.
i created a report about skills with user links. (count users in a skill).
when I create .xlsx template it#s work fine but when I create Chart(pie) this is not functioning and i got error
“IllegalStateException: Unable to parse JSON chart configuration”

Error details

 java.lang.IllegalStateException: Unable to parse JSON chart configuration
	at com.haulmont.charts.web.toolkit.ui.amcharts.CubaAmchartsScene.setJson(CubaAmchartsScene.java:147)
	at com.haulmont.charts.web.gui.components.charts.amcharts.WebCustomChart.setNativeJson(WebCustomChart.java:65)
	at com.haulmont.charts.web.ui.JsonChartController.init(JsonChartController.java:28)
	at com.haulmont.cuba.gui.xml.layout.loaders.FrameLoader$FrameLoaderInitTask.execute(FrameLoader.java:271)
	at com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext$InitTaskExecutor.run(ComponentLoaderContext.java:266)
	at com.haulmont.cuba.gui.xml.layout.loaders.ComponentLoaderContext.executeInitTasks(ComponentLoaderContext.java:160)
	at com.haulmont.cuba.gui.WindowManager.openFrame(WindowManager.java:1014)
	at com.haulmont.cuba.gui.WindowManager.openFrame(WindowManager.java:964)
	at com.haulmont.cuba.gui.components.WindowDelegate.openFrame(WindowDelegate.java:307)
	at com.haulmont.cuba.web.gui.WebWindow.openFrame(WebWindow.java:534)
	at com.haulmont.cuba.gui.components.AbstractFrame.openFrame(AbstractFrame.java:569)
	at com.haulmont.reports.gui.report.run.ShowChartController.openChart(ShowChartController.java:115)
	at com.haulmont.reports.gui.report.run.ShowChartController.printReport(ShowChartController.java:138)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.haulmont.cuba.gui.xml.DeclarativeAction.actionPerform(DeclarativeAction.java:92)
	at com.haulmont.cuba.web.gui.components.WebButton.performAction(WebButton.java:46)
	at com.haulmont.cuba.web.gui.components.WebButton.lambda$new$61446b05$1(WebButton.java:38)

and I attached sample project zip file. without gradle and deploy folder. and report folder is also inside this file
sampleProject - Copy.zip (469.9 KB)

Thank you
John

sampleProject - Copy.zip (469.9 KB)

Hello,
Please help me to find the solution for this error.
Thank you

Hi

It is really hard to help you without knowing exact reproduction steps. We do not know your data model and you didn’t describe the use case.

Also, please make your question relevant to others, so that more community members could benefit from the response. Avoid specifics of your project where they are not necessary.

Hi,
In my project I would like to create report chart about Skill and their user count.
when i click “show charts” in report I want show my chart in side report.
For that I create a Chart template in side report with JPQL query

select
p.skill as "skill.name",
count(e.user.id) as "count"
from sampleproject$UserSkillLink e  
join sampleproject$Skill  p on p.id = e.skill.id
join sampleproject$Skillcategory sc on p.skillcategory.id= sc.id
where e.skill.skillcategory.name = ${skill_skillcategory_name1}
group by p.id, p.skill

report%20chart2
<a class=“attachment”

report file
Report for entity User Skill Link.zip (18.0 KB)

sample project
sampleProject - Copy.zip (469.9 KB)

error I got when I run

https://www.cuba-platform.com/discuss/t/illegalstateexception-unable-to-parse-json-chart-configuration/7076

Data model
data%20model

In skill entity I have 2 attributes Skill (string) and skillcategory( association ) type: Skillcategory [sampleproject$Skillcategory]

In Skillcategory entity have Attribute name(string)

In user entity have attributes name(string),position(string) and userskilllink(association) type UserSkillLink [sampleproject$UserSkillLink] and one to many

In userskilllink have attributes skill and user both are association and many to one

I think now you understand what is my problem. I would like to see the chart when i click Show chart in Reports. that’s all I want in this project.

thank you

Sorry, I meant simple steps to reproduce including test data. Finally, I’ve managed to reproduce the error.

And I see that the root cause of the problem is the issue of Show Charts screen. It always uses DEFAULT template to run report, thus it tries to show XLSX binary content as JSON.

We are planning to fix this issue in one of the bug fix versions of 6.10 release.

Thank you for your replay
As you said I change my chart template set to DEFAULT
Now I don’t have any error
but problem is it don’t show chart. i only see blank screen

reportchart

Chart Name: Pie chart
Band name : count
Title field : skill.name
value field: count

if there any mistake I done. Or this error you will fix in next version ?

Thank you so much helping me

Probably, your chart does not contain any data. Check your JPQL query

when I run in XLSX template with this same JPQL query I got my data and I made a graph in side Chart
everything work fine in XLSX output

outputchart

problem is only happen when I create chart template in side report .