The agenda is to publish a certain report on EP along with accepting the filter parameters.
UserControl: This term is often come across when dealing with EP development. A user control is an equivalent of a Form in AX which can render a presentation layer. The difference being that a user control further needs a sharepoint webpart to be hosted within.
To facilitate creation of these user controls, the EP framework has some templates defined and these can be used to create a user control. The templates can be accessed once the project is selected, followed by click on the project menu -> Add new item
The elements on the user control are picked used a group designed for AX on the toolbar. The group is called dynamics AX (shown below, highlighted in red)
The second file is the AFZLeaveDetailsReport.ascx.cs; this file contains the control definitions for the different controls used on the page. This is basically where the code and events for the controls are created. The link between the two files is created using a codefile tag in the source file ("AFZLeaveDetailsReport.ascx") also shown below
The third file is the AFZLeaveDetailsReport.aspx.designer.cs; this file contains the definition for any server controls that are used on the markup file ("AFZLeaveDetailsReport.ascx"). This allows the visual studio to do intellisense in the code behind page based on the controls used on the markup page.
( Note: i wondered why the definitions could not be stored in the markup files itself ; the probable reason is that the markup files being units of html have to follow the html standard/format. But this is just a guess )
Now one can design the layout of the request form. We can use a combination of AX controls and asp controls to create a GUI of our choice. Assuming that this GUI would be used to accept the values for the parameters of the report in focus; once the parameter values have been gathered on the form these will have to be passed on the report object. I have conceived a design where there would be a command button on the form to trigger the report.
Just drag and drop this on the user control to create the required construct. Once the control has been dropped it would create a tag as follows: -
To look for and edit the code behind the Print Report button, double click on it and the editor would automatically open the CodeBehind file ("AFZLeaveDetailsReport") with the right parameters for the button on_click event.
The way to pass parameters is to collect them into an dictionary object with an ID name exactly like the parameter name on the report. ( to get the parameter names in the report, one will have to open the SSRS report in visual studio and copy and names from the parameter node of the report.)
// Add the parameters to the report control
Please note that in EP a report would not render if the DP class for the same is extended from SrsReportDataProviderPreProcess. If you have a pre-process report then please consider changing it to SRSReportDataProviderBase