Skip to content

Error in part of the content in the book... #4270

@Cleverscript

Description

@Cleverscript

What is the expected behavior?

Numeric data cells are missing extra characters

What is the current behavior?

Why for numeric values ​​in cells, the first character before this number, is added a single quote. This leads to an error in Microsoft Excel. I added a condition that if the value = is_numeric, then we set DataType::TYPE_NUMERIC for setValueExplicit. But there are numbers in the form of a date 04.09.2024 or such as 47.91.2 and this did not work with them ... How to solve the problem with them if TYPE_NUMERIC for them leads to a Fatal error ?

What are the steps to reproduce?

->setValueExplicit('04.09.2024', DataType::TYPE_STRING);

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

->setValueExplicit('04.09.2024', DataType::TYPE_STRING);

If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.

What features do you think are causing the issue

  • Writer

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

Xlsx

Which versions of PhpSpreadsheet and PHP are affected?

<=1.28

report_2024-11-27.xlsx

artefact_2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions