Home > Forum > Actions > Generate an Excel from an Itemlist

Generate an Excel from an Itemlist
0

Hi guys,
i just have another question...

we need to create an Excel file from an item list. Basically, this works well using an appropriate Excel template. However, I have fields in the item list that are filled from a fixed value list and the action then creates an entry in the column in the format [ID#Name]. But I only want to see [Name].

What am I doing wrong?

MVP

Hi,

It seems to me that the standard action to generate excel from a list of items does not have the option to select the 'Name Only' option for an attribute type choose.
What you can do for this scenario is to add to the list technical columns ex. sql row, to the list where the name will fall and map these columns to the excel table.
You can also create a technical list and update it on record with the data from the head list, Properly formatted , that is, only the names and the list has only a text field.

Regards.

In reply to: Raluca-Mirabela Lupu

Hi,

If you use the "generate file and excel" action, you can map the corresponding field for each column in the template.
You can choose from the chocefield what to display.
Another option is you can set "allow export excel" at the item list level.
You can try to create column type "data row" in itemlist, or you create sdk for generate excel with data sources sql.

Thanks,
Raluca

Hi,

thanks for all your answers and iteas. The"allow export excel" will not work, because i have to generate the excel automatically and then send it to our customer, depending on a path in the Workflow. Also it seems that i can not map the corresponding excel field for each column in the template because i do not know how much rows i have in the itemlist - or is there a way to use e.g. asterix to use a dynamic way for the targetfields in excel. i'll try that.

The "best" way seems to be, that i use some technical fields or a technical list which i then can map to the excel.

In reply to: Gerd

Hi,

thanks for all your answers and iteas. The"allow export excel" will not work, because i have to generate the excel automatically and then send it to our customer, depending on a path in the Workflow. Also it seems that i can not map the corresponding excel field for each column in the template because i do not know how much rows i have in the itemlist - or is there a way to use e.g. asterix to use a dynamic way for the targetfields in excel. i'll try that.

The "best" way seems to be, that i use some technical fields or a technical list which i then can map to the excel.

Gerd,

I came across issue with generating xlsx file from item list myself and I hope you would be able to help. I created xlsx template having a table named Tabela1 consisting of 5 columns and item list with exacly same column names. I actualy exported the item list to xlsx and converted it to a template. After setting up a mapping on the 'Generate excel file' action and running it I keep getting 'Invlid cell name' error. Full error log below. When I use cell adress in mapping (A2) there is no error but only last row of item list is exported which is not what I'm trying to achieve. What am I missing here?

Log
Error code: 100
Invalid cell name
at Aspose.Cells.CellsHelper.CellNameToIndex(String cellName, Int32& row, Int32& column)
at WebCon.WorkFlow.Base.Actions.GenerateExcelWorksheet.InsertValueFromTag(ITagParser tagParser, String tag, TupleEx`2 address, Workbook workbook, ExcelDataTimeHelper excelDataTimeHelper)
at WebCon.WorkFlow.Base.Actions.GenerateExcelWorksheet.FillExcelFileOrReturnError(XmlActionsConfig config, WorkFlowObject wfObject, ITagParser tagParser, Workbook workbook, ExcelDataTimeHelper excelDataTimeHelper)
at WebCon.WorkFlow.Base.Actions.GenerateExcelWorksheet.FireAction(WorkFlowObject wfObject, IWFAction wfAction, ITagParser tagParser, IAutomationDataHelper automationDataHelper, String& message, String& logMessage)
at WebCon.WorkFlow.Base.Automations.Engine.Evaluators.ActionEvaluator.FireAction(ActionBase actionObject, String& userLogMessage, String& adminLogMessage)
at WebCon.WorkFlow.Base.Automations.Engine.Evaluators.ActionEvaluator.Evaluate()

In reply to: Wojtek

Gerd,

I came across issue with generating xlsx file from item list myself and I hope you would be able to help. I created xlsx template having a table named Tabela1 consisting of 5 columns and item list with exacly same column names. I actualy exported the item list to xlsx and converted it to a template. After setting up a mapping on the 'Generate excel file' action and running it I keep getting 'Invlid cell name' error. Full error log below. When I use cell adress in mapping (A2) there is no error but only last row of item list is exported which is not what I'm trying to achieve. What am I missing here?

Log
Error code: 100
Invalid cell name
at Aspose.Cells.CellsHelper.CellNameToIndex(String cellName, Int32& row, Int32& column)
at WebCon.WorkFlow.Base.Actions.GenerateExcelWorksheet.InsertValueFromTag(ITagParser tagParser, String tag, TupleEx`2 address, Workbook workbook, ExcelDataTimeHelper excelDataTimeHelper)
at WebCon.WorkFlow.Base.Actions.GenerateExcelWorksheet.FillExcelFileOrReturnError(XmlActionsConfig config, WorkFlowObject wfObject, ITagParser tagParser, Workbook workbook, ExcelDataTimeHelper excelDataTimeHelper)
at WebCon.WorkFlow.Base.Actions.GenerateExcelWorksheet.FireAction(WorkFlowObject wfObject, IWFAction wfAction, ITagParser tagParser, IAutomationDataHelper automationDataHelper, String& message, String& logMessage)
at WebCon.WorkFlow.Base.Automations.Engine.Evaluators.ActionEvaluator.FireAction(ActionBase actionObject, String& userLogMessage, String& adminLogMessage)
at WebCon.WorkFlow.Base.Automations.Engine.Evaluators.ActionEvaluator.Evaluate()

Hi Wojtek,
in your case you should indicate in the mapping the list (not specific columns)