Beispiel #1
0
 private void RegisterExpression(ExprCompileTimeInfo exprCTInfo)
 {
     if (this.m_ctExprList == null)
     {
         this.m_ctExprList = new ExprCompileTimeInfoList();
     }
     exprCTInfo.ExpressionInfo.CompileTimeID = this.m_ctExprList.Add(exprCTInfo);
 }
Beispiel #2
0
 public void ConvertFields2ComplexExpr()
 {
     if (this.m_reportLevelFieldReferences != null)
     {
         for (int num = this.m_reportLevelFieldReferences.Count - 1; num >= 0; num--)
         {
             ExprCompileTimeInfo exprCompileTimeInfo = (ExprCompileTimeInfo)this.m_reportLevelFieldReferences[num];
             this.m_langParser.ConvertField2ComplexExpr(ref exprCompileTimeInfo.ExpressionInfo);
             this.RegisterExpression(exprCompileTimeInfo);
         }
     }
 }
Beispiel #3
0
        private void ParseErrors(CompilerResults results)
        {
            int count = results.Errors.Count;

            if (results.NativeCompilerReturnValue != 0 && count == 0)
            {
                m_errorContext.Register(ProcessingErrorCode.rsUnexpectedCompilerError, Severity.Error, m_expressionHostAssemblyHolder.ObjectType, null, null, results.NativeCompilerReturnValue.ToString(CultureInfo.InvariantCulture));
            }
            for (int i = 0; i < count; i++)
            {
                CompilerError error = results.Errors[i];
                int           id;
                switch (m_builder.ParseErrorSource(error, out id))
                {
                case ExprHostBuilder.ErrorSource.Expression:
                {
                    ExprCompileTimeInfo exprCompileTimeInfo = m_ctExprList[id];
                    RegisterError(error, ref exprCompileTimeInfo.NumErrors, ref exprCompileTimeInfo.NumWarnings, exprCompileTimeInfo.OwnerObjectType, exprCompileTimeInfo.OwnerObjectName, exprCompileTimeInfo.OwnerPropertyName, ProcessingErrorCode.rsCompilerErrorInExpression);
                    break;
                }

                case ExprHostBuilder.ErrorSource.CustomCode:
                    RegisterError(error, ref m_customCodeNumErrors, ref m_customCodeNumWarnings, m_expressionHostAssemblyHolder.ObjectType, null, null, ProcessingErrorCode.rsCompilerErrorInCode);
                    break;

                case ExprHostBuilder.ErrorSource.CodeModuleClassInstanceDecl:
                {
                    if (m_ctClassInstDeclList == null)
                    {
                        m_ctClassInstDeclList = new CodeModuleClassInstanceDeclCompileTimeInfoList();
                    }
                    CodeModuleClassInstanceDeclCompileTimeInfo codeModuleClassInstanceDeclCompileTimeInfo = m_ctClassInstDeclList[id];
                    RegisterError(error, ref codeModuleClassInstanceDeclCompileTimeInfo.NumErrors, ref codeModuleClassInstanceDeclCompileTimeInfo.NumWarnings, Microsoft.ReportingServices.ReportProcessing.ObjectType.CodeClass, m_expressionHostAssemblyHolder.CodeClasses[id].ClassName, null, ProcessingErrorCode.rsCompilerErrorInClassInstanceDeclaration);
                    break;
                }

                default:
                    m_errorContext.Register(ProcessingErrorCode.rsUnexpectedCompilerError, Severity.Error, m_expressionHostAssemblyHolder.ObjectType, null, null, FormatError(error));
                    throw new ReportProcessingException(m_errorContext.Messages);
                }
            }
        }
        private void ParseErrors(CompilerResults results, CodeClassList codeClassInstDecls)
        {
            int count = results.Errors.Count;

            if (results.NativeCompilerReturnValue != 0 && count == 0)
            {
                this.m_errorContext.Register(ProcessingErrorCode.rsUnexpectedCompilerError, Severity.Error, ObjectType.Report, null, null, results.NativeCompilerReturnValue.ToString(CultureInfo.CurrentCulture));
            }
            for (int i = 0; i < count; i++)
            {
                CompilerError error = results.Errors[i];
                int           num   = default(int);
                switch (this.m_builder.ParseErrorSource(error, out num))
                {
                case ExprHostBuilder.ErrorSource.Expression:
                {
                    ExprCompileTimeInfo exprCompileTimeInfo = this.m_ctExprList[num];
                    this.RegisterError(error, ref exprCompileTimeInfo.NumErrors, ref exprCompileTimeInfo.NumWarnings, exprCompileTimeInfo.OwnerObjectType, exprCompileTimeInfo.OwnerObjectName, exprCompileTimeInfo.OwnerPropertyName, ProcessingErrorCode.rsCompilerErrorInExpression);
                    break;
                }

                case ExprHostBuilder.ErrorSource.CustomCode:
                    this.RegisterError(error, ref this.m_customCodeNumErrors, ref this.m_customCodeNumWarnings, ObjectType.Report, (string)null, (string)null, ProcessingErrorCode.rsCompilerErrorInCode);
                    break;

                case ExprHostBuilder.ErrorSource.CodeModuleClassInstanceDecl:
                {
                    if (this.m_ctClassInstDeclList == null)
                    {
                        this.m_ctClassInstDeclList = new CodeModuleClassInstanceDeclCompileTimeInfoList();
                    }
                    CodeModuleClassInstanceDeclCompileTimeInfo codeModuleClassInstanceDeclCompileTimeInfo = this.m_ctClassInstDeclList[num];
                    this.RegisterError(error, ref codeModuleClassInstanceDeclCompileTimeInfo.NumErrors, ref codeModuleClassInstanceDeclCompileTimeInfo.NumWarnings, ObjectType.CodeClass, codeClassInstDecls[num].ClassName, (string)null, ProcessingErrorCode.rsCompilerErrorInClassInstanceDeclaration);
                    break;
                }

                default:
                    this.m_errorContext.Register(ProcessingErrorCode.rsUnexpectedCompilerError, Severity.Error, ObjectType.Report, null, null, this.FormatError(error));
                    throw new ReportProcessingException(this.m_errorContext.Messages);
                }
            }
        }