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

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!

Related

How to auto adjust content control width to table column width in word using office js APIs?

I have custom word add-in, which inserts content control with numbers and currency symbols as text into word document at the cursor position.
Requirement is if content control is getting added inside a table, as a table cell, then width of content control should match with table column width.
Current behavior:
current behavior
Expected behavior:
expected behavior
Questions:
Is there any office JS API or out of the box Word feature to auto adjust content control width to match with table column width?
If not, is there any way to calculate width of both content control and table column programmatically and get number of spaces to be added? This algorithm should be generic so that it would work for all font families and font sizes.
Thanks for reporting the issue. It's definitely not right behavior and it has been put on our backlog 6336725. We will let you know when there is update. Thanks!

How can I use Footnotes with Oracle BI Publisher

I am putting a footnote in an .rtf template, and before generating a report it seems ok,
but when I load an XML sample and preview the document (.pdf or .doc etc.)
the footnote content goes right into the body of my report (example is in the picture).
I've tried using text boxes, but it doesn't help.
I've also tried just making a paragraph look as a footnote, but since I have a lot of
tags in my template, the footnote-looking text doesn't stay at the
bottom of the page.
and I can't use footers/headers because I need only one footnote at one page.
Try to draw a borderless table with one column and two rows where the first row has fixed hight (exactly) of the size of body, and the second row fixed hight of the size you want to reserve for the footer. Then you place your xml data in those two rows of the table the same way as you put it on the page. I use that for different forms when the position of the data is fixed. There are also other table/row/column properties that you might want to use.

How to write formula to grow all dynamic text field in crystal report

Hi Experts,
Is there any way to automatically grow the content of dynamic text
field in crystal report. I will give you an example this way.
I have values to display in crystal report as (which we fetch dynamically fromt the database)
Employee_ID, Employee_name, Employee_address
Now, the Employee_ID, Employee_name would be ok. But for
Employee_address the value can be anything from the database, i.e. it
can be lengthy also(like with 80 charectors also). That is it will come in next row and
overlap the below the row column ('address') value.
Now, is there any way(or formula), when one dynamic text field grows
like address, then previous two Employee_ID and Employee_address
should grow automatically and for next row the data should not overlap
also.
Please give ideas.
Thanks in advance.
If you mark the three fields can grow, then each field will expand (vertically) as necessary to accommodate the data. If the field does NOT need to expand, it won't. Moreover, if the three fields are arranged side-by-side in the same details section, there will be no overlap--either horizontally or vertically.
If you are trying to always bottom-align the three fields, regards of the vertical size of any of the fields (the address field in your example seems to be the issue), then you have a different problem:
Relative Positions
This option allows you to lock the relative position of a report object next to a grid object within a section. For example, if you place a text object one centimeter to the right of a cross-tab object, during report generation the program will push the text object to the right, so that the one centimeter space is maintained regardless of the width of the cross-tab object.
Note:
Only horizontal locking is possible. If you need to preserve relative vertical positioning, you should create a new report section.
Once Relative Positions is selected for a section, you can no longer drag objects to new positions within that section. To change an object's position, use the Object Size and Position dialog box.
Relative positioning applies only to objects placed to the right of grid objects (that is, objects that can grow horizontally).

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.

Nested table height auto increase?

I am trying to create a report in SSRS using Report Builder 3.0 where there is an ungrouped section of data (in the screenshot this is called "Risks") followed by a grouped section of data "Controls". There can be many controls to one risk row as seen in the row with the "Ref" 3a. After the grouped set of controls it goes back to the ungrouped risk info (see below).
screenshot
I have made this work by using a nested table inside one of the cells, this all looked fine until I added a larger amount of data in the cell "Consequences". As you can see this does not look good at the moment as the inner table does not grow.
My question, is there a way to make the inner table grow, so the 2nd row text would be in the middle of that row and the background colour would take up the whole row, so it does not leave a white space?
I really appreciate any help you can give.
Thanks,
Glenn
I do not believe this to be possible as the nested tablix is by its own right optimised for space and visual appearance.
I know what you want to do and I can only suggest you tweak yourn report to query this data in one and produce one tablix. Not ideal I know as this will mess the arrangement.