How to add a Pie Chart using another data source from main report data source - crystal-reports

I want to add below of my report a pie chart that uses another data source from reports main data. I'm trying to add another source on my dataset but Crystal has a mechanism that linking relational fields, and if i link them rows are repeating on report and if i don't link then no data appearing on report. Any ideas?

In crystal reports, you can add subreport and one dataset with many datatable (main report data and pie chart data).
Right click on main report, insert subreport. Choose another datasource from main report. Clean all report items and add pie chart to this subreport using the datasource.
Its OK.

Related

Jaspersoft - Use subdatasource for a chart in subreport

Scenario:
Main report with json datasource.
Subreport with two chart inside.
I'm able to subdatasource the subreport using a JRDataSourceExpression:
((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("response.graficiPercentuali.sostenibilita")
My question is:
Is possible to do the same thing for fill the charts in the subreport?
First chart should use for example:
((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("response.graficiPercentuali.sostenibilita.chart1")
The second one:
((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("response.graficiPercentuali.sostenibilita.chart2")
I have tried to right click on the Dataset of the chart in the Outline but the JRDataSourceExpression
is disabled. Probaly because in the Dataset Run I have main dataset..
How or where I can do that?
Thanks
Andrea

How to create a vertical line chart from fields on detail record

Trying to create a vertical line chart from data in 4 separate fields per Detail record.
I know how to do it using Excel (see image), trying to figure out how to do it using Crystal Charts. Also, data is per detail record and I found that I can only insert a chart on a header or footer section.
I'm also not sure I'm using the correct verbiage as I can't seem to find an answer using google searches.
Thanks!
You can insert chart into crystalreport from insert --> chart and choose type of chart and data will show in chart, chart insert in header and footer report but will contain all data you choose, also you can insert chart into hadear and footer group if you use group.
Note: Attached picture from crystal report
You can insert a group to provide header/footer for each detail section.
Or, one of the Crystal Reports User Function Libraries listed here allows you to add special charts anywhere you wish within your report, feeding the data into the chart using formula logic.

Crystal Reports Data Formatting Issue

I inherited a report where when you run it, the data will be divided into two columns and four rows on one page. I am wanting to change the format so it displays like a basic report where it's just rows listed straight down on the page. The report is below. I am using Crystal Reports 2008 version 12.3.
Report Design:
Report Preview:
Right click in the gutter of the Details section and choose Section Expert...
Clear the Format with Multiple Columns checkbox

Linking fields to subreport

In my main report I have some fields which I need to use in my subreport.
Right now I'm loading one csv file in both the main and the sub reports, but this seems to slow down the preview of my reports (I need these reports in a program). Eve if I use the preview in Crystal Reporst, it loads 3 times the same database, so I was thinking about linking the fields.
So I do Right Click on Subreport -> Change Subreport Links... and then I put the fields I want on the right side of the shown table. But when I do a preview of the whole report, in the subreport it shows only the first line and not all the values inside.
How do I manage to make the subreport show all the values of the fields?

Editing the column size inside subreport using jasper API

I have a jrxml file containing six subreports.
I need to programatically hide the columns displayed in these subreports.
I did search for a solution, but could not find a example for modifying the columns in subreports and I am unable to find a way with jasper API to pick the subreport from JasperReport class.
I did check dynamicreports API. But it seems subreport can't already have columns defined in it.