config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); |
public class DefaultCaseControllerConfigAttribute : Attribute, System.Web.Http.Controllers.IControllerConfiguration
{
public void Initialize(System.Web.Http.Controllers.HttpControllerSettings controllerSettings, System.Web.Http.Controllers.HttpControllerDescriptor controllerDescriptor)
{
var formatter = controllerSettings.Formatters.OfType<System.Net.Http.Formatting.JsonMediaTypeFormatter>().Single();
controllerSettings.Formatters.Remove(formatter);
formatter = new System.Net.Http.Formatting.JsonMediaTypeFormatter
{
SerializerSettings = { ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver() }
};
controllerSettings.Formatters.Add(formatter);
}
}
[DefaultCaseControllerConfigAttribute]
public class RreportApiController : ApiController, IReportController
{
|
Dear Vinoth Srinivasan (Syncfusion).
I have 2 errors need to the your support :
1.
I have created 2 Web APIs according to your instructions,
including: Report Viewer and Repor Designer. Both published APIs go to
localhost, port 88.
http://localhost:88/report/api/Viewer
http://localhost:88/report/api/Designer
After that, I created a simple report, only 1 textbox and
ran the application OK (report displayed).
Continue, I created a more complex new report (Use Syncfusion's Report server.), including 1 Grid with datasources as a Web API (http: // localhost: 88 / CMIS3 / Api / Test / SelectByID / PB0401) to get the data to fill in the columns of the Grid then the Error Report "Unhandled exception has occurred during data set 'DataSet1' processing. ".
I continue to change the new report downloaded from the
report server (Sales Order Detail.rdl), then when I run the application is report another error "Unhandled exception has occurred during 'shared
datasource' retrive." Debug sees the following error:
Query |
Response | ||
I continue to change the new report downloaded from the report server (Sales Order Detail.rdl), then when I run the application is report another error "Unhandled exception has occurred during 'shared datasource' retrive." Debug sees the following error: |
We suspect that you are trying to load the local report which has been downloaded from ReportServer in your application. If the report contains shared datasource or shared dataset the issue will occur. So, we suggest you use intermediate service to render the server report. Please share the platform details in which you have developed your application, we will prepare a sample based on that. | ||
2. Report Designer using Web API (http://localhost:88/report/api/Designer) does not have a datasource "WebAPI" like Syncfusion's Report server and datasource connection string instructions with oracle. |
We don’t have option to show the Web API Datasoure in standalone Report Designer application but we can able to add the Web API Datasource in standalone Report Designer application using the custom data extension. We have prepared the WebReportDesigner sample with local WebAPI datasource and it can be downloaded from below location.
Please find the below standalone WebAPI sample.
WebAPI Extension: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataExtension-2069956675.zip
Please find the below steps to add the WebAPI DataExtension sample in our WebReportDesigner sample.
Step1: Add the WebAPI Extension project reference to our Web ReportDesigner sample as shown in below snap:
Step2: Add the Configuration section in WebConfig file as shown in below code example.
Web.config
Step3: Add ReportDataExtensions in our index.cshtml file as shown in below code example.
Index.cshtml:
Using the above sample, you can pull the data from WebAPI datasource with query parameter to limit the data based on tenant name. Please find the below documentation to connect WebAPI datasource with query parameter,
Let us know if you need any clarification.
|
Query |
Response | ||
Step 1: Create a report with data using the local WebAPI datasource. For example: Example.rdl |
Yes, we can able to use the WebAPI Dataextension in Angular Report Designer application. Please find the below help documentation for how to use the WebAPI datasource extension in Angular Report Designer application.
| ||
Step 2: Allow viewing reports with data source using the local WebAPI datasource in another application (Angular); such as, in component: getting-started.component.ts |
If we are rendering the WebAPI Datasource report in standalone Angular Report Viewer application then we need to add the custom WebAPI datasource Extension in Web API service. You can use the WebAPI extension which you have used in your Report Designer application in the ReportViewer service application. Please refer the below steps to add the extension for Report viewer application.
1. If you are using the Core WebAPI service for Angular Report Viewer application then you can use the below steps to load the report.
Step1: Add the WebAPI Extension project reference to our Core API sample as shown in below snap:
Step2: Add the Configuration section in AppConfig file as shown in below code example.
App.config
2. If you are using the ASP.NET WebAPI service for Angular Report Viewer application then you can use the below steps to load the report.
Step1: Add the WebAPI Extension project reference to our ASP.NET WebAPI service sample as shown in below snap:
Step2: Add the Configuration section in WebConfig file as shown in below code example.
Web.config
|