Closed josecalcano closed 1 month ago
Hi, this doesn't seem directly related to this project.
In your project to have ServerReport report = new ServerReport(); report.ReportServerCredentials.NetworkCredentials = new NetworkCredential("login", "password", "DOMAIN"); report.ReportServerUrl = new Uri("http://localhost/ReportServer"); report.ReportPath = "/Invoice"; report.SetParameters(new[] { new ReportParameter("Date", DateTime.Now.Date.ToString()) }); byte[] pdf = report.Render("PDF");
I need add a header to a report to accept html format
I don't really understand what are you trying to do.
When I made your example when debugging the line of report.setparemters throw this exception System.ServiceModel.ProtocolException: 'The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.
I see. That most likely means either your Reporting Services URL is invalid, it doesn't work properly, or there are some problems with authentication. Reporting Services shouldn't respond with text/html
under any normal circumstances.
Hello, good afternoon. I'm trying to make a call to a server report, and I want to add a header that specifies .Headers.Add("Accept", "text/html"), but it doesn't let me.