ReportWriter reportWriter = new ReportWriter { ReportProcessingMode = ProcessingMode.Remote, ReportServerCredential = new NetworkCredential() { UserName = "user", Password = "p4ss" }, ReportServerUrl = "https://report.somewhere.de/", ReportPath = "https://report.somewhere.de/en-us/reports/category1/report1" // - ? }; reportWriter.ReportError += this.ReportWriter_ReportError; reportWriter.Save($@"D:\Sample_{DateTime.Now.ToString().Replace(':','_').Replace('.','_').Replace(' ','_')}.pdf", WriterFormat.PDF);
Hi Robin,
|
The
best case solution would be somehow talking to our report server specifying
the report and parameters and export it as pdf. In my
first approach I tried to reach the report server API: Authentication:
/api/token [POST] and specifying user, pass and grantType in url-enconded
format. This worked and I got the bearer token in my response. I
tried to use: api/v2.0/reports/export [POST] including my bearer token inside
the Authorization (Header-field) but was always rejected with 401
Unauthorized |
The
unauthorized error occurred due the missing of “bearer” in authorization
header,Please add ‘bearer’ in Authorization header as like below,
|
|
|
My
second approach is using ReportWriter. But I
got kind of confused by the ReportPath. How can I find out what I have to
specify here? Tried: relative/absolute local paths on client and server, and
as shown in my example the report-link. Nothing worked so far. |
We
have checked the mentioned problem by loading the report from ReportServer
and it's working properly at our end. We suspect the mentioned problem might
be occurred when you have missed to ReportServer extension file at your end.
Please refer to the below UG documentation link for more details, https://help.syncfusion.com/report-platform/report-platform-sdk/reportwriter/aspnet-mvc
We
have prepared a Report Writer sample and it can have downloaded from, Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/ReportWriterMvc1894795404.zip
You
can obtain the ASP.Net Report Writer samples from the below build installed
location, %userprofile%\AppData\Local\Syncfusion\ReportsSDK\Samples\ASP.NET
MVC\ReportServerWriter |
Regards,
Yuvaraj
D.