Return-Path: Delivered-To: apmail-poi-user-archive@www.apache.org Received: (qmail 29604 invoked from network); 18 Jun 2007 11:14:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 11:14:54 -0000 Received: (qmail 78491 invoked by uid 500); 18 Jun 2007 11:14:55 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 78473 invoked by uid 500); 18 Jun 2007 11:14:55 -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 78458 invoked by uid 99); 18 Jun 2007 11:14:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 04:14:54 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [151.136.186.138] (HELO wgate2.mro.man.de) (151.136.186.138) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 04:14:50 -0700 Received: from wgate2.mro.man.de (localhost [127.0.0.1]) by wgate2.mro.man.de (8.13.8/8.13.8) with ESMTP id l5IBESd2030296 for ; Mon, 18 Jun 2007 13:14:28 +0200 (CEST) Received: (from localhost) by wgate2.mro.man.de (MSCAN) id 3/wgate2.mro.man.de/smtp-gw/mscan; Mon Jun 18 13:14:28 2007 Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3959 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Import into Access Fails Date: Mon, 18 Jun 2007 13:14:15 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Import into Access Fails Thread-Index: Acexmc69CfnwOWJNQoO/KEKITjXhcg== From: To: X-Virus-Checked: Checked by ClamAV on apache.org I have the following test program that generates one XLS-Sheet with two columns and one with three columns. If I try to import this XLS into Microsoft Access 2003 (File > Get External Data > Import) for the sheet with the even count of column only the first column is shown in the Access dialog listing the data to be imported. For the sheet with the odd count of columns all three columns are shown. Is this bug in my program, in poi or in the import of access? If i open and save the generated XLS with Excel, i do not have a problem to import the file in access. It seems POI writes an XLS that can not correctly be imported from Access. import java.io.File; import java.io.FileOutputStream; import org.apache.poi.hssf.usermodel.HSSFRichTextString; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class Main { /** * @param args */ public static void main(String[] args) { HSSFWorkbook workbook =3D new HSSFWorkbook(); HSSFSheet sheet; HSSFRow row; =20 =20 sheet =3D workbook.createSheet("test_even"); row =3D sheet.createRow(0); row.createCell((short)0).setCellValue(new HSSFRichTextString("rc=3D00")); row.createCell((short)1).setCellValue(new HSSFRichTextString("rc=3D01")); row =3D sheet.createRow(1); row.createCell((short)0).setCellValue(new HSSFRichTextString("rc=3D10")); row.createCell((short)1).setCellValue(new HSSFRichTextString("rc=3D11")); =20 =20 sheet =3D workbook.createSheet("test_odd"); row =3D sheet.createRow(0); row.createCell((short)0).setCellValue(new HSSFRichTextString("rc=3D00")); row.createCell((short)1).setCellValue(new HSSFRichTextString("rc=3D01")); row.createCell((short)2).setCellValue(new HSSFRichTextString("rc=3D02")); row =3D sheet.createRow(1); row.createCell((short)0).setCellValue(new HSSFRichTextString("rc=3D10")); row.createCell((short)1).setCellValue(new HSSFRichTextString("rc=3D11")); row.createCell((short)2).setCellValue(new HSSFRichTextString("rc=3D12")); =20 FileOutputStream os; try { os =3D new FileOutputStream(new File("C:/temp/test.xls")); workbook.write(os); os.close(); } catch (Exception e) { e.printStackTrace(); } } } Regards Christian Christian Echerer Abt.: RAEM Dipl.-Inf.(FH)=20 MAN Roland Druckmaschinen AG Vorsitzender des Aufsichtsrates: Hanno C. Fiedler Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus = Rall, Paul Steidle =20 Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht = Offenbach HRB-Nr. 42592 =20 USt-Ident-Nr. DE 250200933 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org