> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Control Column Visibility in Exports

> Hide specific columns from PDF or Excel exports while keeping them visible during interactive editing, using saved views and the `hideColumns` parameter.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## 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 sheet configuration that hides the columns you do not want in the export:

```yaml theme={null}
views:
- name: Export View
  columnIds:
    - "@all"
    - "-formulaHelper"
    - "-internalNotes"
```

### Step 2: Switch to the Export View Before Exporting

1. Open the Nextedy 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

<Warning title="Do Not Set the Export View as Default">
  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.
</Warning>

<Tip title="Formulas Depend on Column Visibility">
  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.
</Tip>

## 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:

```javascript theme={null}
// 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 `bindings` value for each column you want to hide in your sheet configuration:

```yaml theme={null}
columns:
- bindings: title
  header: Risk Title
- bindings: formulaHelper
  header: Helper
  formula: commonRpn
- bindings: internalNotes
  header: Notes
```

Use the `bindings` values (not `header` or `id`) in the `hideColumns` parameter.

## Comparison: Saved Views vs. hideColumns

| Feature                 | Saved Views                           | hideColumns Parameter                |
| ----------------------- | ------------------------------------- | ------------------------------------ |
| Export type             | Excel and PDF                         | PDF only                             |
| Configuration           | sheet configuration                   | PDF export script                    |
| User action required    | Switch view before export             | None (automatic)                     |
| Formula impact          | Hides column, stops formula execution | Temporarily hides during export only |
| Reusable across exports | Yes                                   | Per-script basis                     |

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/yWl5nA2D0IzEnZC1/risksheet/diagrams/guides/export/column-visibility-export/diagram-1.svg?fit=max&auto=format&n=yWl5nA2D0IzEnZC1&q=85&s=5f529fe34ffcf19d7149b25468fd945d" alt="diagram" style={{ maxWidth: "520px", width: "100%" }} width="520" height="320" data-path="risksheet/diagrams/guides/export/column-visibility-export/diagram-1.svg" />
</Frame>

## 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.

<Tip title="Combine Approaches for Complex Workflows">
  Use saved views for team-wide export layouts defined in sheet configuration, and personal column settings for individual working preferences. The PDF `hideColumns` parameter handles cases where you need automated column hiding without user intervention.
</Tip>

## 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

* [Control Column Visibility](/risksheet/guides/columns/column-visibility) -- Interactive column visibility settings
* [Export to PDF](/risksheet/guides/export/pdf-export) -- Base PDF export workflow
* [Export to Excel](/risksheet/guides/export/excel-export) -- Excel export reference
* [Customize PDF Export Scripts](/risksheet/guides/export/pdf-custom-scripts) -- Full PDF script customization
* [Create Saved Views](/risksheet/guides/customization/saved-views) -- Saved view configuration

<LastReviewed date="2026-06-18" />
