## Appendix 6: Parameters for running reports via URL

Running reports via URL is supported for calling JReport JSP and Servlets directly from your application or from links in JReport interactive reports. This section introduces the parameters for both ways.

### JSP parameters

jrs.catalog=[catalog name with path]
jrs.report=[report name with path]
jrs.param$name=[value]
jrs.param_page=[true/false] (Default value: false. To show the parameter dialog for specifying parameter values in order to run reports, you need to set this property to true and the URL should call tryView.jsp. For details, see Specifying parameter values using dialog when running or scheduling reports via URL.)
jrs.result_type=[result type]
jrs.jdbc_driver=[JDBC driver name]
jrs.jdbc_url=[JDBC URL]
jrs.db_user=[user name]
jrs.db_pswd=[user password]
jrs.timeout_send_email=[true/false]
jrs.report_timeout=[number] (if timeout > number and jrs.timeout_send_email=true, send the email)
jrs.mailto=[email address]
jrs.mailsubject=[email subject]
jrs.mailcomments=[email content]
jrs.mailfrom=[email address of the sender]
jrs.timeout_sendmail_message=[the message which you customize]
jrs.security_file_name=[the name of a security file] (When a security file is given, the security definitions in the specified catalog will be replaced by that defined in the security file.)

- jrs.result_type
  Description: Specifies which format to run a report to.
  Possible values:

  0 - To Applet
  1 - To HTML
  2 - To PDF
  3 - To TEXT
  4 - To Excel
  5 - To PostScript
  6 - To Rich Text Format
  7 - To XML
  8 - To Page Report Studio (for page reports)
  8 - To Web Report Studio (for web reports)

### Servlet parameters

jrs.cmd=jrs.try_vw (when the report has no parameters)
jrs.cmd=jrs.web_vw (when the report has parameters)
jrs.param$name=[value]
jrs.result_type=[result type]
jrs.jdbc_driver=[JDBC driver name]
jrs.jdbc_url=[JDBC URL]
jrs.db_user=[user name]
jrs.db_pswd=[user password]
jrs.timeout_send_email=[true/false]
jrs.report_timeout=[number] (if timeout > number and jrs.timeout_send_email=true, send the email)
jrs.mailto=[email address]
jrs.mailsubject=[email subject]
jrs.mailcomments=[email content]
jrs.mailfrom=[email address of the sender]
jrs.timeout_sendmail_message=[the message that you can customize]

