Open SSRS server report in Report Builder from the WPF Application

28 Views Asked by At

I have WPF application which list all the server report in WPF application. I am curently trying to open the report in report builder when click on Edit button. I am able to launch the Report Builder Application but it does not open the selected report instead Report Builder app opens with Blank report.

Blank Report

Code :

using (var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\WOW6432Node\Microsoft\Microsoft Report Builder"))
                {
                    string reportBuilderPath;
                    if (key != null)
                    {
                    reportBuilderPath = key.GetValue("Location").ToString();
                    if (!string.IsNullOrEmpty(reportBuilderPath))
                        {
                            reportBuilderPath = string.Format(reportBuilderPath + @"\MSReportBuilder.exe");

                        // Construct the Report Builder URL
                        string reportBuilderUrl = $"{ReportServerUrl}?/ReportBuilder/report/edit/{reportPath}";

                    

                        // Check if Report Builder is installed
                        if (!System.IO.File.Exists(reportBuilderPath))
                        {
                            MessageBox.Show("Report Builder is not installed on this machine.");
                            return;
                        }

                        // Start Report Builder with the report server URL and report path as arguments
                        Process.Start(reportBuilderPath, $"/d:{reportBuilderUrl}");
                        
                      }
                   }
                    
                }

Expected output : To launch the server Report in Report builder when user click on Edit button in WPF App

0

There are 0 best solutions below