Starting in 2019, the Reporting control is no longer included in Essential Studio®. If you're experiencing issues with the Syncfusion� Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion� and appreciate your understanding.

Export PDF or excel with password protection

Hi Syncfusion folks,

We are planning to use Reportviewer as our SSRS report renderer tool. One of the hard requirements we have from our customer is to provide a feature for them to export the reports with Password protection if they enabled this setting.

Is there any way to achieve this requirement with your current library? Feature or workaround solutions are welcome.

Thank you in advance.

5 Replies

YD Yuvaraj Devarajan Syncfusion Team May 11, 2018 07:21 AM UTC

Hi Osman, 

Thanks for contacting Syncfusion support.  

In Syncfusion ReportViewer, we have an option to set the password for the exported PDF and Excel file in WebAPI controller. So we request you to specify the “UserPassword” for PDF and “PasswordToOpen” for excel in WebAPI controller as shown in below code example, 

        public void OnReportLoaded(ReportViewerOptions reportOption)  
        { 
            if (reportOption.ReportModel.PDFOptions == null || reportOption.ReportModel.ExcelOptions == null) 
            { 
                reportOption.ReportModel.PDFOptions = new Syncfusion.EJ.ReportWriter.PDFOptions(); 
                reportOption.ReportModel.PDFOptions.Security = new Syncfusion.Pdf.Security.PdfSecurity(); 
                reportOption.ReportModel.ExcelOptions = new Syncfusion.EJ.ReportWriter.ExcelOptions();                 
            } 
            reportOption.ReportModel.PDFOptions.Security.UserPassword = "coolcomp@123"; //specify the password to open the Exported PDF           
            reportOption.ReportModel.ExcelOptions.PasswordToOpen = "coolcomp@123"; //specify the password to open the Exported Excel           
        }   
  
We have prepared a ReportViewer sample and it can be downloaded from below location, 

Please refer to the below UG documentation link to prepare a ReportViewer sample, 

You can obtain the complete ReportViewer sample in below build installed location, 
%userprofile%\AppData\Local\Syncfusion\EssentialStudio\version\JavaScript\samples\Web  

Regards, 
Yuvaraj D.


OS Osman May 18, 2018 08:33 PM UTC

Thanks for the answer. I will try out this.


YD Yuvaraj Devarajan Syncfusion Team May 21, 2018 05:47 AM UTC

Hi Osman, 

Thanks for your update. We will wait to hear from you.  

Regards, 
Yuvaraj D. 



OS Osman May 22, 2018 12:29 AM UTC

Hi again,

The suggested solution worked perfectly. Thank you very much.


YD Yuvaraj Devarajan Syncfusion Team May 22, 2018 04:27 AM UTC

Hi Osman, 

Thanks for the update. We are happy to hear that your problem is resolved. 

Regards, 
Yuvaraj D. 


Loader.
Up arrow icon