• If you are using xlsx files, there is a way that is not too difficult if you are methodical...

    • Create your template file with formatting and some sample data.
    • Use your favourite zip tool (I like 7zip) to unzip the XLSX file (it is a zip archive that contains xml files)
    • Navigate to the xl\worksheets folder to find the xml file for your worksheet(s)
    • e.g. Sheet1.xml

    • Study the xml. You will see it contains a "sheetData" section which contains your sample data
    • <sheetData>

      <row r="1" spans="1:4" x14ac:dyDescent="0.25">

      <c r="A1" t="s">

      <v>0</v>

      </c>

      <c r="B1" t="s">

      <v>1</v>

      </c>

      <c r="C1" t="s">

      <v>2</v>

      </c>

      <c r="D1" t="s">

      <v>3</v>

      </c>

      </row>

      <row r="2" spans="1:4" x14ac:dyDescent="0.25">

      <c r="A2" s="4" t="s">

      <v>4</v>

      </c>

      <c r="B2" s="3" t="s">

      <v>5</v>

      </c>

      <c r="C2" s="2">

      <v>4441234</v>

      </c>

      <c r="D2" s="1">

      <v>24883</v>

      </c>

      </row>

      <row r="3" spans="1:4" x14ac:dyDescent="0.25">

      <c r="A3" s="4" t="s">

      <v>4</v>

      </c>

      <c r="B3" s="3" t="s">

      <v>5</v>

      </c>

      <c r="C3" s="2">

      <v>4441234</v>

      </c>

      <c r="D3" s="1">

      <v>24883</v>

      </c>

      </row>

      </sheetData>

    • Each "row" element represents a row in your sheet.
    • Each "c" element represents a cell in the row
    • The "r" attribute is the cell address
    • the t="s" attribute tells Excel the cell contains a "Shared String" - read up on these - if you have a lot of repeating values you can use these to save space in the file. For Shared Strings, the "v" node contains the Shared String number.
    • The "v" element is the cell value (or shared string number)
    • Now all you have to do is reproduce the "Sheet1.xml" file in SSIS / SQL Query and then zip your new file along with the other supporting files back up into a new XLSX file that has all your original formatting

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]