Reporting Services: eWeb Report
Report execution from eWeb
As part of a client requirement to allow printing of invoices in PDF format from eWeb, a framework/infrasture has been created so that other reports could also be set up to run from eWeb.
Following is a list of important notes for netFORUM eWeb reporting.
- This is an add-on feature for netFORUM 2.1 and netFORUM 2.2.
- Due to Reporting Services 2008 conversion, this feature was not available for netFORUM 3.0 until the 4th Service Pack - 2009.01.04.
- Client is responsible to configure which reports to expose to their eWeb site. Avectra can provide assistance on a T&M basis.
How to set up reports to run from eWeb
The intent was to create a generic way of executing MS Reporting Services reports in eWeb, then displaying the report in PDF format. Besides that, all that is required to generate a report and redirect to the PDF is a properly formed Hyper Link and a properly setup MS Report. As part of moving this functionality to baseline, the format of the report will be determined by the Report Format field on the Report Setup, so the output can be any Reporting Services supported format.
The scope of this document is to explain how to create the hyper link and explain the behavior depending on what values are provided in the hyper link. This document does not go much into details about all the meta-data that needs to be created for report execution in netForum since that standard for any report in NetForum, but explains specific issues in set up of reports for eWeb execution.
Hyperlink on eWeb
A properly formed hyper link always points to the page “ReportStart.aspx” which is located in the Reports folder. In its simplest form, the hyper link will look like this:
Reports/ReportStart.aspx?ReportKey=A285D12E-89C0-42A3-8CFE-11D36DE2B56C&Key=743D53F9-5910-4154-B3D7-25758181FFDE
There are two required parameters:
1. ReportKey : The GUID of the report you want to execute. This can be found in iWEB by navigating to the report setup and looking at the end of the URL.
2. Key: see explanation below
Key parameter is used to set the CurrentKey of the report object, which is a façade object. When the report object is placed in session by ReportStart.aspx, SelectByKey() and LoadRelatedDate() methods are executed for the report object to populate all related values.
This allows for parsing of default report parameters. You will typically retrieve this key value in the List SQL of an eweb page. In the report above, the report object is “invoice”, so you would select inv_key in the List SQL and set “Key” portion of the hyper link to this value.
Note: ReportKey and Key must always be set in the hyper link or the report will not execute.
Optional Report parameters in the HyperLink
It is possible to pass any report parameter in the hyperlink. The report above has many parameters displayed in the screenshot below. Any one of these parameters can be set in the hyperlink by including ¶metername=value. Do not include the @ for the parameter name.
For example: @bat_key is one of the report parameters, to set the @bat_key report parameter you would create a hyperlink that looks similar to this:
ReportStart.aspx?ReportKey=A285D…&Key=743D5…&bat_key=AF39E…
Default values for parameters
If a report has some parameters that need values set by user when run from iWeb, but those values should not be passed by eWeb user, the default values should be set in the setup. For example, for the Invoice Report, Return Address (Payment Address) to be printed on the invoice is chosen by the user in iWeb. But, on eWeb, the customer should not be choosing the message, so the report setup should have the value (see cli_key value in the screen shot above). Another example is the message on the Invoice and its value should also be set in the Report Setup (see Invoice Message in the screen shot above)
One time setup needed on the IIS Server
Note: This configuration is no longer needed with netFORUM 3.0 Service Pack 4 as the functionality is now included with baseline
The following DLLs are needed to be deployed to eWeb\bin folder.
- 1. AVImplementationUtils.dll
- 2. AVReportingServices.dll
Following aspx files need to be deployed in appropriate folders shown:
- 1. eweb\Reports\ReportStart.aspx
- 2. eweb\Reports\ReportParameters.aspx
- 3. eweb\Reports\RSReports\ReportOutputRS.aspx
Note: The above aspx files are different from those used in iWeb.
Virtual Folder “Temp” needed in eWEB root directory.
In IIS, create a new virtual folder “Temp” in the eWEB root directory e.g. netforumaafp\eweb\Temp
Set the local path: <netForumRoot>\TempFiles\iweb\Temp In the example below, the path is d:\sites\netforumaafp\TempFiles\iWeb\Temp. The folder should allow read/write and allow anonymous access. Do not allow directory browsing, as other individual’s reports would be accessible.
What reports to make available on eWeb and security
The decision to make a certain reports available on eWeb should be done carefully, since the report execution could affect the performance for iWeb users and other eWeb customers. Also, the link through which a report is made available should be secured so that only authorized users can access that link and report.
Examples
Open report in a new browser window:
<p>
<a href="Reports/ReportStart.aspx?ReportKey=3ce07823-eeb7-4268-9d20-a0119e0d99aa&Key={evt_key}&evt_key={evt_key}" target="_blank">
Print Confirmation Letter
</a>
</p>
Open report in a pop-up window using a link:
<p>
<A onclick="OpenNewWindow('Reports/ReportStart.aspx?ReportKey=6c153f4c-7403-49e3-a0b8-8da40953e9f7&Key={ebt_key}');return false;" href="javascript:void();">
Event Registrant List
</A>
Open report in a pop-up window using a button:
<INPUT class="DataFormButton" onclick="window.open('Reports/ReportStart.aspx?ReportKey=3995EC4C-B8DD-44B5-BF87-157BAE159E41&key={crt_key}&crt_key={crt_key}', ('speedWin_{cpg_code}'), 'resizable=yes,scrollbars=yes,width=600,height=400');" name="{cpg_name}" value="{cpg_name}" type="button" />