Ross Bush
Ross Bush

Reputation: 15185

SSRS and Render and Stream info

I am porting a web forms application to mvc. The forms app made heavy use of the ReportViewer control which does not extend well in the mvc world. I have started from scratch. The only properties I can not reliably replicate without a custom renderer is Page Count and Total Page Count. How to get these value using the ReportExecution? I am really hesitant to invest time/resources into a custom renderer. The only thing I can think of and do not like is setting the DeviceInfo.Section and catch the exception when it is not in range. The report is being rendered in HTML40 format.

Upvotes: 0

Views: 301

Answers (1)

user1225352
user1225352

Reputation: 237

Continue to use the ReportViewer control embedded in an .aspx page, and create an MVC route to this page:

routes.MapPageRoute(
          "Reports",
          "Reports/{folder}/{name}",
          "~/Reports/default.aspx",
          false,
          new RouteValueDictionary(
              new { folder = "", name = "", controller = "", action = "" }),

          new RouteValueDictionary(
              new { constraint = new ReportConstraint() })
          );

Upvotes: 1

Related Questions