showInPane does not work

2015-09-24 Thread Bengt Rodehav
t I assume that the showInPanel() method is supposed to do that. I've tried this in POI versions 3.11, 3.12 and 3.13-beta1 but it doesn't work in any of them. Is this a known bug or have I misunderstood the functionality. Best regards, Bengt Rodehav

Re: showInPane does not work

2015-09-24 Thread Bengt Rodehav
Hello Mark and thank you for your reply, I'm not exactly sure what you mean. Perhaps my case is a bit special though. I use a base template that contains too many sheets. I then remove sheets and modify them a bit. I also add a couple of sheets. However, most sheets are not created by me (POI) but

Re: showInPane does not work

2015-09-25 Thread Bengt Rodehav
Did you have a chance to see if showInPane() works Mark? /Bengt 2015-09-24 17:20 GMT+02:00 Bengt Rodehav : > Hello Mark and thank you for your reply, > > I'm not exactly sure what you mean. Perhaps my case is a bit special > though. I use a base template that contains too ma

Diagonal border

2015-09-25 Thread Bengt Rodehav
I need to detect whether a cell has diagonal borders. In the Excel document I receive, the customer indicates that a cell should be skipped by applying both forward and backward diagonal border so that an "X" is drawn. I've seen that the BorderFormatting class seems to support diagonal borders in

Re: showInPane does not work

2015-09-28 Thread Bengt Rodehav
Hello Mark, I am already using Sheet.setActiveCell() but it doesn't help. The cell becomes selected but it is not in view. My use case is a bit different. I read an existing Excel document which is a template for the Excel document I create. The source Excel sometimes has sheets that are scrolled

Re: Diagonal border

2015-09-28 Thread Bengt Rodehav
Thank you Mark and Dominik. I will try to get this information from the cell style. /Bengt 2015-09-25 18:22 GMT+02:00 Dominik Stadler : > Hi, > > There was a discussion about how to set diagonal border styling a few > weeks ago, see > http://mail-archives.apache.org/mod_mbox/poi-user/201508.mbox

Re: Diagonal border

2015-09-28 Thread Bengt Rodehav
le) part;* * break;* *}* * }* * if (mStylesTable == null) {* *throw new RuntimeException("Could not find styles table");* * }* Thanks for your help, /Bengt 2015-09-28 9:32 GMT+02:00 Bengt Rodehav : > Thank you Mark and Dominik. I will try to get this information from the >

Re: Diagonal border

