How do I call multiple reports?
I can create a single report with the report designer and call it via a menu. I want to create a Reports menu and call any given report at any time.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amira BedhiafiRank #601 · 4K reputationPosted Mar 24, 2025, 11:32 AM EDT
Create
Report1.rdlc,Report2.rdlc, etc.Design them in the Report Designer
Add the menu :
private void reportsToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem report1 = new ToolStripMenuItem("Sales Report"); report1.Click += (s, args) => OpenReport("Report1.rdlc"); ToolStripMenuItem report2 = new ToolStripMenuItem("Inventory Report"); report2.Click += (s, args) => OpenReport("Report2.rdlc"); reportsToolStripMenuItem.DropDownItems.Add(report1); reportsToolStripMenuItem.DropDownItems.Add(report2); }Open the selected report :
private void OpenReport(string reportPath) { ReportForm reportForm = new ReportForm(reportPath); reportForm.Show(); }Create a report viewer form :
public partial class ReportForm : Form { public ReportForm(string reportPath) { InitializeComponent(); this.reportViewer1.LocalReport.ReportPath = reportPath; this.reportViewer1.RefreshReport(); } }Tuhin PaulRank #7 · 71.9K reputationPosted Mar 24, 2025, 1:50 PM EDT
To create a Reports menu that allows you to call any given report dynamically at runtime, you can design a system where the menu acts as a central hub for navigating and launching reports.
The goal is to:
This approach requires:
Tuhin PaulRank #7 · 71.9K reputationPosted Mar 24, 2025, 1:51 PM EDT
Steps to Implement
1. Set Up the Reports
ReportNameorReportPath).2. Create a Reports Menu
3. Integrate the Report Viewer
ReportPath) to the Report Viewer at runtime.4. Fetch and Display the Selected Report
Tuhin PaulRank #7 · 71.9K reputationPosted Mar 24, 2025, 1:52 PM EDT
Below is an example of how to implement this in an ASP.NET Web Application using the SSRS Report Viewer control.
Step 1: Create the Reports Menu
// Fetch list of reports from SSRS server public List GetReportList() { var reportList = new List(); var ssrsUrl = "http:///ReportServer"; var client = new WebClient { Credentials = CredentialCache.DefaultNetworkCredentials }; // Fetch the list of reports (this is a simplified example) var catalogItems = client.DownloadString($"{ssrsUrl}?wsdl"); // Parse the XML response to extract report paths // Example: /Reports/SalesReport, /Reports/InventoryReport return reportList; }Step 2: Display the Reports Menu
Step 3: Render the Selected Report
// Report Viewer Page public ActionResult ReportViewer(string reportPath) { ViewBag.ReportPath = reportPath; return View(); }@{ var reportPath = ViewBag.ReportPath; } /ReportServer" />Tuhin PaulRank #7 · 71.9K reputationPosted Mar 24, 2025, 1:54 PM EDT
Benefits of This Approach
Centralized Management:
Dynamic Loading:
User-Friendly Interface: