Specifying a different data source
Once the project is loaded into the application, you can specify a data source other than the one contained by default in the project. This is an important feature, since the Designer is used with sample data that contains only enough information to specify the drawing style.
The following code example shows how to include a different data source.
Specifying a different data source
// Create a project configuration
IlvGanttProjectConfiguration configuration = new
IlvGanttProjectConfiguration();
// Read the configuration file.
configuration.read(url);
// The project configuration now contains the styling, the
//reference to the data source and the Gantt model from this
//data source.
// In order to change the data source of this configuration,
// we need to:
// 1. Change the data source of this configuration.
// 2. Create the data model from this data source, and put it
// into the configuration.
// 3. Apply this new configuration to the Gantt
// 1. Change the data source by referencing a new XML file
IlvGanttXMLDataSource dataSource = new
IlvGanttXMLDataSource();
dataSource.setDataURL(getResourceURL(complexXML));
configuration.setDataSource(dataSource);
// 2. Update the Gantt model of the configuration associated
// with this data source.
dataSource.read(configuration.getGanttModel());
// 3. Apply the new configuration to the chart.
configuration.apply(chart);
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.