
If you want to display a report with more than 1 page then its best to go with the Flash Viewer or the Acrobat Reader Viewer. The HTML Viewer uses the JavaScript _doPostback function to switch between pages and MVC does not support this function.
The HTML viewer type of Web Viewer does not support pagination. The steps specified above should be all that you would need to create an MVC application with Active Reports, but there are a few things I would like to discuss before I bring this topic to a close. The handlers need to be specified inside the tag. in the Root Folder of the application and in the Views Folder. The HTTP handlers also need to be configured in the Web.Config file that is located at two places in the MVC application i.e. Public static void RegisterRoutes(RouteCollection routes) #Activereports 7 detail code#
To ensure that the routing engine does not process them and allows them to process as normal we need to specify them as a parameter to the IgnoreRoute method of the RouteCollection class.The following code needs to be added in the RegisterRoutes Method of the Global.asax file.
There are some Http Handlers that are in use by Active Reports when using Acrobat Reader viewer type of the Web Viewer. Protected void WebViewer1_Load(object sender, EventArgs e) All this can be done inside the Web Viewer Load Event which will be enclosed inside Script Tag and this script will executed at the Server. However we still need to get our report instance from the ViewData and set the Report property of the Web Viewer to the report instance. cs code behind file associated with them, and this is in accordance with MVC design principles. MVC view pages are not supposed to have a. Create a View Page for the Action Method that you defined in your controller and add the Active Reports Web Viewer to this View Page.
This objective is in sync with the design principles that MVC design pattern is based on. We are storing the report instance in the View data since our objective is to pass the report instance from the controller to the view. Inside the Action Method populate the View data with the report instance.
Add a controller to your application and then create an Action Method inside the controller. Create an MVC 3 application and add Active Reports to your project. Steps to create an MVC Application using Active Reports Now that we are done with the introduction let’s get going into the details of creating an MVC application with Active Reports. Nevertheless, there is little what Active Reports can’t do and this blog is all about using Active Reports in a MVC application. NET framework classes without the need to worry about view states and Page Life cycles.Īctive Reports was actually not built keeping in mind the MVC Design Pattern and is actually more suited to. NET Routing Engine which makes MVC design pattern simple to understand and gives developers the ability to use. MVC applications may use the old style of HTML views to render the content but at its heart is the. It may seem that we are taking a step backward than forward but there are a lot of things happening behind the scenes in an MVC application than what meets the eye. With the onset of MVC design pattern a lot has changed in world of web applications, we have again gone back to the classic ASP style of doing things.