Let me give you a complete solution addressing all three aspects of your issue:
1. SSRS URL Parameter Syntax for Iframes:
Your iframe src should follow this exact pattern:
http://reports.company.com/ReportServer?/Analytics/SalesReport&rs:Command=Render&StartDate=2024-01-01&EndDate=2024-12-31&Department=Sales
Key points: Use /ReportServer not /Reports (web portal), include rs:Command=Render, use & between parameters, URL-encode special characters.
2. Iframe Embedding Limitations:
SSRS 2014’s iframe restrictions come from the X-Frame-Options: SAMEORIGIN header. To modify this, edit rsreportserver.config and add to the <Service> section:
<Add Key="X-Frame-Options" Value="ALLOW-FROM https://app.company.com" />
Restart the SSRS service after changes. Note: ALLOW-FROM has limited browser support (deprecated in modern browsers).
3. CORS Configuration for Cross-Domain Access:
For modern browsers, you need to remove X-Frame-Options and add Content-Security-Policy instead. In the same config file:
<Add Key="Content-Security-Policy" Value="frame-ancestors 'self' https://app.company.com" />
This provides better browser compatibility and security.
Dynamic Parameter Passing:
In your dashboard JavaScript, update the iframe src dynamically when filters change:
function updateReport(startDate, endDate, dept) {
const baseUrl = 'http://reports.company.com/ReportServer?/Analytics/SalesReport';
const params = `&rs:Command=Render&StartDate=${startDate}&EndDate=${endDate}&Department=${encodeURIComponent(dept)}`;
document.getElementById('reportFrame').src = baseUrl + params;
}
Testing Approach:
- First, verify the URL works directly in a browser (not in iframe)
- Check browser console for specific CORS/frame errors
- After config changes, test with a simple static iframe before adding dynamic parameters
- Use browser dev tools Network tab to confirm the correct URL is being requested
Important Security Considerations:
Only whitelist specific domains you control. Never use frame-ancestors * in production. Consider implementing additional authentication checks in your SSRS reports to verify they’re being accessed from legitimate sources. If your organization has strict security requirements, the server-side proxy approach mentioned earlier is more secure than modifying CORS headers.
The combination of correct URL syntax, proper CORS configuration, and dynamic iframe src updates should resolve your parameter passing issues. Let me know if you hit any specific errors during implementation.