rabanti-github / PicoXLSX

PicoXLSX is a small .NET / C# library to create XLSX files (Microsoft Excel 2007 or newer) in an easy and native way
MIT License
52 stars 13 forks source link

Setting TextBreak property on a cell #26

Closed kszili closed 2 months ago

kszili commented 4 months ago

Is it possible to add support for TextBreak in CurrentCellXf? Right now I don't see any way to set the cell break.

As an analogy, setting the horizontal alignment works like this:

PicoXLSX.Style s = new PicoXLSX.Style();
s.CurrentCellXf.HorizontalAlign = PicoXLSX.Style.CellXf.HorizontalAlignValue.center;

But I cannot set text break in a similar way, because CurrentCllXf does not have a TextBreak member. s.CurrentCellXf.??? = PicoXLSX.Style.CellXf.TextBreakValue.wrapText;

Or is there any other way to use and apply the wrapText value on a cell?

rabanti-github commented 4 months ago

Hi, Wich library version do you use? This should work in the most recent version: s.CurrentCellXf.Alignment = Style.CellXf.TextBreakValue.wrapText;

kszili commented 4 months ago

Hi

It works like a charm!

I did not know that I need to use the Alignment property of the CurrentCellXf. I tried to dig in the documentation for quite some time but I did not realize this.

Regards, Szilard

------ Eredeti üzenet ------ Feladó "Raphael Stoeckli" @.> Címzett "rabanti-github/PicoXLSX" @.> Másolat: "Kotta Szilárd" @.>; "Author" @.> Dátum 2024. 06. 05. 21:36:44 Tárgy Re: [rabanti-github/PicoXLSX] Setting TextBreak property on a cell (Issue #26)

Hi, Wich library version do you use? This should work in the most recent version: s.CurrentCellXf.Alignment = Style.CellXf.TextBreakValue.wrapText;

— Reply to this email directly, view it on GitHub https://github.com/rabanti-github/PicoXLSX/issues/26#issuecomment-2150816872, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7ADSDSEKR3IX3FON6NVBTZF5SEZAVCNFSM6AAAAABI2G56Z6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJQHAYTMOBXGI. You are receiving this because you authored the thread.Message ID: @.***>

rabanti-github commented 2 months ago

Thanks for the feedback. I will close this issue for now. Please open a new one, if there are any other problems.