|
Rank: Newbie
Joined: 6/23/2021 Posts: 1
|
Hello everybody
I'm new to Altova Mapforce, and I'm trying to map an xml file to excel. The problem I'm facing is that I have a number of statusses, which need to map onto columns in the excel file. However, not every customer uses the same statusses, so the number of columns and the column headers should be dynamic, depending on the customer. Unfortunately, it seems like I have to define a column range in advance, and add the column header, but there is no way of conditionally adding the column to the excel output or not.
Is there any way that this would be possible, so that I can output the right columns (and only those columns) to the excel file, depending on a customer id?
Thanks in advance!
|
|
Rank: Advanced Member
Joined: 6/16/2006 Posts: 486 Location: AT
|
Davy wrote:Unfortunately, it seems like I have to define a column range in advance, and add the column header, but there is no way of conditionally adding the column to the excel output or not.
There is, if you keep the option "Show a single Cells item for all columns" selected. However you can't mix fixed columns with dynamic ones - it's all or nothing.
In the "Show a single Cells item for all columns" mode, you can map a sequence of data items to the Cells node, and MapForce will create one column for each item. You can do the same with a sequence of strings to create your column headers. You can use "variable" components and the "Duplicate Input" function for the variable's "value" node to prepare such sequences easily.
|
|
Rank: Member
Joined: 2/3/2016 Posts: 17 Location: Plymouth, Michigan
|
Davy,
I can see where to duplicate inputs, and control the column number, but I don't see any connection for 'Column Name'
Would you be able to supply a screenshot of how that looks for getting column headers in from strings?
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 558
|
You have to switch the column mode. As that described, you can show columns in two ways: "Show a single Cells item for all columns," or "Show separate items for columns". The latter mode is what gives you letter-named columns A, B, C, etc., and the former gives you "Column Name" and "Column Number." This is described in the documentation topic, "Selecting Ranges of Cells".
|
|
guest |