Export to mora than one excel sheet.

Hello Marvel team,
I am looking to do something related to the export of data to an excel file and I am asking if one of you has do something like the following :
I need, on a click on a button export some data to more than one sheet in the same excel file.
I looked to what askTom propose, with the sylk format:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:728625409049
and this can resolve my problem in part, with sylk I can have what I want but only in one sheet and for me it's very important that I can export to more than one sheet in the same excel file.
Thanks for any help!
Jina.

Using POI, you can create a native Excel Workbook with more than one Worksheet.
For a first step using POI follow the steps posted under:
"Export to Microsoft Excel from PLSQL Procedure"
Re: Export to Microsoft Excel from PLSQL Procedure
The following examples creates an excel with more than one sheet (and does a little bit of formating).
Load this as described above to your 10g Database and build a pl/sql wrapper function around it:
-- bof --
import java.io.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.*;
public class HelloExcel {
public static void main(String[] args) {
HelloExcel d = new HelloExcel();
d.write(null);
public static String write(String text) {
String result = "successful";
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("first sheet");
HSSFSheet sheet2 = wb.createSheet("second sheet");
// style
HSSFCellStyle style = wb.createCellStyle();
style.setFillForegroundColor(HSSFColor.LIME.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
HSSFFont font = wb.createFont();
font.setColor(HSSFColor.RED.index);
style.setFont(font);
HSSFRow row = null;
HSSFCell cell = null;
// Create a row and put some cells in it. Rows are 0 based.
row = sheet1.createRow((short)0);
// Create a cell and put a value in it.
cell = row.createCell((short)0);
cell.setCellValue(1);
cell.setCellStyle(style);
// Or do it on one line.
row.createCell((short)1).setCellValue(1.1);
row.createCell((short)2).setCellValue("This is a string 1");
row.createCell((short)3).setCellValue(true);
// Create a row and put some cells in it. Rows are 0 based.
row = sheet2.createRow((short)0);
// Create a cell and put a value in it.
cell = row.createCell((short)0);
cell.setCellValue(1);
// Or do it on one line.
row.createCell((short)1).setCellValue(1.2);
row.createCell((short)2).setCellValue("This is a string 2");
row.createCell((short)3).setCellValue(false);
// Write the output to a file
try {
FileOutputStream fileOut = new FileOutputStream("c:\\temp\\HelloExcel.xls");
wb.write(fileOut);
fileOut.close();
} catch(Exception ex) {
result = ex.getMessage();
return result;
-- eof --
hope that helps,
Willi

Similar Messages

  • Please see this post : Export to more than one excel sheet.

    Hello Marvel team,
    I have already post this question, but no answer :
    I am looking to do something related to the export of data to an excel file and I am asking if one of you has do something like the following :
    I need, on a click on a button export some data to more than one sheet in the same excel file.
    I looked to what askTom propose, with the sylk format:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:728625409049
    and this can resolve my problem in part, with sylk I can have what I want but only in one sheet and for me it's very important that I can export to more than one sheet in the same excel file.
    Thanks for any help!
    Jina.

    XML may be what you need.
    <?xml version="1.0"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:html="http://www.w3.org/TR/REC-html40">
    <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
    <WindowHeight>8580</WindowHeight>
    <WindowWidth>15180</WindowWidth>
    <WindowTopX>120</WindowTopX>
    <WindowTopY>45</WindowTopY>
    <ProtectStructure>False</ProtectStructure>
    <ProtectWindows>False</ProtectWindows>
    </ExcelWorkbook>
    <Styles>
    <Style ss:ID="Default" ss:Name="Normal">
    <Alignment ss:Vertical="Bottom"/>
    <Borders/>
    <Font/>
    <Interior/>
    <NumberFormat/>
    <Protection/>
    </Style>
    </Styles>
    <Worksheet ss:Name="sheet1">
    <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="3" x:FullColumns="1"
    x:FullRows="1">
    <Row>
    <Cell><Data ss:Type="String">This is on sheet 1</Data></Cell>
    </Row>
    <Row>
    <Cell><Data ss:Type="String">sheet1</Data></Cell>
    <Cell><Data ss:Type="String">col 2</Data></Cell>
    </Row>
    <Row>
    <Cell><Data ss:Type="String">row3</Data></Cell>
    <Cell><Data ss:Type="String">3,2</Data></Cell>
    </Row>
    </Table>
    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
    <Selected/>
    <Panes>
    <Pane>
    <Number>3</Number>
    <ActiveRow>19</ActiveRow>
    <ActiveCol>8</ActiveCol>
    </Pane>
    </Panes>
    <ProtectObjects>False</ProtectObjects>
    <ProtectScenarios>False</ProtectScenarios>
    </WorksheetOptions>
    </Worksheet>
    <Worksheet ss:Name="Sheet2">
    <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="3" x:FullColumns="1"
    x:FullRows="1">
    <Row>
    <Cell><Data ss:Type="String">This is on sheet 2</Data></Cell>
    </Row>
    <Row>
    <Cell><Data ss:Type="String">sheet2</Data></Cell>
    <Cell><Data ss:Type="String">row2</Data></Cell>
    </Row>
    <Row>
    <Cell><Data ss:Type="String">col1</Data></Cell>
    <Cell><Data ss:Type="String">col2row3</Data></Cell>
    </Row>
    </Table>
    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
    <Panes>
    <Pane>
    <Number>3</Number>
    <ActiveRow>3</ActiveRow>
    <ActiveCol>1</ActiveCol>
    </Pane>
    </Panes>
    <ProtectObjects>False</ProtectObjects>
    <ProtectScenarios>False</ProtectScenarios>
    </WorksheetOptions>
    </Worksheet>
    </Workbook>

  • Can I export (burn) more than one slide show to the same DVD

    Can I export (burn) more than one slide show I created in iPhoto to the same DVD, and if yes, how?

    Yes.  If you're using iDVD export the slideshow out of iPhoto at 480p size and drag it into an open iDVD menu window, being careful to avoid any drop zones.  iDVD can handle up to 120 minutes of playing time (movies plus menus) on a single layer DVD disk.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • Can not import excel spreadsheet with more than one spreadsheet from an email

    i get excel files sent to me all the time by email and have been able to open most of them.  Went to a apple store and was told i needed to install numbers app on my iphone 4 to open them up because their was more than likely two or more work sheets in that file. i am on the road and can't get to my imac.  I bought numbers did all the updates on the iphone and sync to itunes.  it still cant open the spreadsheets if they have more than one work sheet. it does ask do you want to open in numbers i answer the question it starts the import then get error message spreadsheet couldn't be imported.  the file format is invalid.
    this is frustrating to by an app that was suggested by apple for the solution and it doesn't work.
    by the way i have excel on the macbook pro and imac so that is not an issue need to be able to see on the phone while traveling.
    by the way it says microsoft excel 97-2004 worksheet 16 kb open in "numbers"
    Any suggestions

    Hi Caroline
    you should be able to apply the exact same principles to your multi query report. The XML will have a main root node and then the results of the queries underneath.
    So if you had 3 queries you'd get something like
    <REPORTNAME>
    <G_FIRST_QUERY>
    </G_FIRST_QUERY>
    <G_SECOND_QUERY>
    <G_SECOND_QUERY>
    <G_THIRD_QUERY>
    <G_THIRD_QUERY>
    </REPORTNAME>
    In the template you will be able to map on to the separate sections of the XML very easily.
    regards, Tim

  • How to export or delivery report for Excel for more than one sheet in OBIEE

    Hi Experts,
    How to export or delivery report for Excel for more than one sheet in OBIEE 11g? (Every time, I can only see one sheet.)
    Is it possibl to implement this requirement?
    Thanks.

    there are 2 oprions,
    One is have your tow report in a single compound layout of analysis and keep the report in dashboard and give report links.
    it will cath both your report.
    Suppose your analysis are different.
    Then you have the option of printing it to a PDF. on ritght top of Dashboard, Print - > Printable PDF.
    you ca export to PDF no to excel.
    mark if helps,
    fiaz

  • How can I download to one excel sheet from more than two table?

    Hi.
    as you know
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER='DATAPROVIDER_T1' >
    this script can make download excel sheet which is same cotents of table or chart in web template.
    but if template has more than two tables how can we get excel sheet from tables?
    <SAP_BW_URL CMD='EXPORT' FORMAT='XLS' DATA_PROVIDER_1='DATAPROVIDER_T1' DATA_PROVIDER_2='DATAPROVIDER_T2'>
    I hope this gonna work but result was fail same as I expected.
    is there any way put two tables download one excel sheet?

    Welcome to SDN.
    Post this in Business Explorer forum for quicker resposne.
    SAP Business Explorer (SAP BEx)
    Regards
    Raja

  • Importing From Excel file will not import assignments correctly where there are more than one assignment per task

    I am trying to import an excel file ... see below.   It appears if you select both Tasks and Assignments tables it will not allow you to do this, says file is not in a project recognized format.  So I import Tasks tab first then run the
    wizard again and import the assignments tab while selecting merge with project option.   This works with one exception:
    If there are more than one assignment per task.  It does not merge in the 2nd assignment, only the first.
    Is there a way to import a task with 2 or more assignments?
    Background
    To figure out what the format for the file needed to be, I started with a MPP file and from project saved as Excel and selected the "Project Template" file.  Now I am trying to import that XLS to see how it works
    ID
    Active
    Task Mode
    Name
    Duration
    Start
    Finish
    Predecessors
    Outline Level
    1
    Yes
    Auto Scheduled
    DS001
    3 days
    June 17, 2014 8:00 AM
    June 19, 2014 5:00 PM
    1
    2
    Yes
    Auto Scheduled
    MT001
    3 days
    June 17, 2014 8:00 AM
    June 19, 2014 5:00 PM
    2
    3
    Yes
    Auto Scheduled
    CT001
    1 day
    June 17, 2014 8:00 AM
    June 17, 2014 5:00 PM
    3
    4
    Yes
    Auto Scheduled
    CT002
    2 days
    June 18, 2014 8:00 AM
    June 19, 2014 5:00 PM
    3
    3
    5
    Yes
    Auto Scheduled
    DS002
    1 day
    June 20, 2014 8:00 AM
    June 20, 2014 5:00 PM
    1
    6
    Yes
    Auto Scheduled
    MT002
    1 day
    June 20, 2014 8:00 AM
    June 20, 2014 5:00 PM
    2
    7
    Yes
    Auto Scheduled
    CT003
    1 day
    June 20, 2014 8:00 AM
    June 20, 2014 5:00 PM
    4
    3
    Task   Name
    Resource Name
    % Work Complete
    Work
    Units
    CT001
    Engineer1
    0
    8h
    100%
    CT002
    Engineer2
    0
    16h
    100%
    CT003
    Engineer1
    0
    8h
    100%
    CT003
    Engineer2
    0
    8h
    100%
    Andrew Payze

    Andrew,
    I did a quick test using your example although I didn't include the Predecessor or Outline Level fields to keep things a little simpler. I imported the Excel data into a new Project file with a single import of task and assignment data. It is very important
    to set up the Excel Workbook correctly. On Sheet 1 I entered the task data (Name, Duration, Start). I did not include the ID or finish date as that is redundant - Project generates its own ID and will calculate the finish date based on the start date and duration.
    On Sheet 2 I entered the assignment data basically just as you show it except I didn't include the Units.
    The data imported as expected.
    John

  • When I open an event, including flagged items, the photos appear one by one, not as thumbnails, so I can't export more than one phot at a time. How do I get iPhoto to show the thumbnails?

    When I open an event, including flagged items, the photos appear one by one, not as thumbnails, so I can't export more than one phot at a time. How do I get iPhoto to show the thumbnails?
    I've tried rebuilding the thumbnail database, but that hasn't helped.

    What version of iPhoto and system are you running?
    Try moving the Zoom slider at the bottom of the iPhoto window all the way to the left.  Does that let more than one photo display in the window?
    OT

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • How do I select more than one photo for a contact sheet

    I am trying to print more than one photo per contact sheet (to save photo paper!) Iphoto help says to select the photos you want on the contact sheet and also to select how many photos you want on the "options" button on the contact sheet style selection. I cannot find either option in Iphoto.
    Thanks in advance,

    Before you select "Print," hold down the shift key and click on each photo that you want on the contact sheet.
    Then select "Print" with Style "Contact Sheet." The resulting window allows you to select the quantity of contact sheets that you want to print.

  • How can i place more than one photo on the print sheet

    im trying to place more than on photo on a sheet of photo paper, how do I do this

    There are basically two ways of using multiple iPods on a computer and these involve:
    a) Sharing a single iTunes library and user account.
    b) Creating multiple user accounts and having separate libraries.
    Sharing a Library
    If you want to share the one library, you can set either or all of the iPods so that they only get updated with only certain playlists (you can update from more than one if you wish):
    Loading songs onto iPod automatically - Windows
    Choosing the update option "Sync Music - Selected playlists" allows you to create a playlist specifically for the iPod and drag the tracks you want into it. If you tire of the list and want to change it, you just add or remove the songs you don't want. The ones you take out out remain in the library to be used some other time if you choose. You can read more about playlists at these links:
    iTunes: Creating playlists of your favorite songs
    How to create a Smart Playlist with iTunes
    However since you seem to have a problem with that method you can choose to update any or all of the iPods manually and just drag whatever content you want to them: Managing content manually on iPod
    Separate User Accounts
    Another option is to create a separate User account for each person on your PC or Mac. Different accounts by definition would give you completely separate libraries. Each account has it's own iTunes folder, Library and iTunes Music folder and you load it with CDs etc just as you did with your original one. The iPod can be set to update however the owner chooses, sync all, manual or sync specific playlists
    If you are unfamiliar with setting up Windows user accounts you can read more here: Using Windows XP User Accounts

  • Is there a way of setting up one more than one export preset to a funcion key?

    Hi
    is there a way of setting up Lightroom to export images in using more than one export preset at one time? When I have edited my photos I very often want to create a full res JPEG to upload to Zenfolio with no watermark, a medium res JPEG to go to Flickr and a 1500px image with a watermark for Facebook (I normally upload these last). I'm hoping Lightroom would also have a an option to set Function keys to trigger export presets for example.
    I'd like to be able to stack export presets to help with my workflow.
    Thanks
    Jon

    robcole.com - ExportManager
    does what you want, as long as you don't need post-process actions in your export preset(s).
    plugin | free | I wrote it..

  • Lightroom won't export more than one image at the time

    I am having trouble exporting my RAW files as JPEG files. At first Lightroom 4.4 seemed to skip certain photos when exporting and now I'm unable to export more than one image at the time. How can I fix this? I didn't seem to have this problem before the 4.4 update, but then again, the 4.4 update has been running for a few days now. I run on a 32bit Windows 7 with 4GB of RAM.
    Lightroom has also been a considerable lot slower since the last couple of days, yet there have been no changes at all to my computer or system or anything - nothing's changed expect for the fact that Lightroom isn't behaving as it used to.
    Can anyone help me?

    I think I've found the problem - I've accidentally 'synced' my folder instead of importing the RAW files. Which brings me to my next problem and question - I've already edited the RAW files and would really like it if there's a way I could re-import the files without losing my changes/metadata, is there anyway that's possible?

  • Why does iPhoto (9.0/11) not retain the Event name when exporting more than one event? (using File - Export - Album name with number).

    Why does iPhoto (9.0/11) not retain the Event name when exporting more than one event? (using File -> Export -> Album name with number).
    Exporting a single Event retains the Event name which is what I'd expect. But highlighting more than one event and exporting it renames the images to Events 001.JPG, Event 002.JPG etc.
    I was recently on holidays and had all my events nicely split on Dad's computer but when I went to export it I couldn't retain any of this information. Now I have to replicate this all again on my computer.
    It wasn't possible to export the entire library as the external drive was fat32 format an I didn't want all of it. It would be nice to export a bunch of events to someone and have it retain the name.
    Does anyone have a work around or will this be fixed at some point by Apple?

    Why does iPhoto (9.0/11) not retain the Event name when exporting more than one event? (using File -> Export -> Album name with number).
    Exporting a single Event retains the Event name which is what I'd expect. But highlighting more than one event and exporting it renames the images to Events 001.JPG, Event 002.JPG etc.
    I was recently on holidays and had all my events nicely split on Dad's computer but when I went to export it I couldn't retain any of this information. Now I have to replicate this all again on my computer.
    It wasn't possible to export the entire library as the external drive was fat32 format an I didn't want all of it. It would be nice to export a bunch of events to someone and have it retain the name.
    Does anyone have a work around or will this be fixed at some point by Apple?

  • TableSorter over more than one columns like Excel

    Hi Experts,
    do you have a example for TableSorter over more than one columns like Excel?
    Thank you very much.
    regards
    Steffen

    Hey,
    Please download the application mentioned in it.
    When i have excuted the application i could find sort enabled for all the columns.
    wdContext.currentContextElement().getTableSorter().sort( wdEvent, wdContext.nodeTableSet() );
    Please check it..
    Jithin
    Edited by: jithin james on Apr 16, 2009 10:47 AM

Maybe you are looking for

  • Claim Digger in P6

    When I used Claim Digger for P3, I was able to see the number of activities that missed their start or finish. The new, "integrated" versio in P6 is missing this feature. Your knowledgebase indicates that this is an "enhancement request". My question

  • How to create a webservice for sap transaction?

    Hello All,               I developed a custom program and created a transaction for that? Is it possible to create a webservice for this custom transaction  ? If yes,how should we ?  I have seen many documents which all describing to creartion of web

  • Download vs. retail

    I live overseas and just downloaded the trial version of Iworks 09. I have decided to buy it but have a question about whether to buy the retail or just pay for a serial number from the apple site. When I went to the buy site from the program it gave

  • Getting data from two servers?

    Experts- We have two servers for storing tables . 1. Historical server 1.Current Prod server We have same tables in both server databases. All the info prior to a month of current date is stored in Historical server database tables and the rest in cu

  • UserInteractionLevels is undefined

    Hello All, While exporting Indesign INDD file to INX file on CS3 Server using javascript (.jsx) I got following error... Error Number: 2 Error String: UserInteractionLevels is undefined Line: 12 Source:         app.scriptPreferences.userInteractionLe