Пример #1
0
        private void Render(ReportExecutionService rs, string extension, ReportRenderArg args)
        {
            byte[] result       = null;
            string ext          = null;
            string executionID  = null;
            var    checkIsEmpty = args.EmptyOutput != null && !string.IsNullOrWhiteSpace(args.MainDataSet);

            try
            {
                Logger.Log(LevelEnum.Info, $"Rendering report {args.ItemPath} for {extension} format...");
                result = rs.Render(GetFormat(extension), null, out ext, out string encoding, out string mimeType, out Warning[] warnings, out string[] streamId);
Пример #2
0
        public void Render(ReportRenderArg args, string serverUrl)
        {
            var svcParameters = args.Parameters
                                .Select(p => ToSsrsParameter(p))
                                .ToArray();

            using (var rs = GetService(serverUrl, args.TimeoutInMinute))
            {
                Logger.Log(LevelEnum.Info, $"Loading report <{args.ItemPath}>");
                var execInfo = rs.LoadReport(args.ItemPath, null);
                Logger.Log(LevelEnum.Info, $"Setting report parameters");
                rs.SetExecutionParameters(svcParameters, "en-us");
                Logger.Log(LevelEnum.Info, $"SessionId: {rs.ExecutionHeaderValue.ExecutionID}");
                GetExtensions(args.RenderFormat).ForEach(a => Render(rs, a, args));
            }
        }