Skip to main content
Solved

Creating a vertical table

  • September 5, 2016
  • 7 replies
  • 185 views

ciarab
Contributor
Forum|alt.badge.img+9

Hi ,

I have been looking at this article on how to write to microsoft word with FME. I am trying to write out to a table in word. Results are good and I can produce a table like example below.

Application Number Application Type Decision 1234 Retention Permission Granted 1235 Permission APPLICATION DECLARED

However what my requirements are is to build this table horizontally and then group it by application number. So I would have 1 table per application like below.

Application Number 1234 Application Type Permission Decision Granted

Application Number 1235 Application Type Permission Decision APPLICATION DECLARED INVALID

This is the section in the sample workspace where the table is created from a customer transformer called MSWord table

The table itself is defined from here- I was wondering if anyone knows if its possible to define the table to produce vertical output??

Any ideas would be greatly appreciated.

Best answer by mark2atsafe

With a quick look it seems to me the JSONTable templater is only writing a series of sequential information from Templater2. I think I'd start out in that transformer. Make the subtemplate get both the attribute name as well as the attribute value, and set the group-by so it puts each attribute on a separate template. If you turn on breakpoints/debugging you can see what comes out of there and see what I mean.

In general there's two ways of looking at it. Either adjust the workspace to get the vertical layout you want, or flip your data around so it produces data that will achieve the right result with no workspace edits. The first method is the most - righteous, should we say? - but the second method might be quicker.

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 5, 2016

Hi @ciarab, just an idea....what happens if you set the group by setting of the JSONTemplater to your application?


ciarab
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • September 5, 2016
itay wrote:

Hi @ciarab, just an idea....what happens if you set the group by setting of the JSONTemplater to your application?

Using the group by causes workspace to fail but that is because the field headings are trying to be grouped as well as the content where I would only need the content to be grouped.

 

 

I'm sure this is possible to split it out by groups ( I have zero experience with JSON) but I think its feasible that splitting this would work if I sorted the template out.

 

 

What I am really unsure about if it is at all possible to turn the table around to be horizontal, this is what my current output looks like.

 

 

 

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 5, 2016
itay wrote:

Hi @ciarab, just an idea....what happens if you set the group by setting of the JSONTemplater to your application?

Hi, I actually think that you will probably need to dive deeper into how the JSON is interpreted and that grouping wont result in pivoting the table.

 

 


ciarab
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • September 5, 2016
itay wrote:
Hi, I actually think that you will probably need to dive deeper into how the JSON is interpreted and that grouping wont result in pivoting the table.

 

 

Thanks itay I agree,

 

 

I would need to set some sort of orientation factor in there. But I am unsure if this is even an option. I have tried creating an orientation but I either haven't got the right syntax or maybe this is not even possible. Just wondering if anyone else had an insight on it.

 

 


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • Best Answer
  • September 6, 2016

With a quick look it seems to me the JSONTable templater is only writing a series of sequential information from Templater2. I think I'd start out in that transformer. Make the subtemplate get both the attribute name as well as the attribute value, and set the group-by so it puts each attribute on a separate template. If you turn on breakpoints/debugging you can see what comes out of there and see what I mean.

In general there's two ways of looking at it. Either adjust the workspace to get the vertical layout you want, or flip your data around so it produces data that will achieve the right result with no workspace edits. The first method is the most - righteous, should we say? - but the second method might be quicker.


ciarab
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • November 4, 2016

Just to give a solution to this in case any one ever comes across the same problem as me.

I went with flipping my data around with the attribute exploder so my information is displayed the way I need it to. So I used a counter then an attribute expolder before I send the data into MSWordTable custom transformer and I chose the fields created in the attribute expolder.

Also you can create multiple tables using the custom transformer just use a counter and add the count value in the paragraph sequence

So you end up with an individual table for each feature count.


ciarab
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • November 4, 2016
mark2atsafe wrote:

With a quick look it seems to me the JSONTable templater is only writing a series of sequential information from Templater2. I think I'd start out in that transformer. Make the subtemplate get both the attribute name as well as the attribute value, and set the group-by so it puts each attribute on a separate template. If you turn on breakpoints/debugging you can see what comes out of there and see what I mean.

In general there's two ways of looking at it. Either adjust the workspace to get the vertical layout you want, or flip your data around so it produces data that will achieve the right result with no workspace edits. The first method is the most - righteous, should we say? - but the second method might be quicker.

Thanks Mark when I eventually got back to this your thought process of flipping the data made me think!

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings