コード例 #1
0
        protected void btnManuStock_Click(object sender, EventArgs e)
        {
            UriReportSource rs = new UriReportSource();

            rs.Uri = "Reports\\getManufacturer_STOCK.trdx";
            ReportViewer1.ReportSource = rs;
        }
コード例 #2
0
        protected void btnScanned_Click(object sender, EventArgs e)
        {
            UriReportSource rs = new UriReportSource();

            rs.Uri = "Reports\\getScanned.trdx";
            ReportViewer1.ReportSource = rs;
        }
コード例 #3
0
        protected void btnStents_Click(object sender, EventArgs e)
        {
            UriReportSource rs = new UriReportSource();

            rs.Uri = "Reports\\getStents.trdx";

            //rs.Parameters.Add(new Telerik.Reporting.Parameter("StartTime", rdpStartDate.SelectedDate.Value.ToShortDateString()));
            //rs.Parameters.Add(new Telerik.Reporting.Parameter("EndTime", rdpEndDate.SelectedDate.Value.ToShortDateString()));

            //Telerik.Reporting.Parameter paramStartDate = new Telerik.Reporting.Parameter();
            //paramStartDate.Name = "StartTime";
            ////paramStartDate.Value = rdpStartDate.SelectedDate.Value;
            //rs.Parameters.Add(paramStartDate);

            //Telerik.Reporting.Parameter paramEndDate = new Telerik.Reporting.Parameter();
            //paramEndDate.Name = "EndTime";
            ////paramEndDate.Value = rdpEndDate.SelectedDate.Value;
            //rs.Parameters.Add(paramEndDate);

            //rs.Parameters["StartTime"].Value = rdpStartDate.SelectedDate.Value;
            //rs.Parameters["EndTime"].Value = rdpEndDate.SelectedDate.Value;

            int count = rs.Parameters.Count;

            ReportViewer1.ReportSource = rs;
        }
コード例 #4
0
        private void ReportView_Load(object sender, System.EventArgs e)
        {
            var reportSource = new UriReportSource();

            reportSource.Uri = "Reports/ListOfStudentsReport.trdp";
            this.reportViewer1.ReportSource = reportSource;
            this.reportViewer1.RefreshReport();
        }
コード例 #5
0
        public RapportWindows(string Rapport)
        {
            InitializeComponent();

            var uriReportSource = new UriReportSource();

            uriReportSource.Uri = Rapport;

            reportViewer.ReportSource = uriReportSource;
            reportViewer.RefreshReport();
        }
コード例 #6
0
        public RapportWindows(string Rapport, object param)
        {
            InitializeComponent();

            var uriReportSource = new UriReportSource();

            uriReportSource.Uri = Rapport;
            uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("ID", param));

            reportViewer.ReportSource = uriReportSource;
            reportViewer.RefreshReport();
        }
コード例 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["ReportName"] != null)
     {
         if (Request.QueryString["ReportName"] == "Scanned")
         {
             UriReportSource rs = new UriReportSource();
             rs.Uri = "Reports\\getScanned.trdx";
             ReportViewer1.ReportSource = rs;
         }
     }
 }
コード例 #8
0
        Report DeserializeReport(UriReportSource uriReportSource)
        {
            var settings = new System.Xml.XmlReaderSettings();

            settings.IgnoreWhitespace = true;
            using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))
            {
                var xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
                var report        = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
                return(report);
            }
        }
コード例 #9
0
        public ActionResult DisplayReportViewer(string selectedReport)
        {
            var ReportType = new UriReportSource();
            ReportType.Uri = selectedReport;

            ReportModel reportModel = new ReportModel()
            {
                SelectedReportType = ReportType
            };

            return View("ReportViewerView", reportModel);
        }
コード例 #10
0
        public async Task <ActionResult> DownloadReport(string targetUrl, string CCode, string UCode, string ReportParameter)
        {
            //	ITokenContainer tokenContainer = new TokenContainer();
            string token = Request.Cookies["MAQTA-LOCAL-TOKEN"].Value;

            if (token == null)
            {
                return(Json(new
                {
                    redirectUrl = Url.Action("LogOff", "Account"),
                    isRedirect = true
                }, JsonRequestBehavior.AllowGet));
            }
            ApiHelper.Client.ApiClient client = new ApiHelper.Client.ApiClient(HttpClientInstance.Instance, token);
            GenericClient cb       = new GenericClient(client);
            var           response = await cb.Get(targetUrl);

            JavaScriptSerializer j = new JavaScriptSerializer();

            ADP.MG.Pcs.Models.EntityModels.Report reportModel = default(ADP.MG.Pcs.Models.EntityModels.Report);
            if (!string.IsNullOrEmpty((response.ResponseResult)))
            {
                reportModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ADP.MG.Pcs.Models.EntityModels.Report>(response.ResponseResult);
            }
            //var typeReportSource = new UriReportSource { Uri = string.Format("Reports/{0}", reportModel.ReportFileName) };
            var typeReportSource = new UriReportSource {
                Uri = string.Format("Report/{0}", "CustomReport.trdx")
            };

            string[] parameters;
            parameters = ReportParameter.ToString().Split(';');
            typeReportSource.Parameters.Add("centerCode", parameters[0]);
            typeReportSource.Parameters.Add("jobNumber", parameters[1]);
            typeReportSource.Parameters.Add("searchString", parameters[2]);
            typeReportSource.Parameters.Add("pageNumber", parameters[3]);
            typeReportSource.Parameters.Add("pageSize", parameters[4]);
            typeReportSource.Parameters.Add("CCode", CCode);
            typeReportSource.Parameters.Add("UCode", UCode);
            typeReportSource.Parameters.Add("token", token);


            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            //Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport(reportModel.DownloadType.ToUpper(), typeReportSource, null);
            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("XLS", typeReportSource, null);
            byte[] contents = result.DocumentBytes;
            //string mimeType = reportModel.DownloadType == "xls" ? "vnd.ms-excel" : "vnd.ms-excel";//reportModel.DownloadType;
            string mimeType = "vnd.ms-excel";            //reportModel.DownloadType;

            //return File(contents, string.Format("application/{0}", mimeType), reportModel.DownloadFileName);
            return(File(contents, string.Format("application/{0}", mimeType), "Chassis Details.xls"));
        }
コード例 #11
0
        private void SetReport(DP_SearchRepository searchRepository)
        {
            SearchRepository = searchRepository;

            //بالاخره درست شد. بعد از مدتها که اومدم سراغ گزارشات خطا میداد
            // پروژه رست سرویس از اول ایجاد شد. از تمپلیت خود تلریک استفاده شد تو اد نیو پروژکت .فقط ریزولور رو اصلاح کردم و تو وب کانفیک کانکشن استرینگ رو ست کردم
            //برای ویوئر هم مجددا با رایت کلیک و اد کردن یک ریپورت ویوئر wpf
            //خودش یسری dll اشافه میکنه و همچنین app.config رو دستکاری میکنه
            //یه مشکل با ورژن Newtonsoft.Json بود که با اصلاح خط زیر حل شد
            //        < dependentAssembly >
            //          < assemblyIdentity name = "Newtonsoft.Json" publicKeyToken = "30ad4fe6b2a6aeed" culture = "neutral" />
            //          < bindingRedirect oldVersion = "0.0.0.0-9.0.0.0" newVersion = "9.0.0.0" />
            //      </ dependentAssembly >

            //به نظرم ریپورت اریا اینترنال و اکسترنال رو جدا کنم
            if (searchRepository != null)
            {
                var request = new RR_ReportSourceRequest(AgentUICoreMediator.GetAgentUICoreMediator.GetRequester());
                request.ReportID        = AreaInitializer.ReportID;
                request.SearchDataItems = searchRepository;
                if (View.OrderColumnsVisibility)
                {
                    request.OrderByEntityViewColumnID = View.GetOrderColumnID;
                    if (View.GetSortText == "Ascending")
                    {
                        request.SortType = Enum_OrderBy.Ascending;
                    }
                    else if (View.GetSortText == "Descending")
                    {
                        request.SortType = Enum_OrderBy.Descending;
                    }
                }
                var         reportEngineConnection = "engine=RestService;uri=http://localhost/MyReportRestServices/api/reports;useDefaultCredentials=True";
                List <Type> types = new List <Type>();
                types.Add(typeof(DP_SearchRepository));
                //types.Add(typeof(LogicPhrase));
                types.Add(typeof(SearchProperty));
                RemoveUnWantedTypes(request.SearchDataItems);
                var uri = SerializeObject <RR_ReportSourceRequest>(request, types);
                //   uri = "MyReportRestServices.Report1, MyReportRestServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                var rpSource = new UriReportSource()
                {
                    Uri = uri
                };
                //rpSource.Parameters.Add(new Parameter() { Name = "bb", Value = request });
                View.SetReportSource(null, null);
                View.SetReportSource(reportEngineConnection, rpSource);
            }
            //var rpSource = reportResolver.GetReportSource(request);
            //View.SetReportSource(rpSource);
        }
