Chart control within Report Designer
Hello. Has anyone had success creating charts in the Report Designer? A a test I'm trying to create a simple chart that would show the total of acres by zoning for selected parcels. I can't figure out how to set the chart's data source to the selected parcel records.
Thanks
Chris
-
I'd like to add my voice to yours.
Surely there is some doco on how to link charts to feature classes. I'd like to let users select a bunch of features and get a pie chart of the values.
0 -
Chris and Peter,
I have tried with extremely limited success to incorporate the chart control into an Essentials report. My take is that the way Essentials binds the data to the report doesn't work well with the chart control in the Report Designer. I think that the chart control (along with the OLE Object control) are not usable...I'll look into whether these default controls can and should be removed from the toolbox in the Essentials report designer to reduce confusion.
To get charts into reports, you'll have to use another external charting library to generate images, then insert the images into the report as bitmaps. Unfortunately, this will likely need to be done via scripting in the report template itself, or using the TemplateReport workflow activity which allows you to create your own data structure to supply to the report. The Google Charts API is one such charting library that can return chart images from a set of data that you pass to the URL.
As for the limited success I've had, that was with a complex script inside the report template which accessed the chart control itself and manually set all of the data points on each axis, and it involved a lot of referencing the Active Reports documentation. I've also heard of some success by others who have created their own report template in code rather than using an RPX file. Both of these are quite heavy-handed, and I'm not sure the benefit would outweigh the effort, especially considering the options with external charting libraries. I would, though, be interested to hear if there has been other success with the chart control inside Active Reports with Essentials.
John
0 -
Thanks for the info John!
0 -
If you can access the data to be used in the chart via a database query, you can follow the steps (https://support.geocortex.com/essentialsGSCkba?sub-nav=kba&main-nav=essentials&feedtype=SINGLE_ARTICLE_DETAIL&dc=All_Essentials_kba&criteria=BESTANSWERS&id=kA360000000GqpQ) here to incorporate a chart control in your report.
-Victoria
0 -
Better late then never /customer/servlet/servlet.FileDownload?file=00P6000000e87w6EAA . I use a script similar to this to bind data to a chartcontrol:
public void ActiveReport_DataInitialize()
{
var chart = rpt.Sections["Detail1"].Controls["ChartControl1"] as ChartControl;
var dataSet = rpt.DataSource as DataSet;
chart.DataSource = dataSet.Tables[0];}
0 -
Hi Victoria,
I just stumbled across this thread and it looks like exactly what I need to do. Unfortunately, it looks like the link you've provided is broken. Would you mind referencing it again please and thank you?0 -
Warren, it appears that Victoria's article was not migrated from the old system. As it's an older article, I'd ideally get someone to verify that it still works (or verify it myself) before republishing, but it will likely be a few days before someone can do that here. As I don't want to delay you, and because it's Friday afternoon (where I'm currently sitting), I'm throwing caution to the wind and publishing it as-is. You can now find it (https://support.geocortex.com/essentialsGSCkba?sub-nav=kba&main-nav=essentials&feedtype=SINGLE_ARTICLE_DETAIL&dc=All_Essentials_kba&criteria=BESTANSWERS&id=kA360000000GqpQ) here . If you run into any problems with it, (To: community@geocortex.com) please let me know. 0 -
Hi Jordan,
That works perfectly. Thanks!
Warren0 -
Berend,
I know this is an old posting, but I'm curious about the script you've used in the chart control.
public void ActiveReport_DataInitialize()
{
var chart = rpt.Sections["Detail1"].Controls["ChartControl1"] as ChartControl;
var dataSet = rpt.DataSource as DataSet;
chart.DataSource = dataSet.Tables[0];
}
So, is dataSet.Tables[0]... is this the same table you build when you're trying to populate a template report?
And in your case, was there any need to establish a chart data source when you're passing data from a GVH viewer?
Walter0
Please sign in to leave a comment.
Comments
9 comments