Create w boutton in cell excel with vbnet help plzzz

how to create a buttons for ech cell exactly 4 cell (browse) to import a value in cell of excel file (from 4 excel file) imported in datagridview vb net
all the work at vb net and in the datagridview

Hi moOTAZ,
Your question is not clear enough. Please give us some detailed information.
If you want to use VB.NET application to export the data in DataGridView control to the Excel files, then you have many options.
1. Use Excel PIA, loop through all the cells in the DataGridView control, get the cell value you want to export, use Microsoft.Office.Interop.Excel namespace to create a new Workbook, add a new Worksheet then save the cell value in this Worksheet. The sample
code here:
Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim xlWorkBook As Microsoft.Office.Interop.Excel.Workbook
Dim xlWorkSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
Dim i As Integer
Dim j As Integer
xlApp = New Microsoft.Office.Interop.Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("sheet1")
For i = 0 To DataGridView1.RowCount - 2
For j = 0 To DataGridView1.ColumnCount - 1
For k As Integer = 1 To DataGridView1.Columns.Count
xlWorkSheet.Cells(1, k) = DataGridView1.Columns(k - 1).HeaderText
xlWorkSheet.Cells(i + 2, j + 1) = DataGridView1(j, i).Value.ToString()
Next
Next
Next
xlWorkSheet.SaveAs("D:\vbexcel.xlsx")
xlWorkBook.Close()
xlApp.Quit()
2. Use OleDb to insert data into Excel
Check the tutorial in this KB article:
How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET
3. Use OpenXML SDK if you don't have Excel application installed on the machine
Manipulating Workbooks using the Open XML SDK
4. How to import data from Excel to DataGridView control? Check this thread:
how to import data from excel sheet
in data grid view using vb.net
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse

    Hi,
    I followed the amazing SAPUI5 blog :
    How to create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse
    I was able to resolve all errors mentioned in this blog but then i get another error :
    Uncaught TypeError: Cannot read property 'dataServices' of undefined
    Any idea what is the problem.
    Thanks a lot!
    Amina

    Hi,
    I followed the amazing SAPUI5 blog :
    How to create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse
    I was able to resolve all errors mentioned in this blog but then i get another error :
    Uncaught TypeError: Cannot read property 'dataServices' of undefined
    Any idea what is the problem.
    Thanks a lot!
    Amina

  • Wanna compare data in excel with real time signal

    Hi,
     my application is to check the PCB i/o pins... first i have to corresponding signal to every pin in GOOD PCB board and the output of each pin should saved in excel with the help of write to spreadsheet.. then the database be act as master for other PCB boards..
    If i wanna check the other pcb board means the same corresponding signals should be send to the each pin of the PCB board.. the Output received from the board should check with the data already saved in the database if it is match's means Status LED should Glow otherwise its not to glow...
    pls help me to finish this application.. i have attach model vi with post and excel too....
    Regards,
    N. Srinivasan
    Solved!
    Go to Solution.
    Attachments:
    PCB_COMPARING.vi ‏184 KB
    DATABASE.xls ‏2 KB

    The "method" you have in your last post doesn't come anywhere near to what you say you want to do.
    It creates a simulated sinewave and writes it to a text file.  Waits 1/10th of a second, reads it back from that text file, does a lot of manipulation to that data to convert it to a dynamic waveform type.  Then compares it to another simulated sinewave to say if they are equal or not.
    "My doubt is if all the received signal are saved in the excel sheet first..".  I don't know why you would doubt that this would happen.  If you receive a signal and write it to the text file, then why don't you believe it would be written to a text file?  By the way, the Read from Spreadsheet File and Write to Spreadsheet File functions have nothing to do with Excel.  They read or write data to a text file that happens to be formatted in a way (delimiters between data in a row, end of line characters between rows) that is a text file version of a spreadsheet.  Excel has the ability to import from or export to a text file, but that file is NOT an Excel file.
    You have major portions of your code missing and questions to be answered.
    Where are you actually outputing a signal to the printed circuit board?
    Where are you actually receiving a signal from the printed circuit board?
    Are you receiving one signal or 40 signals?
    What type of DAQ board are you using to do this?
    Okay, let's say once you have the first portion of your code set up to do that, you can write the data to a text file.
    Now in another part of your code, you basically repeat the procedure but instead of writing to a text file, you read the data from your "good board" text file and compare the two.
    How do you compare the signals and determine whether the newly read signal is good or bad?  Right now, you are doing a comparison for equality.  Do you think the "good" signal and the newly test signal will ever be equal?  Even if you just repeat the test on the good board, do you think those signals will be equal?  NO.  It is impossible for the signals to ever be equal, even the slightest variation in the signal is going to make them unequal.  You are never going to measure identical real world signals identically.  You need to come up with some comparison algorithm with criteria that determines whether another good signal actually matches your saved good signal, and a bad signal does not match the good signal taking into account the variations you inevitably get when measuring real world signals.
    Those are big questions you need to answer.  Assuming you work all that out, on paper in a design specification document, only then can you start worrying about the LabVIEW program and its architecture.  Ultimately, a state machine architecture will be your likely choice as you have multiple states to work with.  Initialize, test board, save data to file, read data from file, compare data, possibly more states such as wait, close program, multiple states within the test board process as it is probably a multiple step process.

  • Acrobat X Pro - create PDF from Excel with no margins...ARGH!

    Hello all,
    Does anyone know if it's possible to create a PDF from a selection of Excel cells without a margin appearing on the PDF file? Even if I set the print margins (print to Adobe PDF) to zero, Acrobat still puts in margins in the PDF. The background of the Excel file is black (as specified by my manager), and he wants black all the way to the edges of the PDF page.
    I have to submit this weekly, and as it's several pages long I don't want to be faffing about with the crop tool each Monday morning (it already takes long enough to source the data). The current solution I have been given is to create a template in Powerpoint (HATE) and link the cells/graphs, but and paste any text boxes, and then convert from Powerpoint to PDF, as no margins are imposed this way.I know cropping would be quicker than this, but surely in this day and age it's easily possible and there's just some simple option I'm just missing?
    Regards,
    George

    I have the same setup with Win 7 and Office 2010 and have created thousands of PDF from Excel sheets, but never noticed this particular issue.  Regardless, rather than fight an issue like this where no specific documentation exists, I usually resort to other options in the interest of not getting bogged down in a maddening search for answers. 
    Go ahead and convert to PDF so that your links are retained, etc.  Open the resulting file in Acrobat, and use the crop tool to remove the blank margins that are at issue, either maintaining proportionality or not, depending on your needs, making sure to set the cropping tool to apply the scheme to all pages.  I'm assuming that all pages are formatted the same, such that this strategy will work.  Then, apply the cropping, and sanitize the file to remove the cropping data.  At this point, your blank margins should be completely gone, and the file can be scaled for printing if that is your objective, but that will obviously introduce some white margins again at the printer.
    The only other option I'm aware of to address this from the PDF side is via a third-party plug-in from Evermap called AutoPagex.  One of its features allows you to scale a document's content to the page margins, either maintaining proportionality or not.  Without proportionality, I was able to scale an Excel sheet with black background to all but a tiny sliver of the top and bottom margins in landscape orientation.  From here, I scaled the content via an additional feature to 100.5%, and all white margins were gone.  That said, it probably just as effective to accomplish this via the crop tool, assuming the page formatting remains consistent.        
    Disclosure:  I have no affiliation of any kind with Evermap, but did address the use of several of their products in my book, "The PDF Litigation Guide."
    Hope that helps!
    Jason Covey
    PDF Litigation Solutions, LLC
    www.pdflitigationguide.com

  • How to create Links in a cell  to other Excel docs Cell  in Planning layout

    Hi All,
    I have a requirement to replace an existing forecasting process using normal Excel with BPS with Excel in place. One difficulty I came across is that the existing Excel input template has cells with links to many other excel files so users does not to open all other Excel documents and copy and paste the figures in.
    I am stuck on replicate this function in BPS as I cannot create links to to other  Excel directly in a cell in BPS Excel layout. My initial idea is to create a Macro to copy the data across but in deeper thought this might not be the best solution as the number of excel link can be a lot and the name and location of these files might change quite frequently and I cannot hard code it in the macro..
    Any ideas?
    Thanks.

    Hi Marc,
    The reason to use BPS is once the data is in the layout, we need to run the data in a  true forecast / simulation model (i.e. compare actuals, copy data between differnt planning versions, Foreign Exchange rate planning , allocation, revaluation, etc...) on a different hierarchy level.
    The problem is the starting point data is scattered in lots of other Excel file from local drives from different users. I guess this is the same reason why the csv file upload technique exist, (i.e. to load data to the layout )but in my case the data location needed to be very dynamic and comes from large / different source of data.
    I have now developed a solution to reference data from cells in different Excel sheet to the layout. Once set up, it should be able to save users significant amount of time to bring the base data into the layout, especially if their data is source from many ither Excel files.
    Regards,
    Danny

  • Create a check box in excel cell  using sap abap

    Dear Sap Master's,
    Please give me some idea on  how to create a check box in excel cell using abap program..
    (OLE concept).
    Thanks
    Moderator message: please search for available information first.
    Edited by: Thomas Zloch on Jan 12, 2012

    select the cell then open the cell formatter:
    process should be similar in the iOS version.  I do not have any iOS devices with Numbers so I cannot check.  I did find this link that may help:
    http://support.apple.com/kb/PH3374?viewlocale=en_US

  • Export to excel with formatting was autowrapping text in a cell

    Export to excel with formatting was autowrapping text in a cell without having to check the can grow option.  When the can grow option is checked it does wrap the text however it spans multiple rows, which causes complications when trying to sort. 
    It worked in:
    ProductVersion=10.0.0.533
    ProductName=Crystal Enterprise 10 Embedded
    Doesnt work in:
    Crystal Reports 10.0 Service Pack 6
    After the upgrade the reports did not autowrap, b/c the "can grow" option was not checked.  I believe this was fixed by "ADAPT00305137 Patch ID: 36479914
    Description:
    When users export to Excel 97-2000 with the page-based format, text fields are wrapped, even when the "can grow" feature in the
    Designer is turned off." .   After we turn the option to grow on it does wrap however it spans across multiple rows.  So I guess my question is there a way for it not to span multiple rows when wrapping text?
    Edited by: dforde on Jan 27, 2010 11:12 PM

    I could be wrong, but I believe the export to excel option exports the database values, and the export to HTML exports the values seen in the sheets. If the database values are stored as seconds, the Excel will see them as seconds, and the data will have to be formatted properly in Excel.
    I haven't toyed around with Excel exports that much, but it might be possible to set up a template or macro in excel that would have the proper formatting, and use it when opening the Disco export.

  • I am using report generation toolkit 1.1 with Labview 7.0 and Office 2003 profession​al. The create new report VI opens Excel but throws error (-21471672​62- from automation open VI) when I try to open MS word. please help...

    I am using report generation toolkit 1.1 with Labview 7.0 and Office 2003 professional. The create new report VI opens Excel but throws error (-2147167262- from automation open VI) when I try to open MS word. please help...

    Hi Leo22,
    Does this error occur if you use any of the example programs that come shipped with LabVIEW? I would try opening one of the examples that write data to Word and see if those give you an error. Also, have you tried just putting down a New Report.VI and change the report type to Word? If this simple vi (that's all you need to open Word) breaks, I would check to see if there are any instances of Word still open. Check the task manager to see if any word processes are still open. There should not be a problem accessing Word 2003 from LabVIEW 7.0. If neither of these solutions work, please give some more detail about your application and we can research further. Thanks!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

  • How to create rtf template to view report in Word and Excel, with numeric f

    Hi,
    Please help me!
    How to create rtf template to view report in Word and Excel, with numeric formatted fields (like this 999 999 999,99 with spaces between numbers) and then end user be able to process those fields with Excel tools (sum, etc).
    Thank you.

    From what I have seen Excel can not handle 999 999 999.00. You can use 999999999.00 and then format it as you want in the xls bt you can not have values like 999 999 999.00 coming from publisher output and have functions on the values in Excel
    Tim

  • Quickly fill in blank cells (Excel equivalent)?

    I often import reports from Quicken into Numbers to create data tables for analysis purposes and find that I must fill in blank cells to ensure I have data consistency across rows.
    While I am confident there is no built in way for Numbers to quickly populate these blank cells, I am asking here if AppleScript has the potential of providing the means. 
    The following link gives insight into how it is done with Excel. Does the AppleScript library provide the tools for something similar?
    http://www.techrepublic.com/blog/microsoft-office/quickly-fill-blank-cells-in-ex cel/
    -DaverDee

    Again SGIII, more than I expected.  Thank you.
    A zero is treated like an empty cell.  It is overwritten with the previous non zero valued cell.
    Lastly, so that I understand what you provided, I inserted comments for each line of code.  Would you please look over my comments to confirm that I get it?
    My problem with learning AppleScript is that while I think I understand the code while reading it, I don't know the AppleScript vocabulary to create the code myself.
    -DaverDee
    Tells…
    —From the selected range, in a table, on a sheet, in a document, within Numbers...
    — Set the variable ‘pv’ to null.
    set pv to ""
    — Begin a loop starting from the initial cell in the selected range.
    — Define ’c’ as value in the current cell.
    repeat with c in cells
    — Copy the value of the current cell to the variable ‘v’.
    set v to c's value
    — If the current cell value stored in the variable 'v' is not zero, then copy the value 'v' to the variable 'pv'.
    if v is not 0 then set pv to v
    — Otherwise, set the cell value defined by 'c' to be the value stored in 'pv'.
    --Note: If nothing has been stored in 'pv', as in the case when 'v' is zero which occurs if zero or null is the first cell value in the selected range, then the cell is populated with a blank.
    else set c's value to pv
    —Close the If.
    end if
    —Close the repeat loop.
    end repeat

  • Create a value for Decision table with gc_option_not_initial.

    Dear Expert,
    I am filling in a decision table with coding. I load an excel file, create a range for eatch value with the folling method:
       cl_fdt_convenience=>create_simple_range( EXPORTING iv_application_id = lv_application_id
                                                                                  iv_option = if_fdt_range=>gc_option_equal
                                                                                  iv_test_parameter = lv_id
                                                                                  iv_low = lv_value
                                                                                  iv_activate = abap_false
                                                                        IMPORTING ev_range_id = ls_table_data-expression_id ).
                INSERT ls_table_data INTO TABLE lts_table_data.
                CLEAR  ls_table_data-expression_id.
    But the following code is not working:
       cl_fdt_convenience=>create_simple_range( EXPORTING iv_application_id = lv_application_id
                                                                                  iv_option = if_fdt_range=>gc_option_not_initial
                                                                                  iv_test_parameter = lv_id
                                                                                  iv_activate = abap_false
                                                                        IMPORTING ev_range_id = ls_table_data-expression_id ).
                INSERT ls_table_data INTO TABLE lts_table_data.
                CLEAR  ls_table_data-expression_id.
    What is wrong?
    How to create than a range for a decision table cell with option: 'not initial'?
    Thank you very much in advance?
    Best regards
    Ahmed

    I found the same problem in the comments of this post Filtering Rules using SAP HANA Decision Table.
    A possible solution is to implement a solution directly in SQLScript. Hints can be found in Filtering Rules using SAP HANA Decision Table

  • Read Excel with macros using Java POI

    Hi,
    I'm very desperate... I have to do following things: read Excel file with macros. I can read xls without macros, but i haven't ideas what to do, so correctly read records with macros in xls.
    I use following method to listen for incoming records and handles them as required.
    public void processRecord(Record record)
    switch (record.getSid())
    // the BOFRecord can represent either the beginning of a sheet or the workbook
    case BOFRecord.sid:
    BOFRecord bof = (BOFRecord) record;
    if (bof.getType() == bof.TYPE_WORKBOOK)
    System.out.println("Encountered workbook");
    // assigned to the class level member
    } else if (bof.getType() == bof.TYPE_WORKSHEET)
    System.out.println("Encountered sheet reference");
    break;
    case BoundSheetRecord.sid:
    BoundSheetRecord bsr = (BoundSheetRecord) record;
    System.out.println("New sheet named: " + bsr.getSheetname());
    break;
    case RowRecord.sid:
    RowRecord rowrec = (RowRecord) record;
    System.out.println("Row found, first column at "
    + rowrec.getFirstCol() + " last column at " + rowrec.getLastCol());
    break;
    case NumberRecord.sid:
    NumberRecord numrec = (NumberRecord) record;
    System.out.println("Cell found with value " + numrec.getValue()
    + " at row " + numrec.getRow() + " and column " + numrec.getColumn());
    break;
    // SSTRecords store a array of unique strings used in Excel.
    case SSTRecord.sid:
    sstrec = (SSTRecord) record;
    for (int k = 0; k < sstrec.getNumUniqueStrings(); k++)
    System.out.println("String table value " + k + " = " + sstrec.getString(k));
    break;
    case LabelSSTRecord.sid:
    LabelSSTRecord lrec = (LabelSSTRecord) record;
    System.out.println("String cell found with value "
    + sstrec.getString(lrec.getSSTIndex()));
    break;
    case FormulaRecord.sid:
    FormulaRecord fre = (FormulaRecord) record;
    System.out.println("Formula: "+ fre.getValue());
    break;
    I don't know, how check, that incoming record is joined with macro and I don't know how handle it.
    Is there possible to create Excel file with macros using POI?
    Please help me...
    Margaret

    I want to read the contents of an MS Excel file from
    java, is it possible using JavaBeans-ActiveX bridge or
    by any other java technologies, if possible, how ?Bridge2Java from IBM Alphaworks will do the trick for you.
    You can get it from here:
    http://www.alphaworks.ibm.com/aw.nsf/techs/bridge2java
    Using it, you can do things like the following (taken and abbreviated from the samples provided with the package):
    import Excel.*;
    public class QuickExcel
        public static void main(java.lang.String[] args) {
            Application app;
            Workbooks wbs;
            Workbook wb;
            Worksheet sheet;
            Range rangeA1, rangeA2;
            try
                com.ibm.bridge2java.OleEnvironment.Initialize();
                app = new Application(); // Excel.Application !!! :-)
                app.set_Visible(true);
                wbs = app.get_Workbooks();
                wb = wbs.Add();
                sheet = new Worksheet(wb.get_ActiveSheet());
                rangeA1 = sheet.get_Range("A1");
                String out = new String("This is a test");
                rangeA1.set_Value(out);
                // Wait five seconds
                Thread.sleep(5000);
                // Close the workbook without saving
                wb.Close(new Boolean("false"));
                app.Quit();
            } catch (com.ibm.bridge2java.ComException e)
                System.out.println( "COM Exception:" );
                System.out.println( Long.toHexString((e.getHResult())) );
                System.out.println( e.getMessage() );
            } catch (Exception e)
                System.out.println("message: " + e.getMessage());
            } finally
                app = null;
                com.ibm.bridge2java.OleEnvironment.UnInitialize();
    }

  • Using Excel with Visual C++ 6.0 (need a graph control that behaves as much like the one in CVI as possible)

    I hate to beat this to death but I was unable to find a
    clear answer to this question.  Does NI provide Excel control from within
    Visual C++ 6.0? 
    I read that NI supports the ANSI-C library only for Visual C++ 6.0 users:
    Thread : "Re: Benifits of using measurment
    studio for VC++ 6.0?"
    NI REP : drohacek
    Quote  : "we made the decision to support Visual
    C++ 6.0 users only through the ANSI-C interface and not through the Measurement
    Studio MFC-based class libraries."
    If there is a suggested way of controlling Excel from within Measurement Studio
    for Visual C++ 6.0 then I’d love to know it. 
    If not, can a plain statement be made basically stating that if you want
    to control Excel you can’t use a Visual C++ 6.0 environment even with Measurement
    Studio support?
    With .NET of course you can just decide to have Excel support added during
    project creation.  CVI can act as an ActiveX server and easily control
    Excel just by building off the examples shipped with CVI.  I see that
    there is support, using the Measurement Studio for Visual C++ 6.0 Project Wizard,
    for taking existing CVI projects and converting them to Visual C++ 6.0 projects
    or for calling CVI libraries from a .dll from within Visual C++ 6.0.  I suppose I could do the work
    in CVI and then convert the project but I'm so deeply tied into all my MFC calls that I don't see
    how I can cleanly include the CVI libraries into my existing VC++ 6.0 projects.
    What I'm really after here is a visual graph control like the one in CVI that I
    can use from Visual C++ 6.0.  I purchased a 3rd party graph control for use
    in VC++ 6.0 that works well but isn't really visual.  I mean you can't
    enter any values in it until you run the program and fill it out programmatically. 
    Then you can see which columns are two narrow, quit the program, adjust the
    column width of your now empty control, and repeat, until you get the thing
    looking the way you want.  If I could call into Excel from within Visual
    C++ 6.0  the way I do from within .NET
    then I could use Excel to hold the table and just read in the values into my table
    control at run time.  Basically I'd use Excel as a visual development tool
    for all my tables.
    I do all my coding from within CVI and Measurement Studio for Visual C++
    6.0.  I'd use CVI for everything if I didn't depend so heavily on certain
    outside controlled C++ .dll's.  Could you please suggest then what I can
    do to get Excel support for Visual C++ 6.0?
    Last question :
    Is there any plan to ever have a NI table control like the CVI table control for
    use in Visual Studio?  One that you can
    completely set up before you do any compiling? 
    I imagine that the way Microsoft sets up their environment makes this idea impossible.  Otherwise someone would
    have come up with a truly “visual” table control before now.
    Thanks,
    Grant
    Grant M. Johnson
    Project Engineer
    LECO Corporation

    Hello Grant
    You can most certainly use Excel with VC++ 6.0. Measurement Studio won't provided you with any classes to talk to Excel in VC++ 6.0. This is because Excel allows control via Automation and you can use its automation API to do anything you need with Excel. This is what CVI uses as well.
    You can see this MSDN article on how to set this up. This mentions VC.NET, but it should work the same way.
    Here is one that talks about VC 6.0 and Excel.
    Here is a code project article about this.
    Even with .NET, you have to do thru the Excel Automation support. Excel started shipping with Primary Interop Assemblies (PIA) which are .NET wrappers about the Excel Automation object model. C++ Automation is definetely not as nice as .NET, BTW
    See this document for more information about the Excel object model.
    I would not recommend using the CVI Excel libraries if all you want to use them for is Excel automation. You will end up creating un-necessary dependencies and go through extra layers that way. You can make calls straight to Excel from VC++ without requiring CVI.
    One quick observation about your excel approach. If you decide to use Excel as your table, you might be requiring everyone who uses your application to have Excel installed on their machines. Just wanted to make sure this was acceptable to you.
    Have you looked at the Datagrid Activex control, which is one of the common controls that ships with Visual Studio? You can add it to Visual Studio by right-clicking and picking it from the list of installed activex control. If you have not already, you should check it out.
    Microsoft has made significant improvements in the number of controls they provide with .NET. They have a Datagrid control that seems to be what you need.
    Measurement Studio did add some high level classes for Excel and Word Automation that simplify some common tasks, but these exists for VS 2003 C++ and VS 2005 C++, not for VC 6.0. Underneath, we end up using the same Excel automation classes, so you can easily setup something similar for VC 6.0. Plus you can find alot of references online on how to use the Excel Automation object model with C++.
    We currently have no plans in Measurement Studio to create a table control unfortunately. I am assuming when you said graph, you actually meant table, since Measurement Studio already  provides a ActiveX graph controls for VC++ 6.0 that is very similar to the CVI graph.
    On a side note, VC++ 6.0 is really really old. Have you considered upgrading?
    To summarize
    - Yes, you can use Excel with Vc++ 6.0 without mstudio.
    - Try using the Datagrid Activex control if you just need a table.
    - Measurement Studio provides high-level excel and word classes for VC++ 6.0
    - Measurement Studio provides a graph control for VC++ 6.0 which is very similar to the CVI graph.
    - Measuremnt Studio does not have a table control.
    - VC++ 6.0 is really really old. Have you considered upgrading?
    Bilal Durrani
    NI

  • Report printing in excel with multiple sheets

    Hi Experts,
         I am working in Oracle Reports 10g.  I need to print the report in Excel....
    For this i have created .JSP file and now printing in Excel(Sheet1).
    My requirement is i need to print the report in multiple sheets.
    For example if i run the departments report then the generated excel file should be as below
    (Sheet1 - HR, Sheet2 - FINANCE, Sheet3 - MARKETING, etc.,)
    How can i do this?
    Thanks in Advance.

    Hi All,
       Is this possible  Report printing in excel with multiple sheets??
    Please give solution for my above post Report printing in excel with multiple sheets..
    Thanks,
    Su.gi

  • Export to excel with javascript/vbscript or with plsql(html table)

    i have searched for a way to export data from OracleXe to excel without losing formatting .
    So far i have found 2 possible relatively easy ways that i am still researching
    (i do not include the ask tom sylk format way of exporting )
    1 to export the query to a html table, while using stylesheets for formatting
    (using microsoft specific styles)
    2. use of javascript/vbscript to fill an array and write this array to excel with use
    of visual basic for applications in excel.This also provides charting capabilities.
    I am still researching this two ways, and have
    encountered a few obstacles (help would be appreciated)
    1 the first way:
    a. create a button " export to excel"
    b. create the following pl/sql procedure:
    owa_util.mime_header('application/vnd.ms-excel');
    owa_util.http_header_close;
      HTP.PRINT('<html>');
      HTP.PRINT('<head>');
      HTP.PRINT('<meta http-equiv="Content-Type" content="text/html">');
      HTP.PRINT('<title>Title of the HTML File</title>');
      HTP.PRINT('</head>');
      HTP.PRINT('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
      HTP.PRINT('<h1>Heading in the HTML File</h1>');
      HTP.PRINT('<p>Some text in the HTML file.');
      HTP.PRINT('</body>');
      HTP.PRINT('</html>');
    htmldb_application.g_page_text_generated := true;
    htmldb_application.g_unrecoverable_error := true;
    c: run the procedure conditionally based on the button  "export to excel"
    the problem with this way is that using htmldb_application.g_unrecoverable_error := true; is not the ideal way, because it
    stops further processing, but if i leave it out, the export doesn't happen.
    To export to excel while retaining data formatting  you have to use microsoft excel
    specific styles(Seedocumentation on the microsoft site)
    2.The second way:
    a create a pl/sql procedure or sql query.
    b use this query to fill a vbscript/javascript array with values
    c write these values to excel with use of vba in excel :
    the obstacle i encountered here was that i dont know how to export the result of a
    query to a visual basic script or javascript array.

    Using approach 1) works fine for me.
    the problem with this way is that using htmldb_application.g_unrecoverable_error := true;
    is not the ideal way, because it
    stops further processing, but if i leave it out, the export doesn't happen. Why is this a problem?
    I created the button to export the excel file on page 1 and created your pl/sql procedure on page 2 using an onload process.
    Works fine.
    Other approaches for exporting to excel are:
    http://www.oracle.com/technology/pub/articles/saternos_broadcast.html
    http://htmldb.oracle.com/pls/otn/f?p=18326:54:5685133631021176591::::P54_ID:1962
    ~Dietmar.

Maybe you are looking for