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.

Saving report files to database

Hi

Is it possible to store and use report design files (rdl files) in database instead of file system?

Thanks a lot. 


1 Reply

AM Arumugasami Murugesan Syncfusion Team August 11, 2022 10:39 AM UTC

Hi Seckin Karabacakoglu,


Thanks for the update,


You have to add the external server option with the API to save the report in your application or the database. Please find the sample below, 


Sample:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/BoldReportsCore236484395.zip


In Server side: (ExternalReportServer.cs)

Using the GetReport method you can open your report from your application. 

If you want to open from your server. Please modify the below method as per your requirement. 

public override System.IO.Stream GetReport() 

        { 

            string reportPath = Path.Combine(this.reportResourcePath, this.ReportPath.TrimStart('\\').TrimStart('/')); 

  

            if (!reportPath.Contains(".rdl")) 

            { 

                reportPath = reportPath + ".rdl"

            } 

  

            if (File.Exists(reportPath)) 

            { 

                return this.ReadFiles(reportPath); 

            } 

  

            return null

        } 

 In the provided sample the report will be saved in our application location. If you want to save the report in database means, then you can modify the below method as per your requirement. 

        public override bool CreateReport(string reportName, string folderName, byte[] reportdata, out string exception) 

        { 

            exception = null

            reportName = reportName.TrimStart('\\').TrimStart('/'); 

  

            if (!Path.HasExtension(reportName)) 

            { 

                reportName += ".rdl"

            } 

  

            string reportPath = Path.Combine(this.reportResourcePath, reportName); 

            File.WriteAllBytes(reportPath, reportdata.ToArray()); 

  

            return true

        } 

 


Note: If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.



Regards,

Arumugasami M


Loader.
Up arrow icon