コード例 #12
0
 private void ListBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         //reportViewer = new Telerik.ReportViewer.Wpf.ReportViewer();
         var uriReportSource = new UriReportSource();
         uriReportSource.Uri       = (lstRapport.SelectedItem as Fichiers).FullName;
         reportViewer.ReportSource = uriReportSource;
         reportViewer.RefreshReport();
     }
     catch (Exception)
     {
     }
 }
コード例 #13
0
        public ActionResult Report(int status = -1)
        {
            //ViewBag.status = status;
            //return View("MembersReport");
            ReportProcessor reportProcessor = new ReportProcessor();
            Hashtable       deviceInfo      = new Hashtable();
            UriReportSource rs = new UriReportSource();

            rs.Parameters.Add("status", status);
            rs.Uri = "Reports/MembersReport.trdp";
            var res          = reportProcessor.RenderReport("xlsx", rs, deviceInfo);
            var documentName = "MembersReport.xlsx";

            return(File(res.DocumentBytes, res.MimeType, documentName));
        }
コード例 #14
0
        protected void btnStentsCost_Click(object sender, EventArgs e)
        {
            UriReportSource rs = new UriReportSource();

            rs.Uri = "Reports\\getStentsCost.trdx";

            //string startDate = rdpStartDate.SelectedDate.Value.Date.ToShortDateString().Replace('/', '-');
            //string endDate = rdpEndDate.SelectedDate.Value.Date.ToShortDateString().Replace('/', '-');
            //DateTime start = rdpStartDate.SelectedDate.Value.Date;
            //DateTime end = rdpEndDate.SelectedDate.Value.Date;
            //rs.Parameters.Add(new Telerik.Reporting.Parameter("@StartTime", start));
            //rs.Parameters.Add(new Telerik.Reporting.Parameter("@EndTime", end));
            //rs.Parameters["StartTime"].Value = rdpStartDate.SelectedDate.Value.Date;
            //rs.Parameters["EndTime"].Value = rdpEndDate.SelectedDate.Value.Date;

            ReportViewer1.ReportSource = rs;
        }
