示例#1
0
        // Obtain the data for the report
        internal bool RunGetData(Report rpt, IDictionary parms)
        {
            bool bRows = false;

            // Step 1- set the parameter values for the runtime
            if (parms != null && ReportParameters != null)
            {
                ReportParameters.SetRuntimeValues(rpt, parms);                  // set the parameters
            }
            // Step 2- prep the datasources (ie connect and execute the queries)
            if (this._DataSourcesDefn != null)
            {
                _DataSourcesDefn.ConnectDataSources(rpt);
            }

            // Step 3- obtain the data; applying filters
            if (_DataSetsDefn != null)
            {
                ResetCachedData(rpt);
                bRows = _DataSetsDefn.GetData(rpt);
            }

            // Step 4- cleanup any DB connections
            if (_DataSourcesDefn != null)
            {
                if (!this.ContainsSubreport)
                {
                    _DataSourcesDefn.CleanUp(rpt);                      // no subreports means that nothing will use this transaction
                }
            }

            return(bRows);
        }