-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Merging Ranged Sections in PHP Spreadsheet #3894
Comments
This isn't quite as straightforward as you think, because while an Excel merge might work in this way, other spreadsheet applications do maintain the old cell values and styles from the other cells in the merged range. The Worksheet's |
Yeah, I came across a similar situation, and I wanted to create a pull request with the solution I tried and worked on. The entire implementation by my side also mapped the coordinates, instead, the pull request just copies the range by also grouping them, since in my knowledge when you copy things programmatically, and it passes the threshold of letters, maybe something breaks apart, so to address this, I have applied grouped by. Thank you for the response though, I appreciate it. So far I tried it wit google spreadsheet, i might have also to check these others when I have some time |
@MarkBaker take a look maybe at the branch, and let me know if you believe it fits the requirement of what I tried to explain. As mentioned this is grouped by because I thought that it might not be quite the use case when you have copies that span horizontally without a break. So this accommodates this change. I believe this is a good solution. I was first trying another thing, which was more complicated but not very flexible, instead, this is structured well and it almost gives the impression that your copying and pasting |
Subject:
I'm encountering an issue when attempting to merge ranged sections within PHP Spreadsheet. The current behavior seems to create a visual appearance of merged cells, but the underlying structure doesn't fully merge the cells, leading to potential data integrity and formatting problems.
Steps to Reproduce:
Create a new spreadsheet.
Select a range of cells that you want to merge.
Use the merge method provided by the library (e.g., $spreadsheet->mergeCells('A1:C3')).
Observe that the cells appear merged visually, but their individual properties remain intact.
Expected Behavior:
The cells within the specified range should be genuinely merged, resulting in a single cell that spans the entire range.
Data and formatting should be consolidated into the merged cell, ensuring consistency and preventing unexpected behavior in subsequent operations.
Actual Behavior:
This can lead to issues such as:
Data is overwritten when entering values in seemingly merged cells.
Formatting inconsistencies when applying styles to the merged range.
Unexpected behavior when performing calculations or data manipulation on the merged cells.
Request:
Please address this issue by implementing a solution that performs a true merge of the selected cells, combining their data and formatting into a single, unified cell. This enhancement would significantly improve the accuracy and reliability of data manipulation within PHPSpreadsheet.
Additional Information:
PHP Spreadsheet library version: 1.29
Operating system: Microsoft
Thank you for your attention to this matter. I'm eager to see this feature implemented to enhance the functionality of PHP Spreadsheet.
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:
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Excel and Google Spreadsheet
Which versions of PhpSpreadsheet and PHP are affected?
PHP 8.1
PHPSpreadsheet 1.29
The text was updated successfully, but these errors were encountered: