public void CreateClient()
		{
			var address = GlobalSettingsHelper.GlobalSettings.RemoteAddress;
			if (string.IsNullOrEmpty(address) || address == "localhost" || address == "127.0.0.1")
				address = ConnectionSettingsManager.GetIPAddress();
			var reportServerAddress = "net.tcp://" + address + ":" + GlobalSettingsHelper.GlobalSettings.ReportRemotePort.ToString() + "/ReportRubezhService/";
			var endpoint = new EndpointAddress(reportServerAddress);
			var binding = BindingHelper.CreateBindingFromAddress(reportServerAddress);
			Factory = new ReportServiceClientFactory(endpoint, binding);
			CreateModel();
		}
Exemple #2
0
        Task <byte[]> ExportReport(ExportOptionsBase exportOptions)
        {
            ReportServiceClientFactory clientFactory = new ReportServiceClientFactory(new EndpointAddress(ReportServiceAddress));

            ReportParameter[] reportParameters = new ReportParameter[] {
                new ReportParameter()
                {
                    Path = "stringParameter", Value = ReportParameter
                }
            };

            return(Task.Factory.ExportReportAsync(clientFactory.Create(), ReportName, exportOptions, reportParameters, null));
        }
Exemple #3
0
		private ReportServicePreviewModel CreateServiceModel()
		{
			var url = "net.pipe://127.0.0.1/ReportFiresecService/";
			var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
			binding.OpenTimeout = TimeSpan.FromMinutes(10);
			binding.SendTimeout = TimeSpan.FromMinutes(10);
			binding.ReceiveTimeout = TimeSpan.FromMinutes(10);
			binding.MaxReceivedMessageSize = Int32.MaxValue;
			binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
			binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
			binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
			binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
			binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
			binding.Security.Mode = NetNamedPipeSecurityMode.None;

			var endpoint = new EndpointAddress(url);
			var factory = new ReportServiceClientFactory(endpoint, binding);
			return new ReportServicePreviewModel()
			{
				ServiceClientFactory = factory,
				IsParametersPanelVisible = false,
				AutoShowParametersPanel = false,
				IsDocumentMapVisible = false,
				ZoomMode = new ZoomFitModeItem(ZoomFitMode.WholePage),
			};
		}
Exemple #4
0
        IReportServiceClient CreateClient()
        {
            ReportServiceClientFactory factory = new ReportServiceClientFactory(new EndpointAddress(ReportServiceUri));

            return(factory.Create());
        }