Smartly Importing Master and Details Data into Excel With Smart Markers

Possible Usage Scenarios

Sometimes, you want to generate dynamic Excel reports, it includes a comprehensive main dashboard and multiple fine-grained detailed worksheets. Among them, a single main table presents an overview, which may showcase various product variants, and each corresponding detailed worksheet provides specific and in-depth data for a single variant. Aspose.Cells can perfectly meet your needs through master and details with smart markers.

Smart Marker Parameters for Master and Details

To import master and details data into Excel, you need to use the following smart marker parameters:

Parameter Description
DetailSheet Specify the name of the detail worksheet stored in the template file.
DetailTable Specify the table name of the detail worksheet in the template file.
DetailSheetNewName Specify the name of the newly created detail worksheet.
DetailLink Indicate whether to add hyperlinks to the location of the imported data.

How to Use Master and Details When Master and Details in One Worksheet

Sometimes, you need to import master and details data to excel in SmartMarkers. Aspose.Cells makes it possible to use master and details parameters in SmartMarkers. Please check template file, json file and the screenshot of the output excel file generated with the following code.

The first worksheet of the template.xlsx.
todo:image_alt_text
The first worksheet of the output excel file.
todo:image_alt_text
The second worksheet of the output excel file.
todo:image_alt_text

Json data as follows:

{
	"node": {
		"Styles1": [
			{
				"StyleID": "1style001",
				"StyleName": "StyleName1",
				"Quantity": 6,
				"UnitPrice": 18.45,
				"MaterialType":"Cotton"
			}
		],
		"Styles2": [
			{
				"StyleID": "2style001",
				"StyleName": "Cotton StyleName2",
				"Quantity": 6,
				"UnitPrice": 18.45,
				"MaterialType":"Cotton"
			},
			{
				"StyleID": "2style002",
				"StyleName": "Denim StyleName2",
				"Quantity": 8,
				"UnitPrice": 58.8,
				"MaterialType":"Denim"
			}
		]
	}
}

The example that follows shows how this works.

How to Use Master and Details When Master and Details in Different Worksheet

Sometimes, you need to import master and details data to excel in SmartMarkers. Aspose.Cells makes it possible to use master and details parameters in SmartMarkers. Please check template file, json file and the screenshot of the output excel file generated with the following code.

The first master worksheet of the template.xlsx.
todo:image_alt_text
The second master worksheet of the template.xlsx.
todo:image_alt_text
The detail worksheet of the template.xlsx.
todo:image_alt_text
The first master worksheet of the output excel file.
todo:image_alt_text
The second master worksheet of the output excel file.
todo:image_alt_text
The detail worksheet of the first master worksheet in the output excel file.
todo:image_alt_text
The first detail worksheet of the second master worksheet in the output excel file.
todo:image_alt_text
The second detail worksheet of the second master worksheet in the output excel file.
todo:image_alt_text

Json data as follows:

{
	"node": {
		"Styles1": [
			{
				"StyleID": "1style001",
				"StyleName": "StyleName1",
				"Quantity": 6,
				"UnitPrice": 18.45,
				"MaterialType":"Cotton"
			}
		],
		"Styles2": [
			{
				"StyleID": "2style001",
				"StyleName": "Cotton StyleName2",
				"Quantity": 6,
				"UnitPrice": 18.45,
				"MaterialType":"Cotton"
			},
			{
				"StyleID": "2style002",
				"StyleName": "Denim StyleName2",
				"Quantity": 8,
				"UnitPrice": 58.8,
				"MaterialType":"Denim"
			}
		]
	}
}

The example that follows shows how this works.