Hi
sorry for my bad english ...
I have a few days working with version 2011.2 reports, these reports are generated with data I get from a webservice. for this I have a method that returns a DataTable via an IEnumerable generated the report (is rendered on the server side).the code I use to generate the report is as follows: and the error I get is:"Can not Establish Connection with report server" and the error in detail is:
"Infragistics.Controls.Reports.ReportServerException: Cannot establish a connection with the report server. ---> System.ServiceModel.ProtocolException: Content Type application/soap+msbin1 was not supported by service http://localhost:1517/ReportService1.svc. The client and service bindings may be mismatched. ---> System.Net.WebException: The remote server returned an error: (415) Unsupported Media Type. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) --- End of inner exception stack trace ---
Server stack trace: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Infragistics.Controls.Reports.ReportProcessorService.IReportProcessorService.EndGetParametersValues(IAsyncResult result) at Infragistics.Controls.Reports.ReportProcessorService.ReportProcessorServiceClient.OnEndGetParametersValues(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) --- End of inner exception stack trace ---".
the IEnumerable I use to generate the report is as follows :
public IEnumerable<Reporte2> getReporte2() { DataTable ds_resultado = new DataTable(); string Fdesde = "08/02/2012"; string Fhasta = "10/16/2012"; ds_resultado = ws_foxpro.VerBitacora(Fdesde, Fhasta); //VerBitacora(Fdesde, Fhasta); List<Reporte2> rep = new List<Reporte2>(); foreach (DataRow row in ds_resultado.Rows) { rep.Add(new Reporte2() { supervisor = row["SUPER"].ToString(), cod_cajero = row["CAJERO"].ToString(), tipo_mov = row["TIP_MOV"].ToString(), fecha = DateTime.Parse(row["FECHA"].ToString()), nombre = row["desc"].ToString(), hora = row["HORA"].ToString(), mtoefeso = double.Parse(row["MTO_EFE"].ToString()), desde = Fdesde, hasta = Fhasta, numReg = ds_resultado.Rows.Count, fechaact = DateTime.Parse(row["fechaact"].ToString())
});
} return rep; }
Any Idea
;)
Hi Hernán,
There is a problem with the communication between the viewer and the report service. In order to diagnose what is going on can you attach the report viewer code and the web.config where the service is configured?
Can you reproduce this problem outside your main solution? If you can, please attach a complete solution where the problem can be reproduced.
Best,
Leo
Hi Leonardo
as you indicated, attached solution. This includes the application winform and web application that returns the records for the report.as a comment, I can tell you that the report is generated correctly when I do web service withoutthanks
Hi,
The configuration of the Winform viewer included in the “visorReportes” project is pointing to a report (“/ClassLibrary1;component;Report2.igr”) which make reference to a project/assembly not included in the solution.
The only report defined in the solution is within the Winform application. If you want to render that report, you don’t need a report server for that. You can do just client side rendering from the UltraReportViewer.
If that is not the case and you actually need to render reports which are at the server side (they were just not included in the solution), I notice some issues in the web.config that may be the cause of the problem.
Change:
<client>
<endpoint address="http://localhost:1517/ReportService1.svc" binding="customBinding" bindingConfiguration="CustomBinding_IReportProcessorService" contract="rep.IReportProcessorService" name="CustomBinding_IReportProcessorService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
By
<services>
<service name="Infragistics.Reports.Server.ReportProcessorService">
<endpoint address="http://localhost:1517/ReportService1.svc" binding="customBinding" bindingConfiguration="CustomBinding_IReportProcessorService" contract="Infragistics.Reports.Server.IReportProcessorService" name="CustomBinding_IReportProcessorService">
</service>
</services>
After doing this change, adding a report to the WebApplication1 and changing the configuration of the UltraReportViewer to ask the server to render the new report, I can successfully render the report.
Please, let me know if that fixes you problem.
you're absolutely right, I do not need a server report, apparently confused me.I'm doing the rendendering the client side but I get an error and if it's no trouble for you and not abuse your time I would like to ask your help.The error I get is:
The calling thread must be STA, Because many UI components require this.
to view the report, place a ultrareportviewer in a winform and the establishment ultrareportviewer property "definitionuri"with the path of the report.then when I start the winform, get the error.The other method I use, paste the code that was used as a data source in the load event of reportviewer, but I get the same error again.attached the solution.Thank you very much for your help.
the detail of de error is a follows :
Infragistics.Reports.Engine.EngineException: Error in DataSource Reporte4. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The calling thread must be STA, because many UI components require this. at System.Windows.Input.InputManager..ctor() at System.Windows.Input.InputManager.GetCurrentInputManagerImpl() at System.Windows.Input.KeyboardNavigation..ctor() at System.Windows.FrameworkElement.FrameworkServices..ctor() at System.Windows.FrameworkElement.EnsureFrameworkServices() at System.Windows.FrameworkElement..ctor() at System.Windows.Controls.Panel..ctor() at System.Windows.Forms.Integration.AvalonAdapter..ctor(ElementHost hostControl) at System.Windows.Forms.Integration.ElementHost..ctor() at Infragistics.Win.UltraWinReportViewer.UltraReportViewer.InitializeComponent() at Infragistics.Win.UltraWinReportViewer.UltraReportViewer..ctor() at AP_Caja.Form1.InitializeComponent() in C:\Documents and Settings\habravo\Escritorio\Contingencias\Sistema_Caja\Sistema_Caja\Projects\AP_Caja\AP_Caja\Reportes\Form1.Designer.vb:line 27 at AP_Caja.Form1..ctor() in C:\Documents and Settings\habravo\Escritorio\Contingencias\Sistema_Caja\Sistema_Caja\Projects\AP_Caja\AP_Caja\Reportes\Form1.vb:line 3 --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) at System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Infragistics.Reports.Engine.Data.ObjectDataProvider.Execute() at Infragistics.Reports.Engine.Data.ReportDataSourceManager.CreateReportDataSource(DataSource dataSource) at Infragistics.Reports.Engine.Data.ReportDataSourceManager.GetReportDataSource(DataSource reportDataSource) --- End of inner exception stack trace ---Exception Message:Exception has been thrown by the target of an invocation.Inner Exception:The calling thread must be STA, because many UI components require this.Stack Trace: at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) at System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Infragistics.Reports.Engine.Data.ObjectDataProvider.Execute() at Infragistics.Reports.Engine.Data.ReportDataSourceManager.CreateReportDataSource(DataSource dataSource) at Infragistics.Reports.Engine.Data.ReportDataSourceManager.GetReportDataSource(DataSource reportDataSource)