#officewriter - Worksheet.PopulatedCells.AutoFitHeight(); not working - officewriter

#officewriter - Worksheet.PopulatedCells.AutoFitHeight(); not working.
Recently i have updated excel version from xls to xlsx, but now the above function is not working, giving below error.
Error : No cells have been populated in the Worksheet

Populated cells will look for cells with values in them and return an
area that includes all the cells. If populated cells have no values
then it will thrown an exception, however if that is the case there is
nothing to autoFit.
One way to work around this would be to define the area to autofit
(say the whole worksheet) and then call autofit. Then you don't have
to rely on populated cells to determine the area.

Related

iText vs 4 layers values on top of each other

I am generating the creation of a PDF using values from an XML file. The file is being created properly. The problem I'm having is a bunch of values are being put into the same field. I have commented out all the PDFStamper SetValue statements and brought them back one by one no matter how many lines are execute values are being duplicated in the last row.
I wanted to add an image to show what it looks like, but I keep getting errors about the "Body is missing".... Isn't this the body?

How can I style a cell or row/column of cells in NatTable programatically?

I'm having a hard time figuring out how to individually style a cell or group of cells when a certain thing happens. For instance I would like to be able to right-click on a cell and hit something like "tag" and it would change the background color of the cell to something different. I would like to do the same thing with rows, columns, or any random group of selected cells. I also need this change in style to persist even if the cell(s) are moved beyond the viewport layer's view.
If you have a hard time with NatTable, maybe it is worth reading some of our tutorials and documents.
https://www.eclipse.org/nattable/documentation.php?page=styling
http://www.vogella.com/tutorials/NatTable/article.html
In short related to your question. Individual styling is done via config labels on a cell and styles that are registered in the ConfigRegistry for that label. So what you need to do is to implement some sort of label registry based on cell indeces. That label registry then needs to be used by a custom ConfigLabelAccumulator so the labels are attached to the cells with the corresponding indeces.
We have a basic implementation on a column base via the ColumnStyleEditorDialog. This can be seen in the _000_Styled_grid example by clicking on the column header and call "Format cells". Personally I think that feature is not complete, but it should help you in seeing how it works in principle.

UITableViewController- showing only rows with content and an image where there is none

When creating a UITableViewController there are two situations that create an "ugly" UX
calling/open it without any data in it --> shows an empty table (i.e. empty rows,UITableViewCell, as many as fit in the window)
calling/open it with fewer rows of content that fit the window --> show the full rows followed by empty rows
I wish to receive the following result:
if there is no data show a picture or view with text - there isn't any data yet or something like that
show only the full lines and no more rows (blank or background image)
Is there a way to achieve that?
To add these effects, you will probably have to make your own UITableViewController from a regular UIViewController, and even subclass UITableView. If you have a regular UIViewController with your filler image/text as the background, you can place a UITableView on top and hook up the delegate/datasource. Now, in your code, detect when there is no data available and set the hidden property of the UITableView accordingly.
As for the following empty rows, you will either have to turn off the row separators (in IB), or subclass a UITableView (can't help you there). Good luck!

Jasper report excel cutting off cell

I want to export to excel, but I want the data to print in a cell irregardless of how much data it is. I have tried setting the "Stretch with Overflow" option and that appears to work, but it creates empty rows between actual data rows. I tried adding the IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS to true and it does not resolve my issue. I am also using IS_IGNORE_PAGINATION.
Ideally I want excel exports to just put all the data in a cell independent of the size of the cell.
I found the answer. You need to set the net.sf.jasperreports.print.keep.full.text report parameter to true
#DMoses: I had the problem of the empty rows a lot using the "Stretch with Overflow" and it was generated because I left unconsciously a space between the cell where I display the data and the margin of the report. Just put the cell at the edge of the margin and then you won't have that problem.

UITableView: moving a row into an empty section

I have a UITableView with some empty sections. I'd like the user to be able to move a row into them using the standard edit mode controls. The only way I can do it so far is to have a dummy row in my "empty" sections and try to hide it by using tableView:heightForRowAtIndexPath: to give the dummy row a height of zero. This seems to leave it as a 1-pixel row. I can probably hide this by making a special type of cell that's just filled with [UIColor groupTableViewBackgroundColor], but is there a better way?
This is all in the grouped mode of UITableView.
UPDATE: Looks like moving rows into empty sections is possible without any tricks, but the "sensitivity" is bad enough that you DO need tricks in order to make it usable for general users (who won't be patient enough to slowly hover the row around the empty section until things click).
I found that in iOS 4.3, the dummy row needs to have a height of at least 1 pixel in order to give the desired effect of allowing a row to be moved into that section.
I also found that the dummy row is only needed in the first and last section; any sections in between don't have this problem.
And it looks like in iOS 5.0, no dummy rows or special tricks are needed at all.
While managing the edit, you can monitor if the table view is in Edit Mode. Use that flag inside of cellForRowAtIndexPath to decide weather or not to display the 'blank' row. While in 'regular' mode, the row will not display, but when the user taps 'edit' cellForRowAtIndexPath should get called again and this time decide to display the row. The details of how to do that depend on your data source and how you are gluing it to the display. If you aren't getting the call again, you can manually inject rows with insertRowsAtIndexPaths / deleteRowsAtIndexPaths and/or call reloadData to force a refresh.
I found that if you return -1.0 from the heightForRowAtIndexPath method it will remove the 1 pixel line.