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.

Add User ID and Password in API

I'm using embedded reporting with blazor.  I got things to work though I just put the Password and User Id in the connection string of the .rdl, obviously not the safest practice.  How can I add the User and Password in the API call?  

Thanks


1 Reply

AM Arumugasami Murugesan Syncfusion Team April 12, 2022 07:32 AM UTC

Hi Michael, 
 
Thanks for contacting Bold Report support. 
 
Yes, you can add the connection string programmatically in the API controller in the OnInitReportOptions method. You need to use the below code snippet to pass the data source credentials. 
 
  [NonAction] 
public void OnInitReportOptions(ReportViewerOptions reportOption) 
{ 
        reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials() { Name = "AdventureWorks",    ConnectionString = "Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks;" , UserId = "demoreadonly@data-platform-demo" , Password = "N@c)=Y8s*1&dh"}); 
} 
  
Please refer to the below documentation for your reference. 
 
Regards, 
Arumugasami M 


Loader.
Up arrow icon