2015-09-28 Thread Bengt Rodehav
BTW, the mExcelReader is just an instance of a utility class of mine that encapsulates a few things like the workbook. /Bengt 2015-09-28 11:02 GMT+02:00 Bengt Rodehav : > I got it to work as follows: > > * private boolean isCrossedOut(Sheet theSheet, int theRow, int theCol) {* > &g

Re: showInPane does not work

2015-09-29 Thread Bengt Rodehav
Thanks - I appreciate it. /Bengt 2015-09-29 9:06 GMT+02:00 Mark Beardsley : > No answer off of the top of my head but let me play with a bit more code to > see what I can find out. > > > > -- > View this message in context: > http://apache-poi.1045710.n5.nabble.com/showInPane-does-not-work-tp572

Re: showInPane does not work

2015-10-01 Thread Bengt Rodehav
No worries Mark - I'm happy with your help. I do use both showInPane() and setActiveCell() but it doesn't work for me. I'm doing it in the other order though - maybe that makes a difference? /Bengt 2015-10-01 8:30 GMT+02:00 Mark Beardsley : > No time yet to experiment with code - some people do

Re: showInPane does not work

2015-10-05 Thread Bengt Rodehav
Thanks a lot for your effort! Yes, what you've found out does agree with the testing I've done. I've also wondered why there is no setter for the topLeftCell which I also thought would be what is required in this case. Thanks for your help, /Bengt 2015-10-03 16:02 GMT+02:00 Mark Beardsley : >

Copy cell with validation

2015-10-06 Thread Bengt Rodehav
I have template sheets that I use to copy cells with formatting to other sheets. I do it this way: private static void copyCell(Cell oldCell, Cell newCell) { newCell.setCellStyle(oldCell.getCellStyle()); switch (oldCell.getCellType()) { case Cell.CELL_TYPE_STRING: newCell.setC

Re: Copy cell with validation

2015-10-06 Thread Bengt Rodehav
e.org/bugzilla/attachment.cgi?id=33138&action=diff#src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java_sec5 > > On 6 Oct 2015 06:36, "Bengt Rodehav" wrote: > > > >> I have template sheets that I use to copy cells with formatting to other > >> sheet

Re: showInPane does not work

2015-10-07 Thread Bengt Rodehav
Thanks a lot - will try ASAP. /Bengt 2015-10-07 15:38 GMT+02:00 Mark Beardsley : > Three days of rain and it is too wet to work in the reed beds. So, I have > been able to play and make some real progress. The code below will make > sure > that cell A1 is both active and appears at the top leaft

Re: Copy cell with validation

2015-10-08 Thread Bengt Rodehav
cs/org/apache/poi/ss/usermodel/DataValidation.html#getRegions() > [3] > https://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.html > [4] > https://bz.apache.org/bugzilla/attachment.cgi?id=33138&action=diff#src/ooxml/java/org/apache/poi/xssf/usermod

Re: showInPane does not work

2015-10-08 Thread Bengt Rodehav
I've tried your code and it works perfectly for me - thanks. /Bengt 2015-10-07 16:24 GMT+02:00 Bengt Rodehav : > Thanks a lot - will try ASAP. > > /Bengt > > 2015-10-07 15:38 GMT+02:00 Mark Beardsley : > >> Three days of rain and it is too wet to work in the reed

Re: showInPane does not work

2015-10-08 Thread Bengt Rodehav
I think that's an excellent idea. I did this: private void scrollTopLeft(XSSFSheet theSheet) { CTWorksheet ctWorksheet = theSheet.getCTWorksheet(); CTSheetViews ctSheetViews = ctWorksheet.getSheetViews(); CTSheetView ctSheetView = ctSheetViews.getSheetViewArray(ctSheetViews.sizeOfShe

Re: showInPane does not work

2015-10-12 Thread Bengt Rodehav
Thanks a lot Mark, /Bengt 2015-10-10 8:56 GMT+02:00 Mark Beardsley : > To find out how to get at the sheet view, I dug around in the source for > the > XSSFSheet class. That class already included code to get at the array of > sheet views from the worksheet and it simply assumed that the first e

Detect if a cell is date formatted

2016-03-07 Thread Bengt Rodehav
I have a situation where an Excel template I get from a third party (this is for EIOPA's Solvency II reporting) wrongly has set date formatting in a number of cells. I want to fix this programatically. I use code like this to try to detect date formatting: if (cell.getCellType() == Cell.CELL_TYPE

Re: Detect if a cell is date formatted

2016-03-09 Thread Bengt Rodehav
utting a number in, > why not put a number in? > > On Mon, Mar 7, 2016 at 7:52 AM, Bengt Rodehav wrote: > > > I have a situation where an Excel template I get from a third party (this > > is for EIOPA's Solvency II reporting) wrongly has set date formatting in > a

Re: Detect if a cell is date formatted

2016-03-09 Thread Bengt Rodehav
t; easily be nil), but I hadn't thought of using "IsADateFormat" before... > > On Wed, Mar 9, 2016 at 1:16 AM, Bengt Rodehav wrote: > > > Thanks for your reply Blake, > > > > Yeah I was actually considering this (put a number in, check if date, > then >

Set comment width in pixels

2016-06-07 Thread Bengt Rodehav
Hello, I generated comments for some cells in the Excel document. But, it seems like the width of the comment depends on the width of the cell which is very unintuitive. I know how wide (in pixels) the comment need to be to work visually but sometimes it is attached to a wide cell and sometimes to

Re: Set comment width in pixels

2016-06-07 Thread Bengt Rodehav
ute is specified in > reside within the simple type definition referenced below." > > unfortunately I could not find after a quick look what dimension the > colOffset/rowOffset actually has, so you might need to go by > trial-and-error a bit to find useful values for your case. >

Re: Set comment width in pixels

2016-06-09 Thread Bengt Rodehav
Hi Andi, Interesting code in the URL you mentioned. It was quite hard to follow though... I wasn't sure how I could use this for comments. Does Excel support specifiying the width of a commnent in pixels and not in number of columns? Is it just a limitation in POI or is it a limitation in Excel?

Re: Set comment width in pixels

2016-06-13 Thread Bengt Rodehav
Hi Mark, I did look at the XML for the drawing associated with the comment. It looks somesting like this 1, 15, 0, 2, 17, 61, 8, 14 False 0 0 There is a with as an attribute to the element. It seems correct but changing it doesn't

Re: Set comment width in pixels

2016-06-14 Thread Bengt Rodehav
visibility:visible;mso-wrap-style:tight' fillcolor="#e1" > o:insetmode="auto"> > > > > > > > > 1, 15, 0, 2, 17, 61, 8, 14 > False >

Support for mergefield for Word

2017-02-22 Thread Bengt Rodehav
Hello, I have a customer with a Word template that uses mergefields. I need to be able to set the values of those fields. How can I do that with POI? The Word template itself is created using Word. /Bengt

Ungrouping sheets

2019-07-04 Thread Bengt Rodehav
. I don't do anything to group them, in fact I do not even know how to group sheets using POI. Does anyone have an answer to this mystery? At the very least I would like to be able to ungroup the sheets using code (not manually). Best regards, Bengt Rodehav

Changing the color palette

2022-03-25 Thread Bengt Rodehav
In order to reduce the number of styles used, I use the CellUtil class. However it only works if the colors are indexed colors. See: https://bz.apache.org/bugzilla/show_bug.cgi?id=59442 So, I now only use indexed colors. But I'm not really pleased with the default colors and would like to change

Re: Changing the color palette

2022-03-25 Thread Bengt Rodehav
> Kevin Seymour | Sr. Architect, App Development > o: 603-354-6195 > c: 603-505-0180 > > > -----Original Message- > From: Bengt Rodehav [mailto:be...@rodehav.com] > Sent: Friday, March 25, 2022 11:48 > To: POI Users List > Subject: Changing the color palette >

Re: Changing the color palette

2022-03-28 Thread Bengt Rodehav
won't work with this color (there is a known bug regarding this - the cell will turn black). /Bengt Den fre 25 mars 2022 kl 17:28 skrev Bengt Rodehav : > Thanks! > > /Bengt > > Den fre 25 mars 2022 kl 16:57 skrev Kevin Seymour : > >> There is an SO article that