- jrs.web_vw

  Description: Runs a report and views its result in a web browser and prompts the user if parameters are needed.
  HTTP Method: GET/POST
  URL Format: `http://HOST:PORT/jrserver/REPORT?jrs.cmd=jrs.web_vw&jrs.result_type=RESULT_TYPE&jrs.applet_type=APPLET_TYPE[_isMultiple_jrs.param$NAME=true&jrs.param$NAME=VALUE&jrs.param$NAME=VALUE...][&jrs.isjrsapltpg=TRUE/FALSE][&jrs.is_multi_files=TRUE/FALSE][&jrs.is_applet_chart=TRUE/FALSE][&jrs.has_hyperlink=TRUE/FALSE][&jrs.has_page_number=TRUE/FALSE][&jrs.use_table=TRUE/FALSE][&jrs.drilldown=TRUE/FALSE][&jrs.relative_font_size=TRUE/FALSE][&jrs.no_margin_html=TRUE/FALSE][&jrs.web_browser=BROWSER_TYPE][&jrs.no_margin_pdf=TRUE/FALSE][&jrs.is_norm_txt=TRUE/FALSE][&jrs.delimiter=DELIMITER][&jrs.udchar_width=NUMBER][&jrs.udchar_height=NUMBER][&jrs.no_margin_ps=TRUE/FALSE][&jrs.no_margin_rtf=TRUE/FALSE][&jrs.use_def_db_user=TRUE/FALSE][&jrs.db_user=DB_USER][&jrs.db_pswd=DB_PASSWORD][&jrs.jdbc_url=JDBC_URL][&jrs.jdbc_driver=JDBC_DRIVER][&jrs.rpt_language=RPT_LANGUAGE][&jrs.rpt_encoding=RPT_ENCODING][&jrs.wp=DBField='value'][&jrs.named_wp=ExistedWhereportion][&jrs.report_sheet$RPT_TAB_NAME=true]`

  URL Example: `http://localhost:8888/jrserver/SampleReports/SampleReports.cat/InvoiceReport.cls?jrs.cmd=jrs.web_vw&jrs.result_type=1&jrs.param$Country=Australia&jrs.param$State=New South Wales&jrs.param$City=Sydney&jrs.is_multi_files=true&jrs.is_applet_chart=true&jrs.use_def_db_user=false&jrs.db_user=dba&jrs.db_pswd=123456&jrs.rpt_language=en`

  Tips:

  - APPLET_TYPE:
    2 - Java Plug-In 1.2 for Windows
    3 - Java Plug-In 1.3 for Windows
  - BROWSER_TYPE:
    0 - IE or Chrome
    1 - Firefox
  - If you want to define a new WHERE portion from the URL, you can choose the property jrs.wp. For example, the report has a DBField Customer Region, and you want to restrict the field Customer Region to CA in the URL. You can then set a new WHERE portion such as, `"...jrs.result_type=1&jrs.is_applet_chart=true&jrs.wp=Customers.Region='CA'...".`
  - If you want to set an existing WHERE portion in the URL, you should use the property jrs.named_wp. For example, to set the existed WHERE portion Region from URL, use `"...jrs.result_type=1&jrs.is_applet_chart=true&jrs.named_wp=Region..."`. Here Region is the WHERE portion's name.
- jrs.try_vw

  Description: Runs a report and views its result in a web browser when the report does not need parameters.
  HTTP Method: GET/POST
  URL Format: `http://HOST:PORT/jrserver/REPORT?jrs.cmd=jrs.try_vw&jrs.result_type=RESULT_TYPE&jrs.applet_type=APPLET_TYPE[&jrs.isjrsapltpg=TRUE/FALSE][&jrs.is_multi_files=TRUE/FALSE][&jrs.is_applet_chart=TRUE/FALSE][&jrs.has_hyperlink=TRUE/FALSE][&jrs.has_page_number=TRUE/FALSE][&jrs.use_table=TRUE/FALSE][&jrs.drilldown=TRUE/FALSE][&jrs.relative_font_size=TRUE/FALSE][&jrs.no_margin_html=TRUE/FALSE][&jrs.web_browser=BROWSER_TYPE][&jrs.no_margin_pdf=TRUE/FALSE][&jrs.is_norm_txt=TRUE/FALSE][&jrs.delimiter=DELIMITER][&jrs.udchar_width=NUMBER][&jrs.udchar_height=NUMBER][&jrs.no_margin_ps=TRUE/FALSE][&jrs.no_margin_rtf=TRUE/FALSE][&jrs.use_def_db_user=TRUE/FALSE][&jrs.db_user=DB_USER][&jrs.db_pswd=DB_PASSWORD][&jrs.jdbc_url=JDBC_URL][&jrs.jdbc_driver=JDBC_DRIVER][&jrs.rpt_language=RPT_LANGUAGE][&jrs.rpt_encoding=RPT_ENCODING][&jrs.wp=DBField='value'][&jrs.named_wp=ExistedWhereportion][&jrs.report_sheet$RPT_TAB_NAME=true]`

  URL Example: `http://localhost:8888/jrserver/SampleReports/SampleReports.cat/Employee Information.cls?jrs.cmd=jrs.try_vw&jrs.result_type=1`

  Tips:

  - APPLET_TYPE:
    2 - Java Plug-In 1.2 for Windows
    3 - Java Plug-In 1.3 for Windows
  - BROWSER_TYPE:
    0 - IE or Chrome
    1 - Firefox