Get height of a table row in libreoffice writer after rendering - libreoffice

Is it possible to measure the height of a table row in LibreOffice writer? I want to be able to measure the actual height of a table row in the document. I create the document by copying a template file and modifying the document.xml.
Use Case: Need fixed height for the table. If the table height is smaller than the required height, add an empty row to make up for the height.

What have you tried?
LibreOffice API doesn't provide a direct call to get the height of a TextTable.
See this thread to get an idea of how you can compute a height value.

Related

Adjust column width in Nattable - show complete column name when selected

I need to display complete column header name, when column is selected, it means increase column width. And reset width when column is deselected. I did not find example in nattable_examples.exe. Is there some built in feature?
No there is no built-in feature that would support automatic increase/decrease of column widths on selection. You will need to implement some selection listener and then do an auto-resize on the selected column by using the AutoResizeColumnsCommand.
But I don't think we have an event on deselect, so I am not sure how you want to reduce the column width again.

Rmd to word with flex table - need to increase margins of ONLY the table in the word output

I am building a routine report in Rmd that is outputted to word.
I have created a reference document to determine all the fonts and styles.
I am using flextable to create the table in this report.
The table needs to be wider than the margins of the rest of the word document.
Is there anyway to do this?
So far I am only getting the correct margins on the outputted table by increasing the margins in the reference document, but this isn't a great solution since the rest of the document, which is mostly text, needs to stay within certain margins.
I have tried increasing the width of the columns (width function for flextable), but that also doesn't work.
Any help would be appreciated!

How to increase the column width dynamically in iReport using dynamic report?

I have created a jrxml file and by using dynamic reports I am filling up the data for the template.I need to adjust the column width based on the content inside it,I have looked into documentation and blogs everything leads to stretch overflow.But it will only increase the height and wrap the data .
My scenario I need to adjust the width of the column based on the content.Is it possible anyway? Is it possible to do it by using DynamicReports? If so how?
In jasper reports, you cannot increase the width of the component dynamically. You can only increase the height dynamically.
In dynamicreport also you have set width of column , it not increase on text length,pl check this link,may be helpful to you.
DynamicReport

Remove blank line between successive pages

I am able to create a text file from jasper implementation. Screenshot attached, the problem being faced here is that: In the individual pages , if there are less rows, jasper is creating the page with a default height (595 px as mentioned in jrxml) which makes rows after valid rows as blank and then creates a new page.
If i change the height to a smaller number, then the rows of the first page are flowing to the next page which should not be the case.
I want the new page to start from the place where first page records end. How can i configure this dynamic nature for every page in a jrxml.
Try to make the table height, band height, in which the table component is located and the report height to be same.
Suppose if table is in detail band and table height is 50 and there is no other component in the detail band, then make detail band height to 50 and the report height to 50.

Y position while composing a PdfPTable

I'm building a pdfptable thru ItextSharp, but I need to know, while I'm adding cells, my Y position in the page. Cells have a variable height.
I need to know it to avoid tu put a new 'Breaking title' in the table if this would go on the last table row, as it should go on a new page (on cust request).
I tried writer.getverticalPosition() but it seems not reliable in composing a table.
Is there a way to know it ?
There's a contradiction in your question. Let me explain what doesn't make sense.
You create a PdfPTable, let say you have an object named table. when you add cells to table, the object grows. Plenty of data is stored into memory.
Now you say: I want to know the Y position of the rows on the page while I'm adding cells.
Which page? There may not even be a page? As long as you build the table object, there is no page, there are no Y positions. One table could be 200pt heigh when added to a page with a width of 400pt. The same table could be 400pt heigh when added to a page with a width of 200pt. It isn't until you add the table object to a Document that the table gets its shape.
If you want to make sure a "title" isn't the last row on a page, you should break up your table in smaller parts. Create a subtable and add it to the document. Now use getVerticalPosition() and check how much space is left. If there isn't sufficient space for the first X rows of the next subtable, move to a newPage() and add the next table there, otherwise add the table on the current page.
If you define the widths correctly, nobody will see that you've been adding more than one table: it will look as if you added one large table instead of different small ones. If you don't know how to calculate the height of the rows in the subtables, please note that you need to define the total width of the table and lock the widths. For the reason explaiined above, no software can calculate the height of a table if it doesn't have any info about its width.