Wednesday, April 25, 2012

Display Item Attachments in SharePoint List View

It is very easy to display list item attachments
in List View and also manipulate the display of attachment, like if attachment is
image, we can display image not just a link.
1. Open List View in SharePoint Desinger
2. Add new column titled "Attachments".
3. Select TD tag of New column.
4. Replace selected code with below code.


 <td id="ItemAttchment" class="ms-vb">
          <xsl:element name="SharePoint:AttachmentsField">
          <xsl:attribute name="runat">server</xsl:attribute>
                    <xsl:attribute name="FieldName">Attachments</xsl:attribute>
          <xsl:attribute name="ControlMode">Display</xsl:attribute>
          <xsl:attribute name="Visible">true</xsl:attribute>
          <xsl:attribute name="ItemId">
              <xsl:value-of select="@ID"/>
          </xsl:attribute>
          </xsl:element>
</td>


5. View with Attachments

66 comments:

  1. I had a problem after pasting the XSLT code from Step 4. The following error showed in the table cell of the new column:

    Error Rendering Control - Unnamed1Cannot create an object of type 'System.Int32' from its string representation '3af427e6-b3f9-4313-96b7-bde7bf693afd' for the 'ItemId' property.

    ReplyDelete
    Replies
    1. Had the saqme Problem - you're getting the ID of the Attachment column, you need to select the ID of the Sharepoint List Item:
      <xsl:value-of select="$thisNode/@ID"></xsl:value-of>
      Hope this works for you

      Delete
    2. I had the same problem and tried Martin solution but still I have the same problem. Any ideas?

      Delete
  2. Hi, Any idea if this can be done to a XsltListViewWebpart added dynamically to a list form?

    ReplyDelete
  3. It seems that if the attachment isn't added to the list item initially OR the attachment is changed for that list item later, it doesn't update the link on the view.

    ReplyDelete
  4. thanks...great work...helped me before my presentation !!!!!

    ReplyDelete
  5. Yes it is working fine , thanks for sharing such a nice information it was really helpful.

    ReplyDelete
  6. It seems that if the attachment isn't added to the list item initially OR the attachment is changed for that list item later, it doesn't update the link on the view.

    ReplyDelete
  7. While sorting the view the attachments are not been sorted

    ReplyDelete
  8. How could I sort the attachments when the list items are sorted?

    ReplyDelete
  9. Hi, That's all working great, but how can I display the URL to the attachment as an image? Thanks.

    ReplyDelete
  10. Dinesh and Luis, Did you figure out a way to avoid the issue of attachment displaying old file when we modify the attachment or sort the list?
    Thanks
    Nate

    ReplyDelete
  11. can we change the display name of attachments? for example, more information instead of amit_cv.docx

    ReplyDelete
  12. Hi. I also have a problem with the sort of attachments. When you apply a filter attachment does not correspond to the list items.

    ReplyDelete
  13. Hi there - How to do this in SharePoint 2013? Designer doesn't show Design view window.

    ReplyDelete
  14. Hi there - I was able to achieve it but now the problem is that since I customized the View page, It is not coming in the list of views and hence i couldn't export items to Excels. :-(

    Thanks Amit for posting this article. In a way your article was helpful.

    ReplyDelete
  15. How to do this in SharePoint 2013? Designer doesn't show Design view window.

    ReplyDelete
  16. How to do it on SharePoint 2013 ?

    ReplyDelete
  17. Can you help with the multiple attachments within a list entry. I am able to display the attachments now and want to show "last modified by" for each of them ? Any pointers ??

    ReplyDelete
    Replies
    1. Santosh, I'm trying to figure this out too, have you had any luck?

      Delete
    2. I tried this, but no success, I could not able to find the XSLT file. I am using SharePoint O365. so I followed steps from below url and it worked.


      https://social.technet.microsoft.com/Forums/en-US/74dac191-5a9e-4970-a9f6-a501846f0bef/forum-faq-show-attachments-in-sharepoint-2013-custom-list-view?forum=sharepointgeneral&prof=required

      Delete
  18. Very nice article. Working fine for lists. But I was unable to get this to work for form library.

    I have a form library with an attachment field. So when the form gets submitted I need the hyperlink of the attachment in the SharePoint list view. Any suggestions??

    ReplyDelete
  19. Thanks for the help that works perfectly after replacing

    ReplyDelete
  20. The attachments are not sorting when you change the sorting in any of the other columns, is there a fix for this?

    Thanks

    ReplyDelete
    Replies
    1. I suppose I should clarify that it is not filtering when I filter another column.

      Delete
  21. where exactly do i have to paste the code?

    ReplyDelete
  22. I was able to use this for SP2010, but we are now moving to SPOnline (using SPD2013). Do you have a similar solution when SPD2013 does not allow Design or Split mode?

    ReplyDelete
  23. Yes also wondering how to do this in SPD 2013 ? Thx

    ReplyDelete
  24. Hi All,
    There is a way to do it in SharePoint Designer 2013 also. What I did is to create a "DataSource" in SharePoint designer 2013 (SOAP - Lists.asmx) even if your list exists in the same site. After creating the datasource, I went to the webpart page and added the "Data View" webpart and modified it as mentioned in this blog. I have tested this in my dev machine and it is working.

    PART 1- http://blog.jonathanroussel.com/2009/05/sharepoint-walktrouh-displaying-list.html

    PART 2- http://blog.jonathanroussel.com/2009/05/sharepoint-walktrouh-displaying-list_28.html

    Hope someone find this useful.

    ReplyDelete
  25. Ayo kunjugi permainan terbaik dan Menarik dari kami

    ReplyDelete
  26. ayo deh coba KLIK buat dapetin uang lebih

    ReplyDelete
  27. This works for me when I view the listview alone but it the column I have added "disappears" when I embed this listview in wikipage or publishing page. It not only doesn't appear it seemingly gets stripped out when I view the html in the dom explorer. Does anyone know why it is doing this? I'm using sharepoint 2010 :-(

    ReplyDelete
  28. sabung ayam filipina juga di kenali dalam indobnesia, bolavita merupakan salah satu agen terbesar... WA: 081377055002

    ReplyDelete
  29. This website can live streaming , you can join at my site :
    agen judi online terpercaya
    Prediksi Bola

    Thank you
    agenpialaeropa.net

    ReplyDelete
  30. anyidea how to get this soution in o365 or SP2016

    ReplyDelete

  31. NAGAQQ | AGEN BANDARQ | BANDARQ ONLINE | ADUQ ONLINE | DOMINOQQ TERBAIK

    Yang Merupakan Agen Bandarq, Domino 99, Dan Bandar Poker Online Terpercaya di asia hadir untuk anda semua dengan permainan permainan menarik dan bonus menarik untuk anda semua

    Bonus yang diberikan NagaQQ :
    * Bonus rollingan 0.5%,setiap senin di bagikannya
    * Bonus Refferal 10% + 10%,seumur hidup
    * Bonus Jackpot, yang dapat anda dapatkan dengan mudah
    * Minimal Depo 15.000
    * Minimal WD 20.000

    Memegang Gelar atau title sebagai AGEN BANDARQ Terbaik di masanya

    Games Yang di Hadirkan NagaQQ :
    * Poker Online
    * BandarQ
    * Domino99
    * Bandar Poker
    * Bandar66(NEW GAMES)

    Info Lebih lanjut Kunjungi :
    Website : NAGAQQ
    WHATSAPP : +855967014811
    Line : Cs_nagaQQ
    TELEGRAM :+855967014811

    BACA JUGA BLOGSPORT KAMI YANG LAIN:
    berita nagaqq/
    agen bandarq online/
    Kemenangan NagaQQ/

    ReplyDelete
  32. RajaBandarQ
    Adalah website yang paling digemari saat ini oleh para pecinta judi online
    Dengan adanya 8 game terbaik yang disediakan oleh pihak website RajaBandarQ , akan banyak mengundang para pecinta judi poker online untuk bermain diwebsite RajaBandarQ

    8 Game Yang disediakan oleh pihak RajaBandarQ diantaranya adalah :

    * AduQ
    * BandarQ
    * Bandar Poker
    * Bandar 66 ( New Games )
    * Capsa Susun
    * Domino QQ
    * Poker
    * Sakong

    Keunggulan jika bergabung di website RajaBandarQ :

    - Proses Deposit dan Withdraw Hanya 2 Menit
    - 100% Mudah Menang & Fairplay Game
    - Minimal Deposit & Withdraw Rp 20.000,-
    - Bonus Rollingan 0.3% (Tanpa Syarat)
    - Bonus Referral 20% (Seumur Hidup)
    - Bonus Extra Refferal
    - Sistem Keamanan Terbaru
    - Support 6 Bank Local ( BCA , BNI , BRI , CIMB NIAGA , DANAMON , MANDIRI )

    Kami Memberikan Bukti Bukan Janji !!!

    Silahkan di baca juga blogger dari kami :

    - Blogger : Cerita Dewasa

    - Blogger : Raja Berita889

    - Blogger : Panduan Judi Online

    - Blogger : Berita Online Terapdate

    Tunggu apalagi ? Daftarkan diri anda segera juga dan menangkan jackpot jutaan rupiah hanya dengan modal Rp 20.000,-
    Hanya Di RajaBandarQ

    Join : >>DAFTAR RAJABANDARQ<<

    ReplyDelete
  33. Nikmati Promo BOnus Flash Deposit Sepesial Setiap Hari Jumat!!!
    Ayo Gabung sekarang dan langsung Claim Bonus Nya... Hanya setiap Hari Jumat ya...

    Syaratnya mudah kok, Untuk Info Lengkap Hubungi:
    WA : 0812-2222-995
    Line : cs_bolavita
    Link : www,855sm.live

    Ayo Segera Bergabung Bersama kami Dan Nikmati Bonus nya....

    ReplyDelete

  34. NAGAQQ | AGEN BANDARQ | BANDARQ ONLINE | ADUQ ONLINE | DOMINOQQ TERBAIK

    Yang Merupakan Agen Bandarq, Domino 99, Dan Bandar Poker Online Terpercaya di asia hadir untuk anda semua dengan permainan permainan menarik dan bonus menarik untuk anda semua

    Bonus yang diberikan NagaQQ :
    * Bonus rollingan 0.5%,setiap senin di bagikannya
    * Bonus Refferal 10% + 10%,seumur hidup
    * Bonus Jackpot, yang dapat anda dapatkan dengan mudah
    * Minimal Depo 15.000
    * Minimal WD 20.000

    Memegang Gelar atau title sebagai AGEN BANDARQ Terbaik di masanya

    Games Yang di Hadirkan NagaQQ :
    * Poker Online
    * BandarQ
    * Domino99
    * Bandar Poker
    * Bandar66(NEW GAMES)

    Info Lebih lanjut Kunjungi :
    Website : NAGAQQ
    WHATSAPP : +855967014811
    Line : Cs_nagaQQ
    TELEGRAM :+855967014811

    BACA JUGA BLOGSPORT KAMI YANG LAIN:
    berita nagaqq/
    agen bandarq online/
    Kemenangan NagaQQ/

    ReplyDelete
  35. RajaBandarQ
    Adalah website yang paling digemari saat ini oleh para pecinta judi online
    Dengan adanya 8 game terbaik yang disediakan oleh pihak website RajaBandarQ , akan banyak mengundang para pecinta judi poker online untuk bermain diwebsite RajaBandarQ

    8 Game Yang disediakan oleh pihak RajaBandarQ diantaranya adalah :

    * AduQ
    * BandarQ
    * Bandar Poker
    * Bandar 66 ( New Games )
    * Capsa Susun
    * Domino QQ
    * Poker
    * Sakong

    Keunggulan jika bergabung di website RajaBandarQ :

    - Proses Deposit dan Withdraw Hanya 2 Menit
    - 100% Mudah Menang & Fairplay Game
    - Minimal Deposit & Withdraw Rp 20.000,-
    - Bonus Rollingan 0.3% (Tanpa Syarat)
    - Bonus Referral 20% (Seumur Hidup)
    - Bonus Extra Refferal
    - Sistem Keamanan Terbaru
    - Support 6 Bank Local ( BCA , BNI , BRI , CIMB NIAGA , DANAMON , MANDIRI )

    Kami Memberikan Bukti Bukan Janji !!!

    Silahkan di baca juga blogger dari kami :

    - Blogger : Cerita Dewasa

    - Blogger : Raja Berita889

    - Blogger : Bandar Berita Harian

    - Blogger : Panduan Judi Online

    - Blogger : Berita Online Terapdate

    Tunggu apalagi ? Daftarkan diri anda segera juga dan menangkan jackpot jutaan rupiah hanya dengan modal Rp 20.000,-
    Hanya Di RajaBandarQ

    Join : >>DAFTAR RAJABANDARQ<<

    ReplyDelete
  36. agen bola terpercaya - bandar bola online - bandar poker - bandar euro 2020
    Kamubet adalah Bandar judi online terpercaya yang menyediakan permainan sportbook, casino, slots, togel, sabung ayam, dan poker juga banyak bonus-bonus menariknya..

    berikut promo kamubet jangan di lewatkan:
    - BONUS DEPOSIT NEW MEMBER SLOT GAMES 50%
    - BONUS NEXT DEPOSIT 20% SLOT GAMES
    - WELCOME BONUS DEPOSIT SPORTBOOK 100%
    - WELCOME BONUS DEPOSIT SABUNG AYAM 100%
    - BONUS CASHBACK MIXPARLAY 100%
    - BONUS ROLLINGAN LIVE CASINO 1%
    - BONUS CASHBACK SPORTBOOK 10%
    - BONUS DISKON TOGEL UP TO 66%
    - BONUS CASHBACK SLOT GAMES 5%
    - BONUS DEPOSIT SETIAP HARI UP TO 20.000
    - BONUS REFERRAL SEUMUR HIDUP

    Jangan lupa daftar sekarang juga di kamubet.biz

    bandar bola terpercaya
    bandar poker terpercaya
    bandar togel terpercaya
    bandar slot terpercaya

    ReplyDelete
  37. Do you understand there's a 12 word phrase you can tell your partner... that will trigger intense emotions of love and instinctual attractiveness to you buried inside his heart?

    Because deep inside these 12 words is a "secret signal" that triggers a man's instinct to love, worship and care for you with his entire heart...

    12 Words That Fuel A Man's Love Impulse

    This instinct is so built-in to a man's mind that it will drive him to work better than before to take care of you.

    Matter-of-fact, triggering this mighty instinct is so essential to getting the best ever relationship with your man that once you send your man a "Secret Signal"...

    ...You'll soon find him expose his heart and soul to you in such a way he never experienced before and he'll perceive you as the only woman in the world who has ever truly attracted him.

    ReplyDelete
  38. Your Affiliate Money Making Machine is waiting -

    And getting it set up is as easy as 1-2-3!

    Here's how it works...

    STEP 1. Input into the system what affiliate products you want to push
    STEP 2. Add PUSH BUTTON TRAFFIC (it ONLY takes 2 minutes)
    STEP 3. See how the affiliate products system grow your list and sell your affiliate products all on it's own!

    Do you want to start making money??

    Your MONEY MAKING affiliate solution is RIGHT HERE

    ReplyDelete
  39. NAGAQQ | AGEN BANDARQ | BANDARQ ONLINE | ADUQ ONLINE | DOMINOQQ TERBAIK

    Yang Merupakan Agen Bandarq, Domino 99, Dan Bandar Poker Online Terpercaya di asia hadir untuk anda semua dengan permainan permainan menarik dan bonus menarik untuk anda semua

    Bonus yang diberikan NagaQQ :
    * Bonus rollingan 0.5%,setiap senin di bagikannya
    * Bonus Refferal 10% + 10%,seumur hidup
    * Bonus Jackpot, yang dapat anda dapatkan dengan mudah
    * Minimal Depo 15.000
    * Minimal WD 20.000

    Memegang Gelar atau title sebagai QQ Online Terbaik di masanya

    Games Yang di Hadirkan NagaQQ :
    * Poker Online
    * BandarQ
    * Domino99
    * Bandar Poker
    * Bandar66
    * Sakong
    * Capsa Susun
    * AduQ
    * Perang Bacarrat (New Game)

    Tersedia Deposit Via pulsa :
    Telkomsel & XL

    Info Lebih lanjut Kunjungi :
    Website : NAGAQQ
    Facebook : NagaQQ Official
    Kontakk : Info NagaQQ
    linktree : Agen Judi Online
    WHATSAPP : +855977509035
    Line : Cs_nagaQQ
    TELEGRAM : +855967014811


    BACA JUGA BLOGSPORT KAMI YANG LAIN:
    agen bandarq terbaik
    Winner NagaQQ
    Daftar NagaQQ
    Agen Poker Online

    ReplyDelete
  40. Nikmati Bonus Menarik Dari Bolavita Sekarang...
    -Nikmati Bous New member 10%
    -Nikmati Bonus Cashback Hingga 10%
    -Nikmati Juga Bonus jackpot Hingga Ratusan juta Rupiah Setiap harinya...

    Info Lengkap Hubungi:
    WA : 0812-2222-995
    Line : cs_bolavita
    Link : www.bolavita1.com

    TERIMA KASIH

    ReplyDelete
  41. Telah hadir di bolavita deposit via pulsa telkomsel dan XL Rate terbaik se indonesia
    dan banyak bonus2 mendarik lain nya min depo 25 rbu bisa jadi jutawan
    ayo segera daftar dan buktikan sendiri

    info lbh lanjut:
    WA: +62812-2222-995

    ReplyDelete
  42. Alasan Kenapa Kamu Harus Bermain Judi Di Museumbola
    * Permainan Lengkap dari A sampai Z
    * Opsi Deposit Banyak Seperti Bank, E-Cash , PULSA
    * Semua Rekening Bank termasuk Bank Daerah Bisa Di Daftarkan
    * Bonus Banyak
    * Deposit 2 Menit
    * Withdraw 5 Menit Paling Lama
    * Cs Professional 24 Jam Online

    Daftar Museumbola
    Link Alternatif Museumbola
    Judi Bola Online
    Slot pulsa tanpa potongan
    Demo Slot Habanero

    ReplyDelete
  43. This comment has been removed by the author.

    ReplyDelete
  44. MEJAQQ: AGEN JUDI POKER DOMINOQQ BANDARQ ONLINE TERBESAR DI ASIA

    Yang Merupakan Agen Judi Poker DominoQQ BandarQ Online Terbesar di Asia Hadir Untuk Anda Semua Dengan Games dan Bonus Yang Menarik!

    Bonus yang Kami Berikan di MEJAQQ :
    * Bonus Rollingan 0.5% 2x Dalam 1 Minggu ( Setiap Rabu dan Minggu )
    * Bonus Referral 10% + 10% Seumur Hidup (X-tra Untuk Para Pencari Bonus Referral di Indonesia)
    * Dan Masih Banyak Bonus Spesial Lainnya yang Bisa Anda Dapatkan Pada waktu-waktu tertentu di MEJAQQ!

    Buruan Kunjungi Sekarang Juga ^^

    11 Games Yang di Hadirkan MEJAQQ:
    *- POKER
    *- DOMINO QQ
    *- CAPSA SUSUN
    *- BANDAR POKER
    *- BANDAR Q
    *- BANDAR 66
    *- SAKONG
    *- ADU Q
    *- PERANG BACCARAT
    *- Perang Dadu ( NEW )
    *- BD QQ (HOT NEW )

    Info Lebih lanjut Kunjungi :
    Website : Mejabesar(.)Org
    Line : Mejaqq_official
    WA 1 : +85515620767
    TELEGRAM : +85515620767

    Kunjungi Juga situs kami di :
    MEJAQQ
    Bos MejaQQ
    BANDARQ ONLINE
    daftar mejaqq
    QQ ONLINE

    KUMPULAN ARTIKEL MENARIK
    SITUS BANDARQ
    Mata Lelaki

    ReplyDelete