Beispiel #1
0
        public bool EditDataSource(
            Flex.C1FlexReport report,
            Hashtable dataSchema,
            Flex.DataSource dataSource,
            FlexDesignerHostServices services,
            bool newDataSource = false)
        {
            _report        = report;
            _newDataSource = newDataSource;
            _cmbDataSourceName.DropDownStyle = ComboBoxStyle.DropDownList;
            foreach (Flex.DataSource ds in report.DataSources)
            {
                _cmbDataSourceName.Items.Add(ds.Name);
            }
            //
            System.Diagnostics.Debug.Assert(_report.DataSources.Contains(dataSource), "We can only handle datasources that are in the report's DataSources collection");
            //
            _dspMain.DataSchema = dataSchema;
            SetDataSource(dataSource);

            // initialize picker control
            _dspMain.DesignerHostServices = services;
            // _dspMain.DataSource = dataSource;

            // set up form events
            // _dspMain.DoubleClick += new EventHandler(_btnOK_Click);

            // ready to go
            return(ShowDialog() == DialogResult.OK);
        }
Beispiel #2
0
        private void SetDataSource(Flex.DataSource dataSource)
        {
            // this check avoids duplicate error messages when opening a bad data source:
            if (dataSource == _dataSource)
            {
                return;
            }

            _dataSource                     = dataSource;
            _cmbDataSourceName.Text         = _dataSource.Name;
            _cmbDataSourceName.SelectedItem = _dataSource.Name;

            //
            _dspMain.DataSource = dataSource;

            // initialize members
            _dspMain.IsolationLevel = dataSource.IsolationLevel;
            _dspMain.SetDataSource(dataSource.DataProvider, dataSource.ConnectionString, dataSource.RecordSource);

            // set up form events
            // _dspMain.DoubleClick += new EventHandler(_btnOK_Click);
        }