Elencare i report
GET /reports/ restituisce i report con i loro campi e filtri dinamici.
Restituisce tutti i report con i loro campi, i filtri dinamici e le impostazioni del grafico. Prima attiva l'API.
Richiesta
curl -H "x-token: YOUR_TOKEN" http://localhost:8000/reports/Puoi anche inviare il token come ?token=YOUR_TOKEN.
Risposta
[
{
"id": "JapOn71ca61f",
"name": "Orders by country and period",
"category": "",
"filter": [
{ "id": "xfu9n6e", "type": "=", "value": "{Country}", "name": "Country", "datatype": "string" },
{ "id": "xg41zyw", "type": "between", "value": "{From}; {To}", "name": "Created", "datatype": "date" }
],
"fields": [
{ "id": "xa0wfry", "name": "Customer", "datatype": "string" },
{ "id": "total", "name": "Total", "datatype": "number" }
],
"chart": false
},
{
"id": "JapNSY1c161f",
"name": "Sales by product",
"category": "Sales",
"filter": [],
"fields": [
{ "id": "x1twuy9b", "name": "Product", "datatype": "string" },
{ "id": "total", "type": "sum", "name": "Total", "datatype": "number" }
],
"chart": true,
"x": "x1twuy9b",
"y": "total",
"series": ""
}
]| Chiave | Significato |
|---|---|
id | L'ID del report. Usalo per caricare il report. |
name, category | Come nel modulo del report. |
fields | I campi del report: id, name, datatype (il tipo nella vista) e type (l'operazione, quando c'è). |
filter | Solo i filtri dinamici, i cui valori invii quando carichi il report. |
chart | true se il report ha impostazioni del grafico. Allora x, y e series contengono gli ID dei campi scelti. |
Dopo aver creato o modificato una vista, riavvia OpenReports così questo elenco mostra i campi e i filtri dei report che la usano.