Пример #1
0
        /// <summary>
        /// Match User input parameter values with Report parameters
        /// </summary>
        private void ProcessParameters()
        {
            var paramCount = _reportDoc.ParameterFields.Count;

            _logger.Write(string.Format("Number of Parameters detected in the report = {0}", _reportDoc.ParameterFields.Count));
            if (_reportDoc.DataDefinition.ParameterFields.Count > 0)
            {
                ParameterCore paraCore = new ParameterCore(ReportArguments.LogFileName, ReportArguments);
                paraCore.ProcessRawParameters();
                _logger.Write(string.Format(""));
                foreach (ParameterFieldDefinition _ParameterFieldDefinition in _reportDoc.DataDefinition.ParameterFields)
                {
                    if (!_ParameterFieldDefinition.IsLinked())
                    {
                        _logger.Write(string.Format("Applied Parameter '{0}' as MultiValue '{1}'", _ParameterFieldDefinition.Name, _ParameterFieldDefinition.EnableAllowMultipleValue));
                        ParameterValues values = paraCore.GetParameterValues(_ParameterFieldDefinition);
                        _ParameterFieldDefinition.ApplyCurrentValues(values);
                    }
                    else
                    {
                        _logger.Write(string.Format("Skipped '{1}' as MultiValue '{2}' Parameter in SubReport = '{0}' as its Linked to Main Report", _ParameterFieldDefinition.ReportName, _ParameterFieldDefinition.Name, _ParameterFieldDefinition.EnableAllowMultipleValue));
                    }
                    _logger.Write(string.Format(""));
                }
            }
        }
        /// <summary>
        /// Match User input parameter values with Report parameters
        /// </summary>
        private void ProcessParameters()
        {
            var paramCount = _reportDoc.ParameterFields.Count;

            if (paramCount > 0)
            {
                ParameterCore paraCore = new ParameterCore(_logfilename, ReportArguments.ParameterCollection);
                paraCore.ProcessRawParameters();
                var paramDefs = _reportDoc.DataDefinition.ParameterFields;
                for (int i = 0; i < paramDefs.Count; i++)
                {
                    ParameterValues values = paraCore.GetParameterValues(paramDefs[i]);
                    paramDefs[i].ApplyCurrentValues(values);
                }
            }
        }