If you became a customer of the Syncfusion� Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion� Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion�.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion� for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion� for your reporting needs.

How to send report parameters from Blazor page to the api

Hi!

Could you please show me how to send parameter from blazor page to the Bold Report api controller.

I am using Blazor WASM applciat with extenal api for the reporting functions.

Thank you very much for your co operation.


9 Replies 1 reply marked as answer

MR Manoranjan Rajendran Syncfusion Team September 23, 2022 07:38 AM UTC

Hi Tarik Alkathiri,


Thanks for contacting Bold Reports support.


Could you please confirm whether you want to assign the report parameter values from the razor page or whether you want to pass the values to the Report API controller for some other process?


We have attached the sample for assigning the parameter values from the razor pages. We also attached the document for this.


Could you please check sample and share the details.


Regards,

Manoranjan R


Attachment: BlazorWebAssemblyReporting_19f02447.zip


TA Tarik Alkathiri September 23, 2022 10:55 AM UTC

Hi  Manoranjan Rajendran

Thank you very much for your reply and the attachment.

Actually I  want to pass the values to the Report API controller for some other process for doing a query to prepare the data for the report and assign it to the report "DataSource", but I could not figure how to capture the passed data to the  Report API controller like how I send the data from my Blazor page in the ServiceURL for the id in the controller 

[Route("api/{controller}/{action}/{id?}")] after the action in the route.

For example I want to send the TenantId varibale to the controller route id from the razor page in the  ServiceURL

and then read it in the controller the do some process according to the TenantId value.

Your help will be highly appreciated.

Again thank you very much.



MR Manoranjan Rajendran Syncfusion Team September 26, 2022 04:53 AM UTC

Hi Tarik Alkathiri,


Thanks for the update.


Using ajaxBeforeLoad event, we can pass the data from razor page to API controller. Please refer to the below documentation for this.

https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/handle-post-actions/#pass-custom-data-in-ajax-request  


 

We attached the blazor web assembly sample with report viewer controller file. Please check and share the details.



 

Regards,

Manoranjan R


 


Attachment: BlazorWebAssemblyReporting_(2)_71ecca5b.zip


TA Tarik Alkathiri replied to Manoranjan Rajendran September 26, 2022 01:46 PM UTC

Dear Manoranjan Rajendran;

Thank you so much for the reply and the attachment, the attached example worked for me as expected.

 Now -sorry for the inconvenience- I want for example to send the TenantId or CustomerId as in the example, and the jwt token for authorization in the request header from the client and read the header information in the Api to perform Db queries.

Could you please kindly show me an example to achive this.

Again Thank you very much for your co operate.

Best Regards.



MR Manoranjan Rajendran Syncfusion Team September 26, 2022 02:15 PM UTC

Hi Tarik,


Thanks for the update.


If you want to pass multiple details to the API controller, use the earlier provided event with a custom data property and deserialise it in the controller.

https://help.boldreports.com/embedded-reporting/angular-reporting/report-viewer/handle-post-actions/#pass-custom-data-in-ajax-request


Pass the JWT token details in ajaxBeforeLoad's header property. Please refer to the below documentation for this.


https://help.boldreports.com/embedded-reporting/angular-reporting/report-viewer/handle-post-actions/#add-custom-header-in-ajax-request


Regards,

Manoranjan R



TA Tarik Alkathiri replied to Manoranjan Rajendran September 26, 2022 04:33 PM UTC

Thank you very much for your reply.

The  documentation you end are for Angular and I have never worked for Angular  .

Please kindly could you send me an example using Blazor Wasm and web api for c#.

Thank you very much.



MR Manoranjan Rajendran Syncfusion Team September 27, 2022 12:20 AM UTC

Hi Tarik,


Sorry for the inconvenience.


Please refer to the below documentation for JWT authorization. 
https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/handle-post-actions/#add-custom-header-in-ajax-request

.

Let us know if you still need a sample for this.


 Regards,

Manoranjan R


Marked as answer

TA Tarik Alkathiri September 27, 2022 09:41 AM UTC

Hi  Manoranjan R,

With your help I have managed to get the report working perfect with all my requirements like custom data and Authorization token.

Thank you so much for all your help.

Best Regards.



MR Manoranjan Rajendran Syncfusion Team September 28, 2022 09:41 AM UTC

Hi Tarik,


Thanks for the update.


We are glad to hear that the reported issue has been resolved on your end. If you face any other issues, we suggest you open a new ticket in below site using your account.

https://support.boldreports.com/support/tickets/create 


Regards,

Manoranjan R


Loader.
Up arrow icon