コード例 #15
0
        public async Task <ActionResult> DownloadApprovalReport(string targetUrl, string CCode, string UCode, string ReportParameter)
        {
            //ITokenContainer tokenContainer = new TokenContainer();
            string token = Request.Cookies["MAQTA-LOCAL-TOKEN"].Value;//Used this as Per Mudassar on 4-July-2019

            if (token == null)
            {
                return(Json(new
                {
                    redirectUrl = Url.Action("LogOff", "Account"),
                    isRedirect = true
                }, JsonRequestBehavior.AllowGet));
            }

            ApiHelper.Client.ApiClient client = new ApiHelper.Client.ApiClient(HttpClientInstance.Instance, token);
            GenericClient cb       = new GenericClient(client);
            var           response = await cb.Get(targetUrl);

            JavaScriptSerializer j = new JavaScriptSerializer();

            ADP.MG.Pcs.Models.EntityModels.Report reportModel = default(ADP.MG.Pcs.Models.EntityModels.Report);
            if (!string.IsNullOrEmpty((response.ResponseResult)))
            {
                reportModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ADP.MG.Pcs.Models.EntityModels.Report>(response.ResponseResult);
            }

            var typeReportSource = new UriReportSource {
                Uri = string.Format("Report/{0}", "Approval.trdx")
            };

            string[] parameters;
            parameters = ReportParameter.ToString().Split(';');
            typeReportSource.Parameters.Add("centerCode", parameters[0]);
            typeReportSource.Parameters.Add("jobNumber", parameters[1]);
            typeReportSource.Parameters.Add("CCode", CCode);
            typeReportSource.Parameters.Add("UCode", UCode);
            typeReportSource.Parameters.Add("token", token);
            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            Telerik.Reporting.Processing.RenderingResult result          = reportProcessor.RenderReport("PDF", typeReportSource, null);
            byte[] contents = result.DocumentBytes;
            string mimeType = "PDF";

            return(File(contents, string.Format("application/{0}", mimeType), "Approval.pdf"));
        }
コード例 #16
0
        private BaseResult Process(BaseRequest request)
        {
            //DR_ResultRequest result = new DR_ResultRequest();

            if (request is DR_EditRequest)
            {
                return(requestRegistration.SendEditRequest(request as DR_EditRequest));
            }
            else if (request is DR_DeleteInquiryRequest)
            {
                return(requestRegistration.SendDeleteInquiryRequest(request as DR_DeleteInquiryRequest));
            }
            else if (request is DR_DeleteRequest)
            {
                return(requestRegistration.SendDeleteRequest(request as DR_DeleteRequest));
            }
            //else if (request is DR_SearchViewRequest)
            //{
            //    return ;
            //}
            else if (request is DR_SearchExistsRequest)
            {
                return(requestRegistration.SendSearchExistsRequest(request as DR_SearchExistsRequest));
            }
            else if (request is DR_SearchCountRequest)
            {
                return(requestRegistration.SendSearchCountRequest(request as DR_SearchCountRequest));
            }
            else if (request is DR_SearchEditRequest)
            {
                return(requestRegistration.SendSearchEditRequest(request as DR_SearchEditRequest));
            }
            else if (request is DR_SearchFullDataRequest)
            {
                return(requestRegistration.SendSearchFullDataRequest(request as DR_SearchFullDataRequest));
            }
            else if (request is DR_SearchKeysOnlyRequest)
            {
                return(requestRegistration.SendSearchKeysOnlyRequest(request as DR_SearchKeysOnlyRequest));
            }
            //else if (request is DR_SearchByRelationshipTailRequest)
            //{
            //    return requestRegistration.SendSearchByRelationshipTail(request as DR_SearchByRelationshipTailRequest);
            //}
            else if (request is RR_ReportSourceRequest)
            {
                UriReportSource rpSource = new UriReportSource();
                rpSource.Uri = "http://localhost:25667/api/myreport";
                return(new RR_ReportSourceResult()
                {
                    ReportSource = rpSource
                });
                //rpSource.
                //return requestRegistration.SendReportSourceRequest(request as RR_ReportSourceRequest);
            }
            //else if (request is DR_SearchByRelationViewRequest)
            //{
            //    SearchRequestProcessor editProcessor = new SearchRequestProcessor();
            //    return editProcessor.Process(request as DR_SearchByRelationViewRequest);
            //}
            throw (new Exception("چنین درخواستی قابل رسیدگی نمیباشد"));
        }