internal static ReportParameter ElementToObject(RdlReportParameter reportParameterElement, ReportMeta reportMeta)
        {
            if (reportParameterElement == null)
            {
                throw new ArgumentNullException("reportParameterElement");
            }
            if (reportMeta == null)
            {
                throw new ArgumentNullException("reportMeta");
            }

            var reportParameter = new ReportParameter();

            reportParameter.DataType   = StringToDataTypeEnum(reportParameterElement.DataType);
            reportParameter.MultiValue = StringToBool(reportParameterElement.MultiValue);

            // Load available values
            var validValues = reportParameterElement.ValidValues;

            if (validValues != null)
            {
                var parameterValues  = validValues.ParameterValues;
                var dataSetReference = validValues.DataSetReference;

                // Explicit list
                if (parameterValues != null)
                {
                    var values = from parameterValue in parameterValues
                                 select new Tuple <string, object>(
                        parameterValue.Label,
                        PhraseToValue(reportMeta, reportParameter.DataType, parameterValue.Value));

                    reportParameter.AvailableValues = values.ToArray();
                }
                else if (dataSetReference != null)
                {
                    // TODO: Datasets etc
                    throw new NotImplementedException();
                }
            }

            // Load default values
            var defaultValues = reportParameterElement.DefaultValue;

            if (defaultValues != null)
            {
                var values           = defaultValues.Values;
                var dataSetReference = defaultValues.DataSetReference;

                // Explicit list
                if (values != null)
                {
                    reportParameter.DefaultValues = (from value in values
                                                     select PhraseToValue(reportMeta, reportParameter.DataType, value)).ToArray();
                }
                else if (dataSetReference != null)
                {
                    // TODO: Datasets etc
                    throw new NotImplementedException();
                }
            }

            return(reportParameter);
        }
        internal static ReportParameter ElementToObject(RdlReportParameter reportParameterElement, ReportMeta reportMeta)
        {
            if (reportParameterElement == null) throw new ArgumentNullException("reportParameterElement");
            if (reportMeta == null) throw new ArgumentNullException("reportMeta");

            var reportParameter = new ReportParameter();
            reportParameter.DataType = StringToDataTypeEnum(reportParameterElement.DataType);
            reportParameter.MultiValue = StringToBool(reportParameterElement.MultiValue);

            // Load available values
            var validValues = reportParameterElement.ValidValues;
            if (validValues != null)
            {
                var parameterValues = validValues.ParameterValues;
                var dataSetReference = validValues.DataSetReference;

                // Explicit list
                if (parameterValues != null)
                {
                    var values = from parameterValue in parameterValues
                                 select new Tuple<string, object>(
                                     parameterValue.Label,
                                     PhraseToValue(reportMeta, reportParameter.DataType, parameterValue.Value));

                    reportParameter.AvailableValues = values.ToArray();
                }
                else if(dataSetReference != null)
                {
                    // TODO: Datasets etc
                    throw new NotImplementedException();
                }
            }

            // Load default values
            var defaultValues = reportParameterElement.DefaultValue;
            if (defaultValues != null)
            {
                var values = defaultValues.Values;
                var dataSetReference = defaultValues.DataSetReference;

                // Explicit list
                if (values != null)
                {
                    reportParameter.DefaultValues = (from value in values
                                                     select PhraseToValue(reportMeta, reportParameter.DataType, value)).ToArray();
                }
                else if (dataSetReference != null)
                {
                    // TODO: Datasets etc
                    throw new NotImplementedException();
                }
            }

            return reportParameter;
        }