Method

report.updateConfiguration

Change options of a saved report configuration.

Changes options of a saved configuration. Options you give are set; an option given as null goes back to the template's default. The configuration keeps its GUID and name. It finds the configuration among saved ones only, by name or GUID, so a template of the same name does not make it ambiguous.

Examples

Example: with no book.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"report.saveConfiguration","params":{"name":"Net worth","report":"Net Worth Linechart","options":{"General":{"Step Size":"QuarterDelta"}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "…"
}

Request:

{"jsonrpc":"2.0","id":2,"method":"report.updateConfiguration","params":{"configuration":"Net worth","options":{"General":{"Step Size":null}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "name": "Net worth",
    "kind": "saved",
    "…": "…"
  }
}

Command line

red-ale exec --script - <<'EOF'
report.saveConfiguration {"name":"Net worth","report":"Net Worth Linechart","options":{"General":{"Step Size":"QuarterDelta"}}}
report.updateConfiguration {"configuration":"Net worth","options":{"General":{"Step Size":null}}}
EOF

It prints:

[
  "…",
  {
    "name": "Net worth",
    "kind": "saved",
    "…": "…"
  }
]

MCP tool call

Tool call:

{"name":"report.saveConfiguration","arguments":{"name":"Net worth","report":"Net Worth Linechart","options":{"General":{"Step Size":"QuarterDelta"}}}}

Result:

{
  "content": [
    {
      "type": "text",
      "text": "\"…\""
    }
  ]
}

Tool call:

{"name":"report.updateConfiguration","arguments":{"configuration":"Net worth","options":{"General":{"Step Size":null}}}}

Result:

{
  "structuredContent": {
    "name": "Net worth",
    "kind": "saved",
    "…": "…"
  }
}

Effect: write, on the Configuration only.

Params

Params of report.updateConfiguration.

  • configuration (ReportRef, required): The saved configuration, by GUID or name.
  • options (ReportOptions, required): The options to set; null returns one to the template's default.

Result

A report template or saved report configuration, as report.list lists it.

  • guid (Guid, required): The template's GUID (GnuCash's, for a built-in report), or the saved configuration's.
  • name (string, required): The template's name, or the saved configuration's.
  • kind (ReportKind, required): builtin, user or saved.
  • template (Guid or null): For a saved configuration: the GUID of the template it configures.
  • script (string or null): The script defining the template: standard/balance-sheet.rhai, or ./ and a user script's path in the report directory. null for a saved configuration whose template is not loaded.
  • menuPath (array of string, required): GnuCash's menu path. Empty for a saved configuration, which GnuCash lists in its own dialog.
  • menuName (string or null): The menu entry when it differs from the name.
  • menuTip (string or null): The menu tip.
  • inMenu (boolean, required): Whether the template shows in menus; false for a saved configuration.
  • exportTypes (array of string, required): The exports offered besides HTML: ["csv"] for the net and category charts (report.exportCsv), and for a saved configuration of one.
  • readOnly (boolean): true for a built-in saved configuration (v0.6), which cannot be changed, renamed or deleted, only copied with report.saveConfiguration; absent otherwise.