Spreadsheet conversion options

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Markdown MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-markdown -- dnx GroupDocs.Markdown.Mcp --yes
Folders, licensing and more →

When converting spreadsheets, use these setters on DocumentConvertOptions to control the Markdown table output.

Column and row truncation

import com.groupdocs.markdown.*;

public class SpreadsheetTruncation {

    public static void main(String[] args) {
        DocumentConvertOptions options = new DocumentConvertOptions();
        options.setMaxColumns(8);   // Only first 8 columns
        options.setMaxRows(50);     // Only first 50 data rows per sheet

        MarkdownConverter.toFile("cost-analysis.xlsx", "spreadsheet-truncation.md", options);

        // Truncated columns/rows show "..." indicators.
        // Warnings are reported by DocumentConvertResult.getWarnings().
    }
}

cost-analysis.xlsx is a sample file used in this example. Click here to download it.

## Summary

| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
| Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 |
| Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 |
| Warehousing | $420,000.00 | $510,000.00 | $590,000.00 |
| Shipping | $380,000.00 | $445,000.00 | $520,000.00 |
| Marketing | $250,000.00 | $340,000.00 | $480,000.00 |
| R&D | $180,000.00 | $230,000.00 | $310,000.00 |
[TRUNCATED]

Download full output

Sheet separator and hidden sheets

import com.groupdocs.markdown.*;

public class SpreadsheetSheets {

    public static void main(String[] args) {
        DocumentConvertOptions options = new DocumentConvertOptions();
        options.setSheetSeparator("\n---\n");     // Separator between worksheets
        options.setIncludeHiddenSheets(false);    // Skip hidden worksheets (default)

        try (MarkdownConverter converter = new MarkdownConverter("cost-analysis.xlsx")) {
            DocumentConvertResult result = converter.convert("spreadsheet-sheets.md", options);

            for (String warning : result.getWarnings()) {
                System.out.println("Warning: " + warning);
            }
            // e.g. "Worksheet 'Data' truncated at 50 rows."
        }
    }
}

cost-analysis.xlsx is a sample file used in this example. Click here to download it.

## Summary

| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
| Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 |
| Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 |
| Warehousing | $420,000.00 | $510,000.00 | $590,000.00 |
| Shipping | $380,000.00 | $445,000.00 | $520,000.00 |
| Marketing | $250,000.00 | $340,000.00 | $480,000.00 |
| R&D | $180,000.00 | $230,000.00 | $310,000.00 |
[TRUNCATED]

Download full output

Available options

SetterTypeDefaultDescription
setMaxColumnsint0 (unlimited)Maximum columns per table
setMaxRowsint0 (unlimited)Maximum data rows per worksheet
setSheetSeparatorString"\n---\n"Separator inserted between worksheets
setIncludeHiddenSheetsbooleanfalseWhether to include hidden worksheets