Servigistics InService Customization > Customizing System Integrations > Hiding Extraneous Columns in the Cart Excel File
  
Hiding Extraneous Columns in the Cart Excel File
Servigistics InService enables you to hide columns in the Microsoft Excel files used for importing and exporting cart and cart items.
You can create a custom delegate that includes the code to hide columns. The custom delegate must implement the com.ptc.sc.services.plugins.CartFormatConverterDelegate interface. For more information about creating custom delegates, see Creating Custom Delegates on the Server.
Format for Hiding Columns
Use the following format displayed in the example code of a custom delegate to specify which columns to hide:
List<Object> headersRow = cartItemsDataTable.get(0);

if (headersRow != null && headersRow.size() > 0) {

for (int i = 0; i < headersRow.size() ; i++) {

String headerName = (String) headersRow.get(i);

if ("<column_name>".equalsIgnoreCase(headerName)) {
cartItemSheet.setColumnHidden(i, true);
Note the following points in the format:
Replace <column_name> with the name of the column you want to hide.
Repeat the if statement in the code for each column you want to hide.
Place the code for hiding columns inside the in – createSheetFromData() function and after the following code in the custom delegate file:
for (int col = 0; col < total_cols; col++) {
cartItemSheet.autoSizeColumn(col);
}
The following example code hides the columns Dealer Part and TopicID (operational) in the Microsoft Excel files used for importing and exporting cart and cart items:
List<Object> headersRow = cartItemsDataTable.get(0);

if (headersRow != null && headersRow.size() > 0) {

for (int i = 0; i < headersRow.size() ; i++) {

String headerName = (String) headersRow.get(i);

if ("Dealer Part".equalsIgnoreCase(headerName)) {
cartItemSheet.setColumnHidden(i, true);
}
if ("TopicID (Operational)".equalsIgnoreCase(headerName)) {
cartItemSheet.setColumnHidden(i, true);
}