Skip to content
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

Setting TopLeftCell in a template with Frozen columns Breaks both scroll and frozen columns #352

Open
EmaGht opened this issue Apr 1, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@EmaGht
Copy link

EmaGht commented Apr 1, 2021

Repository is still this: https://github.com/EmaGht/EPPLUS_Bug
Latest developer build of EPPLUS is installed so this (#347) is not a problem anymore, but now i added the showcase of the bug happening when setting the TopLeftCell (Line 19 of Program.cs)

Forgive me for nagging you this much

@JanKallman
Copy link
Contributor

The topLeftCell attribute set by the TopLeftCell is done on the sheet view, so this applies to the bottom right pane.
From the OOXML documentation:

Location of the top left visible cell Location of the top left visible cell in the bottom right
pane (when in Left-to-Right mode).

I think this has to be set on the pane element that currently is not exposed as a property ...

<pane xSplit="7" ySplit="7" topLeftCell="H56" activePane="bottomRight" state="frozen"/>

We will look into adding support for this.

@EmaGht
Copy link
Author

EmaGht commented Apr 7, 2021

It seems more complex than what i thought it should be...
Just to be sure we are talking about the same functionality, can you confirm to me that the

ws.View.TopLeftCell = "A1"

Of EPPLUS is supposed to work the same as

ws.Range["A1", "A1"].Select();

Of the COM?

If that's the case i will gladly wait until you manage to implement it! That's currently the only thing that's stopping us to get a commercial license :P

Thanks!

@JanKallman
Copy link
Contributor

I thing we have to deep dive into how it should work. You have the panes today in ws.View.Panes and we should liklely implement it there. It look like this in the worksheet xml:

<sheetViews>
<sheetView tabSelected="1" zoomScaleNormal="100" workbookViewId="0">
<pane xSplit="7" ySplit="7" topLeftCell="H8" activePane="bottomRight" state="frozen"/>
<selection activeCell="A6895" sqref="A6895:G6918"/>
<selection pane="topRight" activeCell="A6895" sqref="A6895:G6918"/>
<selection pane="bottomLeft" activeCell="A6895" sqref="A6895:G6918"/>
<selection pane="bottomRight" activeCell="M19" sqref="M19"/>
</sheetView>
</sheetViews>

@EmaGht
Copy link
Author

EmaGht commented Apr 7, 2021

I'm doing a LOT of assumptions here, but...
I imagine a single cell should never be part of two different Panes, this means that maybe setting TopLeftCell on Worksheet.View could just get the Pane on which this Address is contained and set the topLeftCell of the correct Pane?

Understanding why the Excel file in my example gets THAT damaged when setting TopLeftCell on the wrong(?) Pane could definitely help me understand what's the exact problem here but I'm afraid it's a bit too much for me considering the time i have at hand ^.^"

Let me know if there is something i can do to help you out with this!

@JanKallman
Copy link
Contributor

We will look into this as it seems like a function that should be there. I'll add this as an enhancement for the next version.

@JanKallman JanKallman added the enhancement New feature or request label Apr 7, 2021
@JanKallman JanKallman self-assigned this Apr 7, 2021
@EmaGht
Copy link
Author

EmaGht commented Apr 9, 2021

I updated my repository (https://github.com/EmaGht/EPPLUS_Bug) with an example using Microsoft COMs,

Hope it's gonna be handy to check for the desired beahviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants