Creating a Custom Template for Exporting Country-Specific Reports

Use this procedure if you want to export a report (that is created using the Country-Specific Reports SuiteApp) to CSV or XML format. In this procedure, you will create a custom template that will define the structure of your file export.

You can create a custom template file with any HTML or XML editor of your choice. Save the template file in HTML or XML format. In this template file, you can define the variables that you want to export into the report.

For example, you have the following variable that you want to include in the file export of a specific report:

See how this variable is included in the following sample custom templates:

Custom Template for CSV Export

Include the internal ID of the variable, the variable name and value, separated by ;. Use a delimiter for the text, such as quotation marks (""), comma (,), or semicolon (;) as such:

Internal ID; “Text”; Value

so the code looks like the following:

            1;"${VAR.VARIABLE.name}";${VAR.VARIABLE.value} 

          

Replace VARIABLE with the Cell ID of the variable. You can find the Cell ID in the variable record. To view a variable record, go to Customization > Lists, Records & Fields > Record Types, and click List next to CSR – Variable.

Using the mentioned example variable, your code should include:

            135;"${VAR.FrenchIS_FC.name}";${VAR.FrenchIS_FC.value} 

          

Custom Template for XML Export

            <?xml version="1.0" encoding="UTF-8"?>
<report>
  <cells>
    <cell>
    <title>REPORT NAME</title>
    </cell>
    <cell>
      <text>
      ${VAR.VARIABLE.name}
      </text>
      <val>
      ${VAR.VARIABLE.value}
      </val>
    </cell>
    <cell>
      <sys>
        ${‌SYS.companyname}
      </sys>
    </cell>
  </cells>
</report> 

          

Replace REPORT NAME with the title of your report.

Replace VARIABLE with the Cell ID of the variable. You can find the Cell ID in the variable record. To view a variable record, go to Customization > Lists, Records & Fields > Record Types, and click List next to CSR – Variable.

Using the mentioned example variable, your code should include:

            <cell>
  <text>
     ${VAR.FrenchIS_FC.name}
  </text>
  <val>
      ${VAR.FrenchIS_FC.value}
  </val>
</cell> 

          

After creating the custom template, you must upload the file to NetSuite. For more information, see Uploading the Custom Template for Exporting Country-Specific Reports.

Related Topics:

Exporting Country-Specific Reports
Copying reports
Viewing the report structure

General Notices