private void GetRowsAndColumnsToRender(out bool[] rowsToRender, out bool[] columnsToRender)
        {
            ReportParameterInfoCollection paramInfos           = m_paramInfos;
            GridLayoutDefinition          gridLayoutDefinition = m_paramLayout.GridLayoutDefinition;
            ParameterControlCollection    paramControls        = m_paramControls;
            int num  = -1;
            int num2 = -1;
            Dictionary <string, GridLayoutCellDefinition> dictionary = new Dictionary <string, GridLayoutCellDefinition>();

            bool?[] array  = new bool?[gridLayoutDefinition.NumberOfRows];
            bool?[] array2 = new bool?[gridLayoutDefinition.NumberOfColumns];
            rowsToRender    = new bool[gridLayoutDefinition.NumberOfRows];
            columnsToRender = new bool[gridLayoutDefinition.NumberOfColumns];
            foreach (GridLayoutCellDefinition cellDefinition in gridLayoutDefinition.CellDefinitions)
            {
                dictionary.Add(cellDefinition.ParameterName, cellDefinition);
            }
            foreach (ReportParameterInfo item in paramInfos)
            {
                GridLayoutCellDefinition gridLayoutCellDefinition = dictionary[item.Name];
                if (paramControls.ContainsKey(item.Name))
                {
                    array[gridLayoutCellDefinition.Row]     = false;
                    array2[gridLayoutCellDefinition.Column] = false;
                    num  = Math.Max(gridLayoutCellDefinition.Row, num);
                    num2 = Math.Max(gridLayoutCellDefinition.Column, num2);
                    continue;
                }
                if (!array[gridLayoutCellDefinition.Row].HasValue)
                {
                    array[gridLayoutCellDefinition.Row] = true;
                }
                if (!array2[gridLayoutCellDefinition.Column].HasValue)
                {
                    array2[gridLayoutCellDefinition.Column] = true;
                }
            }
            for (int i = 0; i < gridLayoutDefinition.NumberOfRows; i++)
            {
                if (i > num)
                {
                    rowsToRender[i] = false;
                }
                else
                {
                    rowsToRender[i] = (array[i] != true);
                }
            }
            for (int j = 0; j < gridLayoutDefinition.NumberOfColumns; j++)
            {
                if (j > num2)
                {
                    columnsToRender[j] = false;
                }
                else
                {
                    columnsToRender[j] = (array2[j] != true);
                }
            }
        }
Exemple #2
0
        protected ParameterControl(ReportParameterInfo paramInfo, ToolTip tooltip, Font font, bool allowQueryExecution, GridLayoutCellDefinition cellDefinition)
        {
            m_paramInfo           = paramInfo;
            m_tooltip             = tooltip;
            Font                  = font;
            m_allowQueryExecution = allowQueryExecution;
            m_cellDefinition      = cellDefinition;
            base.Enabled          = (!ShouldDisableParam && !DisableQueryParameter);
            Label value = new ParameterLabel(m_paramInfo.Prompt);

            base.Controls.Add(value);
        }
