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; } } }
internal GridLayoutDefinition(GridLayoutCellDefinitionCollection cellDefs, int numRows, int numColumns, ReportParameterInfoCollection paramInfoCollection) { m_cellDefinitions = cellDefs; m_numberOfRows = numRows; m_numberOfColumns = numColumns; m_columnsVisibility = new bool[numColumns]; m_rowsVisibility = new bool[numRows]; if (paramInfoCollection == null || !paramInfoCollection.Any()) { return; } int j; for (j = 0; j < m_numberOfColumns; j++) { IEnumerable <GridLayoutCellDefinition> enumerable = m_cellDefinitions.Where((GridLayoutCellDefinition p) => p.Column == j); if (!enumerable.Any() && j < m_cellDefinitions.Max((GridLayoutCellDefinition p) => p.Column)) { m_columnsVisibility[j] = true; } foreach (GridLayoutCellDefinition param in enumerable) { if (paramInfoCollection.Any((ReportParameterInfo p) => p.Name == param.ParameterName && IsParamVisible(p))) { m_columnsVisibility[j] = true; m_rowsVisibility[param.Row] = true; } } } int i; for (i = 0; i < m_numberOfRows; i++) { if (!m_cellDefinitions.Where((GridLayoutCellDefinition p) => p.Row == i).Any() && i < m_cellDefinitions.Max((GridLayoutCellDefinition p) => p.Row)) { m_rowsVisibility[i] = true; } } }