none
file Not Found: Content Query Webpart

    Question

  • Hi everyone,

    i am wokring with a content query webpart to display the documents in a sub site from a document library of another sub site.(My Environment is Sharepoint 2010)

    I have a document library with some folders in it and folders having the documents in it in a"subsite2".

    I want to display the documents of "subsite2" in another subsite called "Subsite1".

    I am using content query webpart to dislay the documents from document library of "subsite2" to "subsite1" based on some content type.

    I am able to see all the document in "subsite1",but the issue is when i click on the link of the document displayed in the content query webpart,then it shows the error as "File Not Found".

     

    Please help me to resolve this issue.

     

    Thanks in advance

    Chandu

    Thursday, November 18, 2010 6:38 AM

Answers

  • Hello,

     

    Seems that you are using Office Web App to view documents from CQWP. While I was testing, this error reproduces on Word and PowerPoint file when it was trying to open the file in browser, Excel file works though.

     

    The reason for this error is that Content Query Web Part passes incorrect URL to wordviewer.aspx and powerpoint.aspx. I am afraid that this problem has been identified as a problem with SharePoint Server 2010 and a known issue has been filed but our product group don’t have an estimate for how long it will take for a fix.

     

    A workaround here is to enable “Open documents in client applications by default” feature at site collection level so that files will be opened in Office application.

     

     

    Sorry for the inconvenience and many thanks for your understanding.  

     

    Thanks & Regards.


    Lily Wu
    • Marked as answer by Lily Wu Friday, November 26, 2010 6:53 AM
    Wednesday, November 24, 2010 2:40 AM

All replies

  • To get more infor regarding file not found please do the following

    Change the sharepoint web.config (C:\inetpub\wwwroot\wss\VirtualDirectories\sharepoint80)  to
     
    <SafeMode MaxControls=“200“ CallStack=“false“…
    to…
    <SafeMode MaxControls=“200“ CallStack=“true“…
     
    You will also need to set custom errors to 'Off' .
     
    <customErrors mode=“Off“/>
     
    Note: Reset the IIS Server. (command prompt please type c:\iisreset)
     
    Thursday, November 18, 2010 10:20 AM
  • I am also have exactly same problem. Changing web.config as proposed doesn't give any more info.
    Monday, November 22, 2010 2:36 AM
  • Hello,

     

    Seems that you are using Office Web App to view documents from CQWP. While I was testing, this error reproduces on Word and PowerPoint file when it was trying to open the file in browser, Excel file works though.

     

    The reason for this error is that Content Query Web Part passes incorrect URL to wordviewer.aspx and powerpoint.aspx. I am afraid that this problem has been identified as a problem with SharePoint Server 2010 and a known issue has been filed but our product group don’t have an estimate for how long it will take for a fix.

     

    A workaround here is to enable “Open documents in client applications by default” feature at site collection level so that files will be opened in Office application.

     

     

    Sorry for the inconvenience and many thanks for your understanding.  

     

    Thanks & Regards.


    Lily Wu
    • Marked as answer by Lily Wu Friday, November 26, 2010 6:53 AM
    Wednesday, November 24, 2010 2:40 AM
  • I also had this problem, glad to see it wasn't something I was doing incorrectly ;)  I am probably going to simply save the few (I'm lucky) .docx files I have as .pdf in order to avoid this issue for now. 

     

     

    Wednesday, December 15, 2010 6:17 PM
  • Your suggestion to open in client app doesn't work.  I continue to get correlation id errors on Word docs.


    UCHKEV
    Wednesday, January 19, 2011 7:55 PM
  • Hi. Has this issue been resolved yet? If not, is there any update about when it will be?

    Thanks!

    Thursday, January 20, 2011 11:37 PM
  • Hi,

    Any update for this ?

    Thanks


    Philippe
    Thursday, February 17, 2011 1:14 PM
  • Hello Everyone,

    Not sure if this was answered.  This was fixed in June CU.  You should apply SP1 + June CU for Office Web Apps and SharePoint. 

    http://blogs.technet.com/b/office_resource_kit/archive/2011/07/12/patching-office-web-apps-to-sp1-and-june-cus-including-sharepoint-server-2010.aspx

    http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=984

    -Aseem

     

     

     


    This posting is provided "AS IS" with no warranties, and confers no rights
    • Proposed as answer by Sabbah13 Thursday, August 18, 2011 2:40 PM
    Thursday, August 11, 2011 6:37 PM
  • Hello Everyone,

    Not sure if this was answered.  This was fixed in June CU.  You should apply SP1 + June CU for Office Web Apps and SharePoint. 

    http://blogs.technet.com/b/office_resource_kit/archive/2011/07/12/patching-office-web-apps-to-sp1-and-june-cus-including-sharepoint-server-2010.aspx

    http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=984

    -Aseem

     

     

     


    This posting is provided "AS IS" with no warranties, and confers no rights


    Are you sure it's being fixed by the CU? We applied the SP1 + Jun CU, but the issue is still there, any ideas?

    • Edited by zishanyang Wednesday, March 21, 2012 4:21 PM
    Wednesday, March 21, 2012 4:20 PM
  • i'm also facing this issue. Is there already a fix available?

    Tuesday, August 21, 2012 11:22 AM
  • Hi,

    This particular fix is not mentioned in the cummulative update link given below.

    http://support.microsoft.com/kb/2553919

    http://blogs.technet.com/b/office_resource_kit/archive/2011/07/12/patching-office-web-apps-to-sp1-and-june-cus-including-sharepoint-server-2010.aspx

    Can anyone please help by giving the exact fix which is solving this particular issue.

    Thanks in Advance,

    Dhileep

    Tuesday, February 05, 2013 10:10 AM
  • Hi,

    I have the following subsites

    http://mysite/sub1

    http://mysite/sub2

    In CQWP the url is http://mysite/sub1/_layouts/wordviewer.aspx?id=/sub2/documents/mydoc.docx?source=http://mysite/sub1/pages/default.aspx

    Why is the url in CQWP not correct? /sub2/documents/mydoc.docx is the correct url. But the begin of the url is wrong. When I make url 

    http://mysite/sub2/_layouts/wordviewer.aspx?id=/sub2/documents/mydoc.docx?source=http://mysite/sub1/pages/default.aspx

    It works

    Tuesday, May 27, 2014 1:26 PM
  • Hi Danny,

    This was a known issue with Sp2010 CQWP, also it was fixed in some CU, but not sure which CU has this fix.

    Anyway I fixed this issue by using my own item style template given below. Include the below template in ItemStyle.xsl & than use this style for the CQWP you created.

    <xsl:template name="TitleDocumentIcon-OfficeWebAppsFix" match="Row[@Style='TitleDocumentIcon-OfficeWebAppsFix']" mode="itemstyle">
         
         <script type="text/javascript">
          var DocContent;
          var myWeb;
          var StartUrl;
          var endUrl;
          var modifiedUrl;
          
             function GetWebURL(SafeLinkUrl, docStr, FolderRef, FileRef, e)
             {
              StartUrl = SafeLinkUrl;
              endUrl = FileRef;
              DocContent = docStr;
              modifiedUrl = FolderRef;
              var clientContext = new SP.ClientContext(FolderRef);          
              myWeb = clientContext.get_web();
              clientContext.load(myWeb);
              clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
             }
             
             function onQuerySucceeded(sender, args)
             {
              window.location.href = StartUrl + modifiedUrl + DocContent + endUrl;
             }
             
             function onQueryFailed(sender, args)
             {
              var strlength = modifiedUrl.lastIndexOf("/");
              var finalString = modifiedUrl.substring(0, strlength);
              GetWebURL(StartUrl, DocContent, finalString, endUrl);
             }
            </script>
             
         <xsl:variable name="SafeLinkUrl">
                <xsl:call-template name="OuterTemplate.GetSafeLink">
                    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
                </xsl:call-template>
            </xsl:variable>
           
             <xsl:variable name="SiteDisplayTitle">
                <xsl:call-template name="OuterTemplate.GetTitle">
                  <xsl:with-param name="Title" select="@URL"/>          
                   <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
                </xsl:call-template>
            </xsl:variable>
           
            <xsl:variable name="FileName" select="substring-before($SiteDisplayTitle, '.')"/>
           
            <xsl:variable name="SiteNameStr" select="substring-before(@FileRef, $FileName)"/>
            <xsl:variable name="SiteNameStr1">
          <xsl:call-template name="substring-before-last">
           <xsl:with-param name="string1" select="$SiteNameStr" />
           <xsl:with-param name="string2" select="'/'" />
          </xsl:call-template>
         </xsl:variable>
       
         <xsl:variable name="SiteName">
          <xsl:call-template name="substring-before-last">
           <xsl:with-param name="string1" select="$SiteNameStr1" />
           <xsl:with-param name="string2" select="'/'" />
          </xsl:call-template>
         </xsl:variable>
         
           <xsl:variable name="DisplayTitle">
                <xsl:call-template name="OuterTemplate.GetTitle">
                    <xsl:with-param name="Title" select="@Title"/>
                    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
                </xsl:call-template>
           </xsl:variable>     
         
         <xsl:variable name="ServerUrlStr">
          <xsl:call-template name="substring-before-last">
           <xsl:with-param name="string1" select="$SafeLinkUrl" />
           <xsl:with-param name="string2" select="@FileRef" />
          </xsl:call-template>
         </xsl:variable>
         
         <xsl:variable name="ServerUrl">
          <xsl:call-template name="substring-before-last">
           <xsl:with-param name="string1" select="$ServerUrlStr" />
           <xsl:with-param name="string2" select="'/'" />
          </xsl:call-template>
         </xsl:variable>
           
            <xsl:variable name="DocStr" select="string('/_layouts/WordViewer.aspx?id=/')"/>
            <xsl:variable name="PptStr" select="string('/_layouts/PowerPoint.aspx?PowerPointView=ReadingView&amp;PresentationId=/')"/>
            <xsl:variable name="XlStr" select="string('/_layouts/xlviewer.aspx?id=/')"/>
           
            <div class="item link-item">
         <xsl:if test="string-length(@DocumentIconImageUrl) != 0">
             <div class="image-area-left">
                 <img class="image" src="{@DocumentIconImageUrl}" title="" />
                </div>
             </xsl:if>
         <xsl:choose>
         
         <xsl:when test="contains(@FileRef,'doc') = 1">
         <a href="#" onclick="javascript:GetWebURL('{$ServerUrl}', '{$DocStr}', '/{$SiteName}', '{@FileRef}')" title="{@LinkToolTip}">
           <!--<xsl:value-of select="$FileName"/> -->
           <xsl:value-of select="$DisplayTitle"/>
         </a>
         </xsl:when>
         
         <xsl:when test="contains(@FileRef,'ppt') = 1">
          <a href="#" onclick="javascript:GetWebURL('{$ServerUrl}', '{$PptStr}', '/{$SiteName}', '{@FileRef}')" title="{@LinkToolTip}">
           <!--<xsl:value-of select="$FileName"/> -->
           <xsl:value-of select="$DisplayTitle"/>
          </a>
         </xsl:when>
         
         <xsl:when test="contains(@FileRef,'potx') = 1">
          <a href="#" onclick="javascript:GetWebURL('{$ServerUrl}', '{$PptStr}', '/{$SiteName}', '{@FileRef}')" title="{@LinkToolTip}">
           <!--<xsl:value-of select="$FileName"/> -->
           <xsl:value-of select="$DisplayTitle"/>
          </a>
         </xsl:when>
         
         
              <xsl:when test="contains(@FileRef,'ppsx') = 1">
          <a href="#" onclick="javascript:GetWebURL('{$ServerUrl}', '{$PptStr}', '/{$SiteName}', '{@FileRef}')" title="{@LinkToolTip}">
           <!--<xsl:value-of select="$FileName"/> -->
           <xsl:value-of select="$DisplayTitle"/>
          </a>
         </xsl:when>

         
         <xsl:when test="contains(@FileRef,'xls') = 1">
          <a href="#" onclick="javascript:GetWebURL('{$ServerUrl}', '{$XlStr}', '/{$SiteName}', '{@FileRef}')" title="{@LinkToolTip}">
           <!--<xsl:value-of select="$FileName"/> -->
           <xsl:value-of select="$DisplayTitle"/>
          </a>
         </xsl:when>
         
         <xsl:otherwise>
          <a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
           <xsl:if test="$ItemsHaveStreams = 'True'">
           <xsl:attribute name="onclick">
            <xsl:value-of select="@OnClickForWebRendering"/>
           </xsl:attribute>
           </xsl:if>
           <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
           <xsl:attribute name="onclick">
                      <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                  </xsl:attribute>
                  </xsl:if>
           <!--<xsl:value-of select="$FileName"/> -->
           <xsl:value-of select="$DisplayTitle"/>
              </a>
          </xsl:otherwise>
          </xsl:choose>
          <div style="color:#4c4c4c; font-family:Tahoma; font-size:8pt;">
                      <xsl:value-of select="@Comments" />
                </div>
             </div>
        </xsl:template>

    In the CQWP configuration, please update the fields with following properties.

    Link: URL Path [Custom Columns];
    Title: Title;
    FileRef: URL Path [Custom Columns];

    I have included only the documents with extension doc, ppt, potx, ppsx & xls. If you want you can include what ever extension you needed.

    Thanks,
    Dhileep

    Friday, August 01, 2014 4:53 AM