How to export an Excel with custom layout
When use Pimics Excel export
Business Central contains an Excel integraiton by default. This integration can be use for internal purposes. Imidielty when you want to export a price list or another type of feed with the custom template the default integration can't be used. In that scenarios our Excel export will be helpful.
Before the export
There are several things which have to be set it before the Excel Export.
A mapping is typically created once per export type. You can define the format and layout of the Excel in the mapping. It means which column will be placed into the Excel. In the mapping is no selection of items, categories or prices, this is defined in publication.
When you use the configuration package some values can be already created.
- Choose the Search icon, enter Export Mapping and then choose the related link.
- Select New to create a new mapping
- Specify field Description
- Set Excel in field Type, after that a new group Excel - Details is available
- If you have a file which should be used as a template select it in the field Template File.
- This point is not required in the case of missing template data will be exported into an empty Excel worksheet.
- Go to Excel - Details and create a new line, specify these fields:
- Target List Name set a name of Excel list
- First Data Line set a line number where the data will be placed from
- Select List Settings from the group actions
- In a page Excel Export Mapping Line you can define a mapping between data in Pimics and the export.
- Create a new line
- Set Source Type to Item
- Set Source Field No. to 1. Use a lookup and select field Code
- Set Destination Type to Column
- Set Destination Value to A
- Repeat steps 1 to 6 to create other fields or use an action Copy to create a new line.
- Close all pages
- Choose the Search icon, enter Publication Channel and then choose the related link.
- Select New to create a new channel
- Specify fields Code and Description
- Set Type to Excel
- Set Publication Type to No Details
- In Excel group select Mapping Code which you created before in Mapping
- Choose the Search icon, enter Publication Group and then choose the related link.
- Create a new publication group for all types what you want to have in publication with predefined filters and rules. How to create publication group.
- Close all pages
We recommend to have a publication for each different content, it means if you want to export different items (or prices) for different customers, each should have their own publication with the same mapping.
In this scenario we assume that you download and apply the configuration packages. So all values is included in this package, but you an change it for your purposes.
- Go to Publication
- Create a new publication, select Excel (Publication) from the template list
- Select action Edit to open the Publication Card
- Define settings for pricing in group Pricing & Period
- Specify channel from point Publication Setup in field Export Channel
- Select action Publication Structure
- Define data for the export
- Select data you want to include in the export, by functions in group Insert New Peer.
- The data is inserted into publication and you can browse it in the publication tree.
- You can read more details about how to define publication structure
- Close the page Edit Publication Tree
- Select action Publish from Process
- The Excel file is generated and downloaded
- Next time when you want to export it again select action Update Publication or Reorganize Publication to update data. More details
- Select action Publish to get a file again
- Close all pages