Ejemplo n.º 1
0
        public static PublishingResult CompileReport(ICatalogItemContext context, byte[] reportDefinition, bool generateExpressionHostWithRefusedPermissions, out ControlSnapshot snapshot)
        {
            PublishingResult publishingResult = null;

            snapshot = null;

            try
            {
                ReportProcessing reportProcessing = new ReportProcessing();
                snapshot = new ControlSnapshot();
                AppDomain         appDomain = AppDomain.CurrentDomain;
                PublishingContext reportPublishingContext = new PublishingContext(context, reportDefinition, snapshot, appDomain, generateExpressionHostWithRefusedPermissions,
                                                                                  snapshot.ReportProcessingFlags, reportProcessing.Configuration, DataProtectionLocal.Instance);
                return(reportProcessing.CreateIntermediateFormat(reportPublishingContext));
            }
            catch (Exception inner)
            {
                string text = context.ItemPathAsString;
                if (text == null)
                {
                    text = ProcessingStrings.MainReport;
                }
                throw new DefinitionInvalidException(text, inner);
            }
        }