Programmatically run SSRS report/export in C# UI Model
Hi. Is there a way to run an SSRS report through the C# code in a UI Model project? I was tinkering around and it looks like Microsoft has classes for running reports (Microsoft.Reporting.WebForms) but there are parameters/credentials required to utilize methods from those classes. Is there a way to pull these credentials (username/password/server name/etc.) from within a UI Model?
Comments
-
Yes, you are able to access the SSRS reports using the AppFxWebService. There is a method called ReportsExport that you can use, you just need to supply the Spec ID for the report, a DataFormItem with the parameters, and the export type. This is a snippet where I have used this:
Dim svc = New AppFxWebService(GetRequestContext())
Dim dfi = New DataFormItem
dfi.SetValue("ID", id) 'Add a value for each parameter needed, this report only needed an ID
Dim req = New ReportsExportRequest With {.ReportId = New Guid("92cc51db-4a6e-4e49-968b-1bb656d12a92"), .ParameterValues = dfi, .ExportType = ExportType.pdf}
Dim resp = svc.ReportsExport(req) 'This response object has a few properties, one being the bytes of the fileLet me know if you have any questions!
0 -
@Nick McGinnis
Thank you for the response. I had been trying something similar to the VB code you have in C#. It's possible that my parameters are not set right. I'll have to find a much simpler SSRS report that has 1 or no parameters to test. I may not have time now to try this, but I'll try to re-post something later.0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 648 Blackbaud Grantmaking™
- 567 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 937 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.5K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 247 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 239 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 31 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 782 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
