Esempio n. 1
0
        private JasperResultAsync GetAsync(string FileUrl, object Param, JasperReportFormat JasperReportFormat, JasperExecutionRequest RequestParam)
        {
            WebClient web = new WebClient();
            web.Credentials = new NetworkCredential(Auth.GetUsuario(), Auth.GetPassword());
            web.Headers.Add("Content-Type", "application/json");

            string Endereco = string.Format("{0}reportExecutions", Config.GetBaseUrl());

            JasperExecutionRequest request = RequestParam;

            if (RequestParam == null)
            {
                request.reportUnitUri = FileUrl;
                request.async = false;
                request.freshData = false;
                request.saveDataSnapshot = false;
                request.outputFormat = JasperReportFormat.ToString();
                request.interactive = false;
            }

            string param = request.ToJson();
            var Response = web.UploadString(Endereco, "POST", param);

            return new JasperResultAsync(Response, web.ResponseHeaders);
        }
Esempio n. 2
0
        private JasperResultAsync GetAsync(string FileUrl, object Param, JasperReportFormat JasperReportFormat)
        {
            JasperExecutionRequest request = new JasperExecutionRequest();

            request.reportUnitUri = FileUrl;
            request.async = true;
            request.freshData = false;
            request.saveDataSnapshot = false;
            request.outputFormat = JasperReportFormat.ToString();
            request.interactive = false;
            request.ignorePagination = true;

            return GetAsync(FileUrl, Param, JasperReportFormat.PDF, request);
        }