## Running reports via URL

There are two ways you can use to run reports via URLs: JSP and servlet. Detailed JSP and servlet parameters are introduced in Appendix 6: Parameters for running reports via URL.

All the JSP and servlet methods introduced below are applicable to page reports. For web reports, only the server JSP and Servlet methods are applicable, while only tryView.jsp can be used to run web reports in Web Report Studio and the other methods can only be used to run web reports to other formats other than to Web Report Studio.

### Using JSPs

Two server JSPs:

- tryView.jsp
  This is the normal method of accessing reports using URLs. If the report has parameters and you would like a parameter dialog to display for you to specify the parameter values, follow the topic Specifying parameter values using dialog when running or scheduling reports via URL, otherwise it will directly go to runReport.jsp.

  The tryView.jsp can be used to run page reports and web reports to any allowed formats.

  Examples:

  - Run a page report in Page Report Studio:
    `http://localhost:8888/jinfonet/tryView.jsp?jrs.cmd=jrs.try_vw&jrs.report=%2fSampleReports%2fEmployee Information.cls&jrs.catalog=%2fSampleReports%2fSampleReports.cat&jrs.result_type=8`
  - Run a web report in Web Report Studio:
    `http://localhost:8888/jinfonet/tryView.jsp?jrs.cmd=jrs.try_vw&jrs.report=/SampleReports/Link.wls&jrs.catalog=/SampleReports/SampleReports.cat&jrs.result_type=8`

- runReport.jsp
  The runReport.jsp functions the same as tryView.jsp when the report has no parameters. When it has parameters, the report runs with the default parameters if no parameter values are specified, or else it runs with the parameters specified in the URL.

  The runReport.jsp can be used to run page reports to any allowed formats and run web reports to formats other than in Web Report Studio.

  Examples:

  - Run a page report in Page Report Studio:
    `http://localhost:8888/jinfonet/runReport.jsp?jrs.cmd=jrs.web_vw&jrs.report=%2fSampleReports%2fEmployee Information.cls&jrs.catalog=%2fSampleReports%2fSampleReports.cat&jrs.result_type=8`
  - Run a web report to PDF:
    `http://localhost:8888/jinfonet/runReport.jsp?jrs.cmd=jrs.web_vw&jrs.report=%2fSampleReports%2fProducts.wls&jrs.catalog=%2fSampleReports%2fSampleReports.cat&jrs.result_type=2`

One Page Report Studio JSP:

- dhtml.jsp
  This JSP is for running page reports in Page Report Studio specifically, and you needn't specify the format type compared to the server JSPs. If you want to include the Page Report Studio JSPs into your own application without other server JSPs, you can use this method. However, you must specify the report parameter values in the URL if there are parameters used by the report. For example:

  `http://localhost:8888/dhtmljsp/dhtml.jsp?jrs.catalog=%2fSampleReports%2fSampleReports.cat&jrs.report=%2fSampleReports%2fEmployee Information.cls`

  Tip: When you run a report in Page Report Studio using URL, if you want JReport to automatically refresh the report data at certain intervals, you can set the URL as follows:

  `http://localhost:8888/dhtmljsp/dhtml.jsp?jrs.report=/USERFOLDERPATH/admin/AutoRefresh/autorefresh.cls&jrs.catalog=/USERFOLDERPATH/admin/AutoRefresh/testauto.cat&jrs.auto_refresh_data=true&jrs.auto_refresh_data_time=10`

The image below illustrates the relationship between these JSPs:

### Using servlet

Server servlet

The server servlet can be used to run page reports to any allowed formats and run web reports to formats other than in Web Report Studio.

Call the servlet jrserver. For example, run the page report in Page Report Studio:

`http://localhost:8888/jrserver/SampleReports/SampleReports.cat/Employee Information.cls?jrs.cmd=jrs.web_vw&jrs.result_type=8`

This request will be redirected to /dhtmljsp/dhtml.jsp with the following parameters:

jrs.catalog=/SampleReports/SampleReports.cat

jrs.report=/SampleReports/Employee Information.cls

Run a web report to HTML:

`http://localhost:8888/jrserver/SampleReports/SampleReports.cat/Link.wls?jrs.cmd=jrs.web_vw&jrs.result_type=1`

Page Report Studio servlet

The Page Report Studio servlet jrdhtml is used to run a page report in Page Report Studio specifically, and you needn't to specify the format type compared to the server servlet.

Examples:

- `http://localhost:8888/jrdhtml/SampleReports/SampleReports.cat/Employee Information.cls?`
- `http://localhost:8888/jrdhtml?jrs.catalog=/SampleReports/SampleReports.cat&jrs.report=/SampleReports/Employee Information.cls`

Tip: When running reports to the PDF format via URL, you can encrypt the PDF result by using the encrypting PDF properties.

Below are some more specific examples about running reports via URL:

- Running a report tab in a page report via URL
- Opening web reports in Web Report Studio via JSON
- Sending a large page report result by e-mail upon finishing
- Switching report database connection in URL
- Using the POST method

###### Related topics:

- Running dashboards via URL