Skip to main content

Approach 1: Use Saved Views for Export-Specific Layouts

Saved views let you define column visibility presets that you can activate before exporting. This is the recommended approach for most workflows.

Step 1: Define an Export View

Add a view entry to the views array in your risksheet.json that hides the columns you do not want in the export:
{
  "views": [
    {
      "name": "Export View",
      "columns": {
        "rpn": { "visible": true },
        "rpnNew": { "visible": true },
        "formulaHelper": { "visible": false },
        "internalNotes": { "visible": false }
      }
    }
  ]
}

Step 2: Switch to the Export View Before Exporting

  1. Open the Risksheet document
  2. Select the Export View from the saved views dropdown
  3. Click Export to Excel or Export to PDF
  4. After exporting, switch back to your default working view
Formulas only execute when their column is visible in the sheet. If you set an export view that hides formula columns as the default view, those formulas will not run when the sheet loads, resulting in empty calculated values. Always use the export view temporarily, only during export operations.
If a formula column is hidden in the current view, the formula does not execute. Ensure all columns that serve as formula inputs remain visible in your export view. For example, if rpnNew depends on occNew, detNew, and sevNew, all four columns must be visible for the calculation to produce correct results.

Approach 2: Use hideColumns in PDF Export Scripts

For PDF exports, you can programmatically hide columns using the hideColumns parameter in your custom export script without changing the interactive view.

Step 1: Edit Your PDF Export Script

Open your risksheetPdfExport.vm template and call exportMainSheet with the hideColumns parameter:
// Hide formula helper and internal notes columns in PDF
exporter.exportMainSheet("formulaHelper,internalNotes");
The hideColumns parameter accepts a comma-separated list of column binding names. The specified columns are temporarily hidden during export and automatically restored afterward.

Step 2: Identify Column Binding Names

Find the binding value for each column you want to hide in your risksheet.json:
{
  "columns": [
    { "binding": "title", "header": "Risk Title" },
    { "binding": "formulaHelper", "header": "Helper", "formula": "commonRpn" },
    { "binding": "internalNotes", "header": "Notes" }
  ]
}
Use the binding values (not header or id) in the hideColumns parameter.

Comparison: Saved Views vs. hideColumns

FeatureSaved ViewshideColumns Parameter
Export typeExcel and PDFPDF only
Configurationrisksheet.jsonPDF export script
User action requiredSwitch view before exportNone (automatic)
Formula impactHides column, stops formula executionTemporarily hides during export only
Reusable across exportsYesPer-script basis
diagram

Saving Personal Column Settings

You can also save personal column width and visibility preferences that persist across sessions:
  1. Adjust column widths and visibility as needed
  2. Use the Save Columns command to persist your settings
  3. Your preferences are saved per-user and apply each time you open the document
To restore the original column layout defined in the template, use the Reset Columns command. This removes all personal customizations and refreshes the sheet.
Use saved views for team-wide export layouts defined in risksheet.json, and personal column settings for individual working preferences. The PDF hideColumns parameter handles cases where you need automated column hiding without user intervention.

Verification

After configuring column visibility for exports:
  1. For saved views: switch to your export view, confirm the target columns are hidden, then export
  2. For hideColumns: run the PDF export and open the generated file
You should now see the exported document without the hidden columns, while your interactive Risksheet retains all columns for editing.

See Also

KB ArticlesSupport TicketsSource Code
  • ExportToPdf.ts
  • ToggleReviewCommand.ts
  • ResetColumnsCommand.ts
  • ExportToExcel.ts
  • ColumnsHelper.ts