Return-Path: X-Original-To: apmail-poi-user-archive@www.apache.org Delivered-To: apmail-poi-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE2D018E3B for ; Fri, 26 Feb 2016 21:37:02 +0000 (UTC) Received: (qmail 64487 invoked by uid 500); 26 Feb 2016 21:37:02 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 64455 invoked by uid 500); 26 Feb 2016 21:37:02 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 64444 invoked by uid 99); 26 Feb 2016 21:37:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Feb 2016 21:37:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E15CF180492 for ; Fri, 26 Feb 2016 21:37:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.298 X-Spam-Level: * X-Spam-Status: No, score=1.298 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id axt1U4WKUd38 for ; Fri, 26 Feb 2016 21:37:00 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 6DF645F119 for ; Fri, 26 Feb 2016 21:36:59 +0000 (UTC) Received: from mail-wm0-f53.google.com ([74.125.82.53]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LuJDv-1ZtAjt3uo3-011mWS for ; Fri, 26 Feb 2016 22:36:58 +0100 Received: by mail-wm0-f53.google.com with SMTP id g62so86688432wme.0 for ; Fri, 26 Feb 2016 13:36:58 -0800 (PST) X-Gm-Message-State: AD7BkJLAyW9C0Gb9a5zce8kHZ/1tKLy3Fo7ERcK+fesPuAFaff6/y1EzpuDFxlnQKR4N/3UPcfizp9hXu3uj+w== MIME-Version: 1.0 X-Received: by 10.194.60.20 with SMTP id d20mr4064376wjr.109.1456522618472; Fri, 26 Feb 2016 13:36:58 -0800 (PST) Received: by 10.28.211.207 with HTTP; Fri, 26 Feb 2016 13:36:58 -0800 (PST) In-Reply-To: <56D07DFA.9040406@testingsolutions.de> References: <56D07DFA.9040406@testingsolutions.de> Date: Fri, 26 Feb 2016 22:36:58 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: How to remove XSSFTable and CTTable ? From: Dominik Stadler To: POI Users List Content-Type: multipart/alternative; boundary=047d7b86c8da4819f3052cb31903 X-Provags-ID: V03:K0:tyeqr/ICsmPp3cstiK8BzA6HqYvOFhfVjcSqYIRbukQoxqR6mf6 4mwE2mPb2tu9yDyGJjeOpDXLgM/sc1MAlnLZJJar9TCciGbu5eFZ0TtUImsAdmtk3N9/2HR o9a7rCL0jqZp7OS4W3xfWViUqJe16HFNW+NxSD+BVG9RDUR7c4gVhpO7ZnygPP4NHkyw1X8 uN2kzKxZNM1yUrANIm21Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:6U3yQvZRY8A=:8JeKJo2oCXk/6DIKblS36d RaDDzxBRycZbqNn6sxb6/MAq1zMiQ7bQNE4QCjm2gIawZQC9JEE3ovKO/CRHSqdRzjWWWb4j9 YJcNT5ZpNOlhMldL+QL7vV6NA13pP9/SrrbtOe2oyV+QLU40jgMPrl6QD4jmpnHT1shE7qI+m Q3FCK+eCSWUwG+txoEP6iBU8iHFG78io48lL6p7zFenR4BaRL8riZO1UPLmzkQLYHc6Og4jOy NQ/o/qgTjFwMjyuqiTkycg0E+1NUUkUdDnovkQqZ3AGp6zXW/wJhRiftsqpnQQAX3yZkkEIhe 8P9L9nsqY2CpJBmO7eqvT2PE75d6s8YM6Eycm0u1gOi35Hf3dgQjfrrH61CJ6BoUS2CKJtoF+ 4pq/gDKL4atuCpMDlgHG1mbNl/eKU0qiERQ8sezdv6BbJL4umcaCGQxAATO5kf+lcS6YdImDQ 9Zvm/JLVtMMABmpr9OMsFgose6pTD3zLF7PX4Qn+b1l2LTWXMNxXFq+QCIXGDHss0y9uwGHr5 QRyTHqWKn6pHHjjUZeziqKV9Fw/lhvrXVPF3DHvE0q1D5pT97fh2n1HNsTsg70UlofJBtTLay CptWkIfCcuhhubCv436yo9btJRMzCVqhsiWhitqu2HIxiNm2j1/UzZ20lfpLPjfhboh2SWg/a 0R24OTnDHO8EOLND0ItNZ1w4koNbGkSwAVJJroNre740iJTZEu9CALGNX0l8bTvP1+4SLPtWi UMcuucyjjnv+M5LIgEArQaiENKrmCOS3eQHU9ysZcJVwifh4ekypKMgvvw5mSJazmb2agsI5Y B3y2QRC --047d7b86c8da4819f3052cb31903 Content-Type: text/plain; charset=UTF-8 Hi, It should be possible to remove these pieces via the low-level POI APIs for Relationships/Parts on the XSSFWorkbook before you write out the XSLX, however I don't know the code well enough to state how exactly you would go about that. Dominik. On Fri, Feb 26, 2016 at 5:31 PM, Christian Reuter < c.reuter@testingsolutions.de> wrote: > Hi there, > > > I am working with XSSFTable and CTTable in my workbooks. > My program opens an .xlsx - template file with POI in order to delete and > recreate some of the sheets in this file and save it as a new file. > > The problem is that the deleted sheets as well as the new sheets created > programmatically may contain tables. Unfortunately if there are tables > defined in the deleted sheets they are not deleted when the sheet is > deleted. > I therefore get ID conflicts later if one of my newly created tables has > the same ids as one of the tables which have been left over from the sheet > deletions. > > The only way I see to remove the existing tables is to open the zip file > before reading it as a workbook and deleting the contents of the subfolder > "xl\tables" which contains the table definitions. > > Can somebody help me to find a better solution please? > If not: can someone provide a code snippet for the above mentioned > low-level manipulation of the file? > > Thx, > > Christian > --047d7b86c8da4819f3052cb31903--