## Working with reports via URL

Besides working on interfaces, most of the JReport Web operations such as filter, sort, search, save and so on, can also be accomplished via URL. When using URLs to access JReport Web, you should follow the specifications described in this section.

The URL in DHTML is:

`http://localhost:8888/dhtml?sessionid=XXXXXXX&rptsetid=XXXXXXX&rptname=XXXXXXX&op=...`

- http
  The web service protocol.
- localhost
  The host address.
- 8888
  The port.
- dhtml?sessionid=XXXXXXX&rptsetid=XXXXXXX&rptname=XXXXXXX&
  The path.
- ?
  URL separator.
- =
  URL separator.
- &
  URL separator.
- op
  The key of operation in DHTML.

There are some methods in the file API.js located in `<intall_root>\public_html\javascript\dhtml`. These methods are the tools you can use to generate URLs. The result of each of these functions will be a URL.

Parameter Description | Key | Value
--- | --- | ---
Download Report
Operation code | op | 51
Export report type | ty | 2/3/4/5/6/7 means PDF/PostScript/RTF/TEXT/EXCEL/XML respectively.
Example | `op=51&ty=2`
Note | The order begins with 2. A file of HTML type cannot be downloaded.
Prototype | function user_downloadReport(type)
Exit
Prototype | function user_exit (popwin)
Navigate Page
Operation code | op | 24
Page number | pn | 1...n
Example | `op=24&pn=2`
Note | The page number begins with 1 and is less than total page number.
Prototype | function user_firstPage() function user_lastPage() function user_nextPage() function user_prevPage()
One Step Filter
Operation code | op | 25
the column name | col | Mapping the name of a column in JReport.
operator of filter condition | operator | eq/gt/geq/lt/leq/neq, means "equal to/greater than or equal to/greater than/less than/less than or equal to/unequal to" respectively.
the column value | `value` |
logic of filter condition | logic | AND/OR/END, means "and/or/end" respectively.
instance name of the column | `comp` | component instance name
Example | `op=25&col=CusID&operator=eq&value=1&logic=OR&col=CusName &operator=0&value=ZhangKe&logic=2&comp=convert_sectionObject`
Note | The value is case-sensitive.
Prototype | function user_oneStepfilter(columns, operators, values, logics, instanceName)
One Step Search
Operation code | op | 128
the column name | column | Mapping the name of a column in JReport.
the column value | value | the value to search for
whether or not to search content only | isContent | true/false
whether or not to match case | isMatchCase | true/false
The search direction | isUp | true/false
whether or not to match whole word | isWholeWord | true/false
Example | `op=128&column=CusID&value=1&isContent=true &isMatchCase=false&isUp=false&isWholeWord=false`
Note |
Prototype | function user_oneStepSearch(value, isContent, colName, isUp, matchcase, isWholeWord)
One Step Sort
Operation code | op | 12
the column name | col | Mapping the name of a column in JReport.
the column sort order | ord | true/false
instance name of the column | `comp` | component instance name
Example | `op=12&col=CusID&ord=true&col=CusName &ord=false&comp=convert_sectionObject`
Note | The value is case-sensitive.
Prototype | function user_oneStepSort(columns, sorts, instanceName)
Open Report
JSP page | /dhtmljsp/dhtml.jsp |
Action | jrs.cmd | jrs.try_vw
Report name | jrs.report | path/name
Catalog path | jrs.catalog |
Result type | jrs.result_type | int
Example | `http://localhost:8888/dhtmljsp/dhtml.jsp?jrs.report =%2fSampleReports%2fEmployeeInformation.cls&jrs.cmd =jrs.try_vw&jrs.catalog=%2fSampleReports%2fSampleReports.cat`
Note | The path delimiter is "/". If you encounter problems, you can replace it with "%2f". The version number can be none, as with the example.
Prototype |
Open RSD File
JSP page | /dhtmljsp/dhtml.jsp |
Result path | jrs.path | path/name
Result name | jrs.result | path/name
Result version number | jrs.rst_version | int
Example | `http://localhost:8888/dhtmljsp/dhtml.jsp?jrs.resource_path= /USERFOLDERPATH/admin/test&jrs.file=1980996366.rsd`
Note | The path delimiter is "/". If you encounter problems, you can replace it with "%2f". The version number cannot be none.
Prototype |
Redo
Operation code | op | 85
Example | `op=85`
Note |
Prototype | function user_redo()
Refresh
Operation code | op | 83
Example | `op=83`
Note |
Prototype | function user_refresh()
Reset
Operation code | op | 76
Example | `op=76`
Note |
Prototype | function user_reset()
Save Report
Operation code | op | 82
Example | `op=82`
Note |
Prototype | function user_saveRpt()
Search Next
Operation code | op | 34
Example | `op=34`
Note |
Prototype |
Show Export to Dialog
Prototype | function user_showSaveResultDialog()
Show Help
Dialog id | HELP_OP | 182
Example | `http://localhost:8888/dhtmljsp/help.jsp?sessionid=XXXXXXX &rptsetid=XXXXXXX&rptname=XXXXXXX&HELP_OP=XXX`
Note | The URL gets the body of a window, you should put it as xxx in `window.open("xxx", ..)`
Prototype | function user_showHelp(helpId)
Show Panel or Dialog
Prototype | function user_showUserPanel() function user_showTOC() function user_showDHTMLView() function user_showToolbox() function user_showSortDialog() function user_showFilterDialog() function user_showNewRptDialog() function user_showOpenRptDialog() function user_showSaveAsDialog() function user_showPageSetupDialog() function user_showSaveResultDialog() function user_showPageSetupDialog() function user_showPrintDialog()
Undo
Operation code | op | 84
Example | `op=84`
Note |
Prototype | function user_undo()
Zoom
Operation code | op | 50
Proportion | val | 0~400
Example | `op=50&val=250`
Note | val must be an integer between 0 and 400
Prototype | function user_zoom(value)