Ejemplo n.º 1
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);
     }
 }
Ejemplo n.º 2
0
        private void CreateParameterPrompts(ReportParameterInfoCollection parameterInfos)
        {
            ReportParameterInfoCollection reportParameterInfoCollection = parameterInfos;

            if (reportParameterInfoCollection == null)
            {
                reportParameterInfoCollection = Report.GetParameters();
            }
            ParametersPaneLayout parametersPaneLayout = Report.GetParametersPaneLayout();
            bool isQueryExecutionAllowed = true;

            if (ViewerControl.ProcessingMode == ProcessingMode.Remote)
            {
                isQueryExecutionAllowed = ViewerControl.ServerReport.IsQueryExecutionAllowed();
            }
            m_paramControls.Populate(reportParameterInfoCollection, isQueryExecutionAllowed, toolTipForParams, Font, parametersPaneLayout);
        }
Ejemplo n.º 3
0
 private void EnsureParamsLoaded(bool forceCredentialsShown, ReportParameterInfoCollection parameterInfos)
 {
     try
     {
         promptPanel.SuspendLayout();
         Clear();
         ReportDataSourceInfoCollection dataSources = GetDataSources(out m_allCredentialsSatisfied);
         if (!m_allCredentialsSatisfied || forceCredentialsShown)
         {
             if (ViewerControl.ShowCredentialPrompts)
             {
                 AddDataSourcePrompts(dataSources);
                 return;
             }
             throw new MissingDataSourceCredentialsException();
         }
         CreateParameterPrompts(parameterInfos);
         if (ViewerControl.ShowParameterPrompts)
         {
             AddParameterPrompts();
             if (!m_paramControls.VisibleParameterNeedsValue && m_paramControls.HiddenParameterThatNeedsValue != null)
             {
                 throw new MissingParameterException(m_paramControls.HiddenParameterThatNeedsValue);
             }
         }
         else
         {
             ValidateReportInputsSatisfied();
         }
         SetCredentialLinkVisibility(dataSources.Count > 0 && ViewerControl.ShowCredentialPrompts);
     }
     finally
     {
         SetViewReportPosition();
         try
         {
             m_paramInfos  = Report.GetParameters();
             m_paramLayout = Report.GetParametersPaneLayout();
         }
         catch (Exception)
         {
         }
         promptPanel.ResumeLayout();
         promptPanel.AutoScroll = true;
     }
 }
Ejemplo n.º 4
0
 public ExecutionInfo(string executionId, string historyId, string reportPath, int numPages, bool hasDocumentMap, int autoRefreshInterval, bool credentialsRequired, bool parametersRequired, bool hasSnapshot, bool needsProcessing, DateTime expirationDateTime, bool allowQueryExecution, PageCountMode pageCountMode, ReportDataSourceInfoCollection dataSourcePrompts, ReportParameterInfoCollection parameters, ReportPageSettings pageSettings, ParametersPaneLayout parametersPaneLayout)
 {
     ExecutionID          = executionId;
     HistoryID            = historyId;
     ReportPath           = reportPath;
     NumPages             = numPages;
     HasDocumentMap       = hasDocumentMap;
     AutoRefreshInterval  = autoRefreshInterval;
     CredentialsRequired  = credentialsRequired;
     ParametersRequired   = parametersRequired;
     HasSnapshot          = hasSnapshot;
     NeedsProcessing      = needsProcessing;
     ExpirationDateTime   = expirationDateTime;
     AllowQueryExecution  = allowQueryExecution;
     PageCountMode        = pageCountMode;
     DataSourcePrompts    = dataSourcePrompts;
     Parameters           = parameters;
     ReportPageSettings   = pageSettings;
     ParametersPaneLayout = parametersPaneLayout;
 }
Ejemplo n.º 5
0
        private static ExecutionInfo FromSoapExecutionInfo(Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.ExecutionInfo soapExecutionInfo)
        {
            if (soapExecutionInfo == null)
            {
                return(null);
            }
            ReportParameterInfoCollection reportParameterInfoCollection = null;

            Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.ReportParameter[] parameters = soapExecutionInfo.Parameters;
            if (parameters != null)
            {
                ReportParameterInfo[] array = new ReportParameterInfo[parameters.Length];
                for (int i = 0; i < parameters.Length; i++)
                {
                    array[i] = SoapParameterToReportParameterInfo(parameters[i]);
                }
                reportParameterInfoCollection = new ReportParameterInfoCollection(array);
            }
            else
            {
                reportParameterInfoCollection = new ReportParameterInfoCollection();
            }
            PageCountMode  pageCountMode = PageCountMode.Actual;
            ExecutionInfo2 executionInfo = soapExecutionInfo as ExecutionInfo2;

            if (executionInfo != null && executionInfo.PageCountMode == Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.PageCountMode.Estimate)
            {
                pageCountMode = PageCountMode.Estimate;
            }
            ParametersPaneLayout parametersPaneLayout = null;
            ExecutionInfo3       executionInfo2       = soapExecutionInfo as ExecutionInfo3;

            if (executionInfo2 != null && executionInfo2.ParametersLayout != null && parameters != null)
            {
                parametersPaneLayout = new ParametersPaneLayout();
                SoapExecutionInfoToParametersLayout(parametersPaneLayout, executionInfo2, reportParameterInfoCollection);
            }
            ReportPageSettings pageSettings = new ReportPageSettings(soapExecutionInfo.ReportPageSettings.PaperSize.Height, soapExecutionInfo.ReportPageSettings.PaperSize.Width, soapExecutionInfo.ReportPageSettings.Margins.Left, soapExecutionInfo.ReportPageSettings.Margins.Right, soapExecutionInfo.ReportPageSettings.Margins.Top, soapExecutionInfo.ReportPageSettings.Margins.Bottom);

            return(new ExecutionInfo(soapExecutionInfo.ExecutionID, soapExecutionInfo.HistoryID, soapExecutionInfo.ReportPath, soapExecutionInfo.NumPages, soapExecutionInfo.HasDocumentMap, soapExecutionInfo.AutoRefreshInterval, soapExecutionInfo.CredentialsRequired, soapExecutionInfo.ParametersRequired, soapExecutionInfo.HasSnapshot, soapExecutionInfo.NeedsProcessing, soapExecutionInfo.ExpirationDateTime, soapExecutionInfo.AllowQueryExecution, pageCountMode, ReportDataSourceInfoCollection.FromSoapDataSourcePrompts(soapExecutionInfo.DataSourcePrompts), reportParameterInfoCollection, pageSettings, parametersPaneLayout));
        }
        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;
                }
            }
        }