Exemple #3
0
 private static void SoapExecutionInfoToParametersLayout(ParametersPaneLayout paramPaneLayout, ExecutionInfo3 soapExecInfo3, ReportParameterInfoCollection paramInfoCollection)
 {
     if (soapExecInfo3.ParametersLayout.CellDefinitions != null)
     {
         int num = soapExecInfo3.ParametersLayout.CellDefinitions.Length;
         GridLayoutCellDefinition[] array = new GridLayoutCellDefinition[num];
         for (int i = 0; i < num; i++)
         {
             GridLayoutCellDefinition gridLayoutCellDefinition = new GridLayoutCellDefinition();
             gridLayoutCellDefinition.Column        = soapExecInfo3.ParametersLayout.CellDefinitions[i].ColumnsIndex;
             gridLayoutCellDefinition.Row           = soapExecInfo3.ParametersLayout.CellDefinitions[i].RowIndex;
             gridLayoutCellDefinition.ParameterName = soapExecInfo3.ParametersLayout.CellDefinitions[i].ParameterName;
             array[i] = gridLayoutCellDefinition;
         }
         GridLayoutDefinition gridLayoutDefinition = paramPaneLayout.GridLayoutDefinition = new GridLayoutDefinition(new GridLayoutCellDefinitionCollection(array), soapExecInfo3.ParametersLayout.NumberOfRows, soapExecInfo3.ParametersLayout.NumberOfColumns, paramInfoCollection);
     }
 }
        public void Populate(ReportParameterInfoCollection reportParameters, bool isQueryExecutionAllowed, ToolTip tooltip, Font font, ParametersPaneLayout layout = null)
        {
            GridLayoutCellDefinitionCollection gridLayoutCellDefinitionCollection = null;

            Clear();
            m_hiddenParameterThatNeedsValue = null;
            m_anyParameterThatNeedsValue    = null;
            m_visibleParameterNeedsValue    = false;
            HasLayout = (layout != null);
            if (HasLayout)
            {
                NumberOfCols = layout.GridLayoutDefinition.NumberOfColumns;
                NumberOfRows = layout.GridLayoutDefinition.NumberOfRows;
                gridLayoutCellDefinitionCollection = layout.GridLayoutDefinition.CellDefinitions;
            }
            foreach (ReportParameterInfo reportParameter in reportParameters)
            {
                if (!ShouldDisplayParameter(reportParameter))
                {
                    if (reportParameter.State != 0 && m_hiddenParameterThatNeedsValue == null)
                    {
                        m_hiddenParameterThatNeedsValue = reportParameter.Name;
                    }
                }
                else
                {
                    GridLayoutCellDefinition cellDefinition = null;
                    if (HasLayout)
                    {
                        cellDefinition = gridLayoutCellDefinitionCollection.GetByName(reportParameter.Name);
                    }
                    ParameterControl value = ParameterControl.Create(reportParameter, tooltip, font, isQueryExecutionAllowed, cellDefinition);
                    Add(reportParameter.Name, value);
                    if (reportParameter.State != 0)
                    {
                        m_visibleParameterNeedsValue = true;
                    }
                }
                if (reportParameter.State != 0 && m_anyParameterThatNeedsValue == null)
                {
                    m_anyParameterThatNeedsValue = reportParameter.Name;
                }
            }
        }
Exemple #5
0
 public BooleanControl(ReportParameterInfo paramInfo, ToolTip tooltip, Font font, bool allowQueryExecution, GridLayoutCellDefinition cellDefinition)
     : base(paramInfo, tooltip, font, allowQueryExecution, cellDefinition)
 {
 }
Exemple #6
0
 public static ParameterControl Create(ReportParameterInfo paramInfo, ToolTip tooltip, Font font, bool allowQueryExecution, GridLayoutCellDefinition cellDefinition)
 {
     if (paramInfo.MultiValue)
     {
         if (paramInfo.ValidValues != null)
         {
             return(new MultiValueValidValuesControl(paramInfo, tooltip, font, allowQueryExecution, cellDefinition));
         }
         return(new MultiValueTextControl(paramInfo, tooltip, font, allowQueryExecution, cellDefinition));
     }
     if (paramInfo.ValidValues != null)
     {
         return(new ValidValuesControl(paramInfo, tooltip, font, allowQueryExecution, cellDefinition));
     }
     if (paramInfo.DataType == ParameterDataType.Boolean)
     {
         return(new BooleanControl(paramInfo, tooltip, font, allowQueryExecution, cellDefinition));
     }
     if (paramInfo.DataType == ParameterDataType.DateTime)
     {
         return(new DateControl(paramInfo, tooltip, font, allowQueryExecution, cellDefinition));
     }
     return(new TextControl(paramInfo, tooltip, font, allowQueryExecution, cellDefinition));
 }