Export Custom List into Excel through custom Ribbon

Hi i have a requirement, in that i need to export custom list into EXCEL through custom Ribbon. For Example in my list, i have Col1, Col2, Col3. Col3 has multiple values (allow mutiple values) and when export this into excel all values in Col3 should
come as new rows and rest of the column values should duplicate. please helpout from this requirement.
List View
Col1   Col2      Col3
v1        v2    v31,v32,v33
Excel View
Col1  Col2  Col3
v1      v2      v31
v1      v2      v32
v1      v2      v33
Nihath

Hello Nihath,
As per your description, you have to read each and every items in list with column value then only you can generate excel. There is direct way to export datatable to excel but in your case you will also need to iterate Col3 value to create new row in excel.
I would suggest to use CAML query to get all items then check Col3 value. If there are multiple value then add them as new datatable row and finally export full datatable to excel.
Here is link for CAML:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.listitemcollectionposition.aspx
Export datatable to excel:
http://stackoverflow.com/questions/12533626/export-datatable-to-excel
Finally add this feature in ribbon:
http://ankurmadaan.blogspot.in/2012/10/custom-ribbon-action-for-specific-list.html
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help

Similar Messages

  • Export ALV List into Excel Sheet

    Hi Friends,
    We are displaying an ALV List in report Program and we are exporting that into excel sheet using the icon "Spreadsheet(ctrlshiftF7)"provided by ALV Grid.
    But when it is displayed in Excel sheet it changes the sequence of columns (fields).
    And we observed that it displays all the CHAR fields first then the CURRENCY fields and then the DATE fields that we specified in field catalog.
    So, what should be done so that the fields are exported into Excel in the same order as specified in the field catalog of ALV List.

    Give this a look.
    REPORT ZEXCEL .
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
    workbook TYPE ole2_object,
    sheet TYPE ole2_object,
    cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0, formula(50), END OF itab3.
    *START-OF-SELECTION
    START-OF-SELECTION.
    APPEND: 'Peter' TO itab1, 'Ivanov' TO itab2,
    '=Sheet1!A1 & " " & Sheet2!A1' TO itab3,
    'John' TO itab1, 'Smith' TO itab2,
    '=Sheet1!A2 & " " & Sheet2!A2' TO itab3.
    CREATE OBJECT application 'excel.application'.
    SET PROPERTY OF application 'visible' = 1.
    CALL METHOD OF application 'Workbooks' = workbook.
    CALL METHOD OF workbook 'Add'.
    Create first Excel Sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 1.
    CALL METHOD OF sheet 'Activate'.
    SET PROPERTY OF sheet 'Name' = 'Sheet1'.
    LOOP AT itab1.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab1-first_name.
    ENDLOOP.
    Create second Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 2.
    SET PROPERTY OF sheet 'Name' = 'Sheet2'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab2.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab2-last_name.
    ENDLOOP.
    Create third Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 3.
    SET PROPERTY OF sheet 'Name' = 'Sheet3'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab3.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Formula' = itab3-formula.
    SET PROPERTY OF cells 'Value' = itab3-formula.
    ENDLOOP.
    Save excel speadsheet to particular filename
    CALL METHOD OF sheet 'SaveAs'
    EXPORTING #1 = 'c:\temp\exceldoc1.xls' "filename
    #2 = 1. "fileFormat
    Closes excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.

  • How to convert alv list into excel file?

    Hi Experts,
            i have created one report for Due Date Analysis.
    Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.
         So i need the Function Module to Convert the Data into Excel File.
    Thanks,
    Neptune.M

    Hi,
      U can use function module gui_download.
      CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
        BIN_FILESIZE       =
          filename           = 'C:\Transportaionlane.XLS'
          filetype                       = 'DAT'
        WRITE_FIELD_SEPARATOR           = ' '
        HEADER                          = '00'
        TABLES
          ata_tab                       = t_trans_lane_dis[]
           OTHERS                          = 22
    if u want with header then pass the header.
    regards
    Ahasan

  • Problem when we dowload spool list into excel.

    Hello Gurus,
    I have developed an custom report, The output contains 15 columns. When i run the report in foreground the output will be displayed in correct format also when i download the report list into excel(List->Save/Send->File) then the records will be downloaded in proper format(Each record under respective column heading).
    But when the report is scheduled in background the spool list(SP01) is displayed in the proper format. But when I download this into excel(SppolRequest->Forward->SaveToLocal) . The excel data will be in improper format and all record value are not under respective column heading.
    Can anyone advice me.
    Thanks and regards,
    Vinod

    Hi,
      Use the FM 'EXCEL_OLE_STANDARD_DAT'.
    In this FM populate the tables parameter 'fieldnames' to get each cloumn below the heading correctly.

  • Exporting a List to Excel to use for Excel Services WebPart (not working)

    Hey everyone, here's the scenario. I'm trying to export a list to excel and save it to a library. All the connections are saved. Now. I want that excel file to render as a web part. When I make a change on the list and try to refresh the data connection
    I get the error below. Please help
    AJ MCTS: SP 2010 Configuration MCSA: Windows 7 If you find this post useful kindly please mark it as an answer :) TY

    Hi,
    I did a test as the followings:
    Create a list, and add some items into it.
    Export the list into a Excel file, then upload the excel file to a library.
    When I opened the file via Excel service, I saw the a yellow warning about unsupported features.
    Then I created a wiki page, and add Excel Web Access web part and connect the web part to the excel file.
    When I refresh all data conections, nothing happened.
    From the article:
    https://msdn.microsoft.com/en-us/library/ms496823.aspx (they are similar with SharePoint 2013)
    SharePoint lists are not supported for Excel service. So, it may cause this issue.
    I suggest you click "Open in Excel" to open the file in Excel application, then refresh the data connection, and save back to SharePoint. Then after you refresh the page, the data of the Excel Web Access web part will refresh.
    Thanks,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • 500 internal server error while Export wedbdynpro content into Excel.

    Hi Experts,
    my requirement is export webdynpro content into excel sheet, so for this what i have did is
    First step:
    ) created an Extneral library DC
    2) imported the JARs to the libraries folder of the External Library DC project
    3) Right-click on each of the JARs imported to the project and added them to the public part.
    Second step:
    1) Createed a new Reuse Web Dynpro DC
    2) Created a new public part, selecting the "Can be packaged into other build results" option
    3) extrcted the full content (folders and class files) to root folder
    4) Imported the folders and files to the src/packages folder
    5)binded the attributes, created 3 methods and writen the code for those methods.
    Third Step:
    1) created one more EXPORT EXCEL DC
    2) ADDED LIB jar dc and Reuse DC IN used dc's
    3) created usedwebdynpo component and binded attributes to Table VIEW and writen the code for exposing table values.
    After this build and deployed i am getting clasnot found error
    so what i have did now is
    Fourth step:
    1)Created "J2EE Library DC"
    2) Refered "External Library DC" into J2EE Library DC.
    3) Deployed "J2EE Library DC"
    4) Refered this one in my Web Dynpro DC by giving Library Reference.
    now when i deploy and run what happend i am getting
    500 Internal Server Error SAP J2EE Engine/7.01 
    Application error occurred during request processing.
    Details:   com.sap.tc.webdynpro.services.sal.core.DispatcherException: Failed to start deployable object sap.com/export_file_excel_7.
    Exception id: [00215E78C4C0006D00000AD9000E00F00004887F642A32FE]
    Any one can tell what could be the problem.

    Thanks for sharing the solution.

  • Problem in saving the spool list into Excel file.

    Hello Friends,
                         I run a background process for a report, and storing the resulting list into Excel format file. But the result is column values jumbled, it means columns values are not sitting in the right place in excel sheet.
    I also tried saving as unconverted text file and then open it using excel still the same result.
    Cheers,
    Senthil

    Hi,
      Use the FM 'EXCEL_OLE_STANDARD_DAT'.
    In this FM populate the tables parameter 'fieldnames' to get each cloumn below the heading correctly.

  • How to Export SSRS report into Excel format using query string

    Hello all,
    I am new to SSRS world.
    Last night i was trying to add a hyperlink  on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
    Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)

    Hi Suman85,
    Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
    Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
    to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
     ="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
    Then preview the report ,you will see
    Click here and export the report to excel 
    when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled. 
    I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
    Regards,
    Challen Foo

  • How to export report output into excel.

    Hi all
    how to export report output into excel sheet can any on give me answer step by step please as soon as possible
    kk

    Hi Prashanth,
    If you are executing Query from WAD  ---> Right click on Table (only on Characteristics Data)  --> Enhanced Menu ---> Export as --> CSV file or MS Excel
    assign points if this helps,
    Thanks,
    Sudhakar

  • Exporting SharePoint List to Excel it adds special / weird characters

    It's probably an escape code but they're not uniform.  When exporting a SharePoint List to Excel there is one column that is a multi-select lookup column and upon export between each item in that column there are a few special characters.  #68 and #70 in particular I see quite a lot of.  What are these escape codes and what would be a good way of filtering them out so they don't end up on the export?

    Hi Bouhatsu and Rob,
    I'm having the same thing with a filtered lookup. When exporting the list to Excel it adds the ID from the other list in front of the value I want (without me asking for it ...).
    Did one of you found a solution to get these ID's out of the export?
    Regards,
    Jeroen

  • I'm trying to export a list to Excel and I'm getting this error: "unable to download owssvr.dll"

    Hi, 
    Help, please.
    I’m trying to export a list to Excel and I’m getting this error: "unable to download owssvr.dll"
    Thanks in advanced.

    Hi,
    According to your post, my understanding is that you got the error "unable to download owssvr.dll" when exporting a list to Excel.
    owssvr.dll is the module given by Microsoft to read the data from SharePoint Lists using remote procedure call.
    You can find the OWSSVR.DLL in SharePoint 2010 Server Physical Path: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI.
    Please check whether it exists in SharePoint 2010 Server Physical Path.
    Please check whether you export a list to Excel correctly.
    Generally, the issue is caused by the brower. Please reset the IE to check whether it works.
    In addition, you can repair the Office to check whether it works.
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/5f471d53-e980-4acc-a6cb-7c8722571ec0/problem-with-export-to-spreadsheet?forum=sharepointgenerallegacy
    More information:
    SharePoint RPC Protocols Examples Using OWSSVR.DLL
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • What's the best way to export UTF8 data into Excel?

    Hi,
    Database charterer set is UTF8
         PARAMETER     VALUE
    1     NLS_NCHAR_CHARACTERSET UTF8
    2     NLS_CHARACTERSET     UTF8
    My requirement is that I want to export oracle data into excel file by using UTL_FILE oracle supplied package.
    But while writing data into excel files it’s looses in UTF8 encoding and writes some garbage data into file.
    I am very much sure that while retrieving the data form database it is perfectly encoded with UTF8, but after data is written to the file it eats the UTF encoding resulting into some garbage data.
    e.g.
    I am retrieving this filed from database which is UTF8 encoded in DB “Langäcker 55” but when it is written into excel it becomes “Langäcker 55”.
    Is Oracle UTL_FILE eating the UTF8 encoding while writing into file? if yes, is there utility which can help me to remain the UTF8 encoding as it is while writing in to excel file? Is there anythingi can do in Oracle to get this done?
    Thanks in advance.
    Thanks,
    Santosh

    Until now I have not found anyone who could write real Excel files (MS binary format) in PL/SQL. So I assume that you write your data in strings separated by a character like ; or |, aka CSV.
    Try to open your file with 'wb' (write binary) instead of 'w' and then use
    -- write data
    utl_file.put_raw(v_file,utl_raw.cast_to_raw(<your data>));
    --write remaining data
    utl_file.fflush(v_file);
    --close the file
    utl_file.fclose(v_file);Regards
    Marcus

  • In new Numbers, can you export a file into excel format?

    In new Numbers, can you export a file into excel format? Or is this something else thats been removed!!??
    HELP!!

    Hi AMGracie,
    In Numbers 3.0 on a MacBook Pro running OS X 10.9
    Regards,
    Ian.

  • Is there any way to insert a sharp into excel through OLE?

    Dear Expert,
    Is there any way to insert a sharp into excel through OLE ?If have , Would you please give a sample code?
    BR Edward

    Hi,
    Check this link..[OLE2, Excel, WinWord |http://translate.google.com/translate?hl=en&sl=ru&u=http://www.sapnet.ru/] you can find the code snippets.

  • User request to explore the possibility of downloading the distribution lists into excel for maintenance in t-code SO23.

    Hi Experts,
    There is a requirement from user that  "To explore the possibility of downloading the distribution lists
    into excel for maintenance in t-code SO23 ".
    Kindly provide your valuable informations/assistance in this regard.
    Madhavan K

    This Applesctipt will add comma's to the file count:
    (Copy into Applescript Editor, and Save as File Format: App, then just click the App to run)
    set x to choose folder with prompt "Choose Folder to Count Files" default location alias (the path to pictures folder as text)
    set filecount to do shell script "find " & POSIX path of x & " ! -type d ! \\( -name \".*\" -or -name \"Icon*\" \\) | wc -l"
    display dialog "File Count: " & comma_delimit(trim(filecount))
    on trim(someText)
              repeat until someText does not start with " "
                        set someText to text 2 thru -1 of someText
              end repeat
              repeat until someText does not end with " "
                        set someText to text 1 thru -2 of someText
              end repeat
              return someText
    end trim
    on comma_delimit(this_number)
              set this_number to this_number as string
              if this_number contains "E" then set this_number to number_to_text(this_number)
              set the num_length to the length of this_number
              set the this_number to (the reverse of every character of this_number) as string
              set the new_num to ""
              repeat with i from 1 to the num_length
                        if i is the num_length or (i mod 3) is not 0 then
                                  set the new_num to (character i of this_number & the new_num) as string
                        else
                                  set the new_num to ("," & character i of this_number & the new_num) as string
                        end if
              end repeat
              return the new_num
    end comma_delimit

Maybe you are looking for

  • App Store with wrong Apple Id

    Everywhere on my iTouch and my computer I have the same AppleId. It's only when I go to update my apps then I get a message that I need to sign into iTunes, which I am, and it brings up an old AppleId. There's no way to retrieve the password and that

  • Multiple database Instance on single server

    Hi friends, I want to install Solution manager in the same system which I have installed ECC6. So I want to install another database(10g). Can any one tell me the possibities to install it. regards, Nageshwar

  • Beige G3 AIO with Pioneer DVR-110D not booting OS X 10.2 retail install CD

    for some reason my Pioneer DVR-110D wont boot the 10.2 retail install cd's i have it will boot the OS 9.2.1 retail install cd's just fine. the only way i can boot the OS X install cd's is if i hold the command-control-power key's for 5 second's after

  • Customer Contact

    Hi, I am working on FSCM 6.4 Collection Management, while i tried to create customer contact and tried to get the contact information from get contact person from the process receivables it is showing blank, i can create it manually but by any means

  • WRT54GS V6 Issues

    Hi Everyone I've recently purchased the WRT54GS V6 Router and everything was working fine until a couple of weeks ago. The Cysco yellow light turns off and I have to reboot the router in order to get back online. I have F/W 1.5.2 loaded. However befo