એક ગ્રીડ સમાવિષ્ટ પ્રશ્ન વેબ ભાગ પરિણામો દર્શાવો / ટેબલ

ઝાંખી અને ઉદ્દેશ

આ બોક્સની બહાર, શેવાળ’ સામગ્રી ક્વેરી વેબ પાર્ટ (CQWP) યાદી બંધારણમાં માં તેના પરિણામો દર્શાવે છે, similar to search results. It is also possible to display the results in a grid format (દાખલા તરીકે. HTML કોષ્ટક બંધારણમાં). Grid formats are better in some circumstances. I describe how to achieve that effect in this article.

વ્યાપાર પરિદ્દશ્ય

I have worked with a client on an enterprise-wide MOSS rollout. We have designed their taxonomy such that projects are first class citizens in the hierarchy and have their own top level site. Project managers maintain a singleton list of project summary information, જેમ કે શીર્ષક, બજેટ, અપેક્ષા પૂર્ણ તારીખ, remaining budget and other summary type fields. By "singleton" I mean a custom SharePoint list guaranteed to contain only one item. Simplistically, તે આના જેવું દેખાય છે:

છબી

વર્ણવ્યા અનુસાર ટેકનિકલ અભિગમ ખૂબ જ છે અહીં (http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!447.entry). The CQWP uses an XSL transform to emit HTML for the browser to render.

I always envision the result before diving into the XSL because XSL is a nightmare. Here’s my desired result:

છબી

આ જેમ HTML કે પરિણામ પેદા:

<HTML>
 <સંસ્થા>
 <કેન્દ્ર>
 <ટેબલ સરહદ= 1>

<!-- લેબલ્સ ->
 <ટીઆર bgcolor= વાદળી>
 <ટીડી><ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર રંગ= સફેદ><બોલ્ડ>પ્રોજેક્ટ નામ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર><ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર રંગ= સફેદ><બોલ્ડ>તારીખ પૂર્ણ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર><ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર રંગ= સફેદ><બોલ્ડ>બજેટ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર><ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર રંગ= સફેદ><બોલ્ડ>વાસ્તવિક ખર્ચ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
 <ટીડી><ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર રંગ= સફેદ><બોલ્ડ>એકંદર સ્થિતિ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
 </ટીઆર>

<ટીઆર>
 <ટીડી>ફરી વાયર કોમ્પ્યુટર રૂમ.</ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર>02/01/08</ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર>22,500.00</ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર>19,000.00</ટીડી>
 <ટીડી>પ્રગતિ</ટીડી>
 </ટીઆર>

<ટીઆર>
 <ટીડી>એસક્યુએલ સુધારા માટે જોગવાઈ સર્વર્સ</ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર>04/01/08</ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર>7,500.00</ટીડી>
 <ટીડી એક હારમાં લાવવું= અધિકાર>0.00</ટીડી>
 <ટીડી>આયોજિત</ટીડી>
 </ટીઆર>

</ટેબલ>
 </કેન્દ્ર>
 </સંસ્થા>
</HTML>

માર્ગ

ગ્રીડ બનાવવા માટે આ પગલાંઓ અનુસરો:

  1. ગ્રીડ ની ઘટકો ઓળખો (પંક્તિઓ / કૉલમ્સ).
  2. જરૂરી સાઇટ કૉલમ નિર્ધારિત અને બનાવો.
  3. પ્રોજેક્ટ અને singleton યાદી ઉપ સાઇટ્સ બનાવો.
  4. વેબ પૃષ્ઠ પર CQWP ઉમેરો અને તેને તમારા યાદીઓ શોધવા માટે રૂપરેખાંકિત.
  5. વધારાના કૉલમ અપ ભેગા કરવા CQWP માતાનો XML બદલો.
  6. એક કોષ્ટક પેદા કરવા માટે XSL બદલો.

I’m going to concentrate on number six. Numbers one through four are straight-forward and something that any CQWP user has already done. Number five has been well-documented by others including this exhaustive screen-shot laden article from MSDN અહીં (http://msdn2.microsoft.com/en-us/library/bb897399.aspx) અને હિથર સોલોમનના બ્લોગ અહીં (http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx).

બદામ અને બોલ્ટ્સ સામેલ

પગલાંઓ એમએસડીએન દસ્તાવેજીકરણ અને હિથર સોલોમન લેખ મુજબ પાંચ મારફતે એક કરવાનું શરૂ કરો અને અમલ.

આ બિંદુએ, તમે પૃષ્ઠ પર તમારા CQWP ઉમેર્યા છે અને તમારી પાસે તમારી <CommonViewFields> જરૂરી તરીકે રૂપરેખાંકિત.

સામાન્ય પગલાંઓ અનુસરીને, હું આ મધ્યવર્તી વિચાર પરિણામો:

1. સામગ્રી પ્રકાર બનાવો, a templatized custom list for that content type and two sites. Here is the content type:

છબી

અહીં સાઇટ માળખું છે:

છબી

2. મારા પ્રોજેક્ટ subsites અને singleton પ્રોજેક્ટ સારાંશ યાદીઓ બનાવવા પછી CQWP ઉમેરો:

છબી

3. વાયા હું માંગો બધા વધારાની માહિતી ઉમેરો <CommonViewFields>:

        <મિલકત નામ="CommonViewFields" પ્રકાર="સ્ટ્રિંગ">Project_x0020_Name;Project_x0020_Expenses;Project_x0020_Status;Project_x0020_Start_x0020_Date;Project_x0020_End_x0020_Date;Project_x0020_Budget</મિલકત>

હું એક વાક્ય પર બધી મિલકત ક્ષેત્રો રાખવા હતું કે નોંધ અથવા તે કામ કરશે નહિં (CQWP ક્વેરી કોઈ આઇટમ પરત કે મને કહી હોત).

4. આ બિંદુએ, we’re ready to move beyond the MSDN article and flip on over to Heather Solomon’s article. Follow her steps starting near step #5 વૈવિધ્યપૂર્ણ બનાવવા માટે / unghosted version of ItemStyle.xsl. I follow Heather’s advice, પગલું દ્વારા અપ 11 અને આ મધ્યવર્તી વિચાર પરિણામો:

4.1: મારા XSL નમૂના તરીકે નીચે નામ:

<xsl:template name="Grid" match="Row[@Style=’Grid’]" mode="itemstyle">

હું પણ સહેજ તેના સૂચન સંશોધિત <xsl:-દરેક માટે …> એક ઉમેરીને </ બીઆર> એક ક્લીનર યાદી પૂરી પાડે છે ટૅગ:

    <xsl:-દરેક માટે પસંદ કરો="@ *">
      પી:<xsl:કિંમત ઓફ પસંદ કરો="નામ()" /><બીઆર/>
    </xsl:-દરેક માટે>

4.2: હું વેબ ભાગ સંશોધિત, go to appearance and select my "Grid" શૈલી:

છબી

ફેરફાર લાગુ પડે છે અને અહીં પરિણામ છે:

છબી

અમે ક્ષેત્રો અમે માંગો છો તે ઉપરથી જોઈ શકો છો (પ્રોજેક્ટનું નામ, મૂલ્ય, સ્થિતિ, વગેરે) are available for us to use when we emit the HTML. Not only that, but we see the names by which we must reference those columns in the XSL. ઉદાહરણ તરીકે, we reference Project Status as "Project_x005F_x0020_Name".

આ બિંદુએ, અમે હિથર માતાનો બ્લૉગ અને આ ધ શોલ્ડર્સ ઓફ જાયન્ટ્સ થી પ્રયાણ, હું મારા પોતાના થોડુંક ઉમેરો.

ContentQueryMain.xsl

નોંધ: બંને ContentQueryMain.xsl ફેરફારો કર્યા છે તેમજ ItemStyle.xsl ત્યારે, તમે તમારા ફેરફારો અસર જોવા પહેલાં તમે પાછા તે ફાઇલો તપાસ કરવાની જરૂર.

ગ્રીડ નિર્માણ હેતુ માટે, MOSS uses two different XSL files to produce the results we see from a CQWP. To generate the previous bit of output, we modified ItemStyle.xsl. MOSS actually uses another XSL file, ContentQueryMain.xsl to in conjunction with ItemStyle.xsl to generate its HTML. As its name implies, ContentQueryMain.xsl is the "main" XSL that controls the overall flow of translation. It iterates through all the found items and passes them one by one to templates in ItemStyle.xsl. We’ll modify ItemStyle.xsl to generate the open <ટેબલ> માહિતી પ્રથમ પંક્તિ સ્રાવ બહાર કાઢે છે તે પહેલાં ટૅગ અને બંધ <ટેબલ> tag after emitting the last row. To accomplish this, ContentQueryMain.xsl is modified to pass two parameters to our "grid" ItemStyle.xsl માં નમૂનો, "last row" and "current row". ItemStyle.xsl uses these to conditionally emit the necessary tags.

હિથર સોલોમનના ટેકનીકની મદદથી, we locate ContentQueryMain.xsl. It is located in the same place as ItemStyle.xsl. This screen shot should help:

છબી

અમે નીચેના ફેરફારો કરવાની જરૂર છે:

  • એક xsl નમૂનો બદલો, "CallItemTemplate" that actually invokes our Grid template in ItemStyle.xsl. We will pass two parameters to the Grid template so that it will have the data it needs to conditionally generate opening and closing <ટેબલ> ટૅગ્સ.
  • Modify another bit of ContentQueryMain.xsl that calls the "CallItemTemplate" to pass it a "LastRow" LastRow અમારા ગ્રીડ નમૂના પર પસાર કરી શકે છે કે જેથી પરિમાણ.

Locate the template named "OuterTemplate.CallItemTemplate" શબ્દમાળા ક:

  <xsl:નમૂનો નામ="OuterTemplate.CallItemTemplate">

નીચે પ્રમાણે સમગ્ર નમૂનો બદલો:

  <xsl:નમૂનો નામ="OuterTemplate.CallItemTemplate">
    <xsl:પરમ નામ="CurPosition" />

    <!--
      Add the "LastRow" પારમિતિ.
      We only use it when the item style pass in is "Grid".
    -->
    <xsl:પરમ નામ="LastRow" />

    <xsl:પસંદ કરો>
      <xsl:ક્યારે પરીક્ષણ="@ પ્રકાર = 'NewsRollUpItem'">
        <xsl:-નમૂનાઓ અરજી પસંદ કરો="." રીત="itemstyle">
          <xsl:સાથે પરમ નામ="EditMode" પસંદ કરો="$cbq_iseditmode" />
        </xsl:-નમૂનાઓ અરજી>
      </xsl:ક્યારે>
      <xsl:ક્યારે પરીક્ષણ="@ પ્રકાર = 'NewsBigItem'">
        <xsl:-નમૂનાઓ અરજી પસંદ કરો="." રીત="itemstyle">
          <xsl:સાથે પરમ નામ="CurPos" પસંદ કરો="$CurPosition" />
        </xsl:-નમૂનાઓ અરજી>
      </xsl:ક્યારે>
      <xsl:ક્યારે પરીક્ષણ="@ પ્રકાર = 'NewsCategoryItem'">
        <xsl:-નમૂનાઓ અરજી પસંદ કરો="." રીત="itemstyle">
          <xsl:સાથે પરમ નામ="CurPos" પસંદ કરો="$CurPosition" />
        </xsl:-નમૂનાઓ અરજી>
      </xsl:ક્યારે>

      <!--
              આ ગ્રીડ itemstyle.xsl નમૂના પર વર્તમાન સ્થિતિ અને lastrow પસાર.
              ItemStyle.xsl ઓપન અને બંધ સ્રાવ બહાર કાઢે છે કે ઉપયોગ કરશે <ટેબલ> ટૅગ્સ.
      -->
      <xsl:ક્યારે પરીક્ષણ="@ પ્રકાર = 'ગ્રીડ'">
        <xsl:-નમૂનાઓ અરજી પસંદ કરો="." રીત="itemstyle">
          <xsl:સાથે પરમ નામ="CurPos" પસંદ કરો="$CurPosition" />
          <xsl:સાથે પરમ નામ="અંતિમ" પસંદ કરો="$LastRow" />
        </xsl:-નમૂનાઓ અરજી>
      </xsl:ક્યારે>

      <xsl:અન્યથા>
        <xsl:-નમૂનાઓ અરજી પસંદ કરો="." રીત="itemstyle">
        </xsl:-નમૂનાઓ અરજી>
      </xsl:અન્યથા>
    </xsl:પસંદ કરો>
  </xsl:નમૂનો>

ટિપ્પણીઓ ફેરફારો હેતુ વર્ણન.

અલબત્ત, the "OuterTemplate.CallItemTemplate" is itself called from another template. Locate that template by searching for this text string:

<xsl:નમૂનો નામ="OuterTemplate.Body">

OuterTemplate.Body માં સૂચનો મારફતે સ્ક્રોલ અને LastRow પરિમાણ તરીકે નીચે દાખલ કરો (ત્રાંસા એક ટિપ્પણી તરીકે દર્શાવવામાં):

<xsl:કોલ નમૂનો નામ="OuterTemplate.CallItemTemplate">
  <xsl:સાથે પરમ નામ="CurPosition" પસંદ કરો="$CurPosition" />
  <!-- જો LastRow પરિમાણ શામેલ કરો. -->
  <xsl:સાથે પરમ નામ="LastRow" પસંદ કરો="$LastRow"/>
</xsl:કોલ નમૂનો>

આ બધા પછી, અમે છેલ્લે વસ્તુઓ યોગ્ય રીતે જેથી અમારી ItemStyle.xsl સ્રાવ બહાર કાઢી શકે છે કે જે સુયોજિત છે <ટેબલ> જમણી સ્થળ પર ટૅગ્સ.

ItemStyle.Xsl

નોંધ: ફરી, તમે તે ફેરફારો અસર જોવા કે જેથી કોઇ પણ ફેરફારો કર્યા પછી ItemStyle.xsl ચેક.

અમે અહીં બે કાર્યો છે:

  • Replace the entire Grid template. You can copy/paste from below.
  • Add some mumbo jumbo outside the template definition that enables "formatcurrency" template to work. (તમે મને XSL પર બારીક હેન્ડલ છે કે કહી શકો છો).

પ્રથમ, ItemStyle.xsl ટોચ નજીક, આ લીટી ઉમેરો:

  <!-- અમને યુ.એસ. પ્રદર્શિત કરવા માટે સક્રિય કરે છે કે જે અમુક mumbo જમ્બો. ચલણ. -->
  <xsl:દશાંશ ફોર્મેટ નામ="સ્ટાફ" અંક="ડી" />

  <xsl:નમૂનો નામ="મૂળભૂત" મેળ ખાતી="*" રીત="itemstyle">

હું પહેલાં સીધા ઉમેરવામાં નોંધ કરો કે <xsl:template name="Default" …> વ્યાખ્યા.

આગામી, go back to our Grid template. Replace the entire Grid template with the code below. It is thoroughly commented, પરંતુ મને ઇમેઇલ અચકાવું અથવા તમે પ્રશ્નો હોય, તો મારા બ્લોગ પર ટિપ્પણીઓ નથી.

  <xsl:નમૂનો નામ="ગ્રિડ" મેળ ખાતી="પંક્તિ[@ પ્રકાર = 'ગ્રીડ']" રીત="itemstyle">

    <!--
      ContentMain.xsl CurPos અને છેલ્લું પસાર.
      અમે શરતી ઓપન અને બંધ સ્રાવ બહાર કાઢે છે આ વાપરો <ટેબલ> ટૅગ્સ.
    -->
    <xsl:પરમ નામ="CurPos" />
    <xsl:પરમ નામ="અંતિમ" />

    <!-- નીચેના ચલો પ્રમાણભૂત ItemStyle.xsl માંથી સુધાર્યા વિના છે -->
    <xsl:પરિવર્તનશીલ નામ="SafeImageUrl">
      <xsl:કોલ નમૂનો નામ="OuterTemplate.GetSafeStaticUrl">
        <xsl:સાથે પરમ નામ="UrlColumnName" પસંદ કરો="'ImageUrl'"/>
      </xsl:કોલ નમૂનો>
    </xsl:પરિવર્તનશીલ>
    <xsl:પરિવર્તનશીલ નામ="SafeLinkUrl">
      <xsl:કોલ નમૂનો નામ="OuterTemplate.GetSafeLink">
        <xsl:સાથે પરમ નામ="UrlColumnName" પસંદ કરો="'LinkUrl'"/>
      </xsl:કોલ નમૂનો>
    </xsl:પરિવર્તનશીલ>
    <xsl:પરિવર્તનશીલ નામ="DisplayTitle">
      <xsl:કોલ નમૂનો નામ="OuterTemplate.GetTitle">
        <xsl:સાથે પરમ નામ="શીર્ષક" પસંદ કરો="@ શીર્ષક"/>
        <xsl:સાથે પરમ નામ="UrlColumnName" પસંદ કરો="'LinkUrl'"/>
      </xsl:કોલ નમૂનો>
    </xsl:પરિવર્તનશીલ>
    <xsl:પરિવર્તનશીલ નામ="LinkTarget">
      <xsl:જો પરીક્ષણ="@ OpenInNewWindow = 'સાચું'" >_blank</xsl:જો>
    </xsl:પરિવર્તનશીલ>

    <!--
      અહીં આપણે એક ચલ વ્યાખ્યાયિત, "tableStart".  આ એચટીએમએલ પડે
      .  નોંધ કરો કે જો CurPos = 1, જો તે CDATA ટૅગ માં HTML સમાવેશ થાય છે.
      અન્યથા, તે ખાલી રહેશે.

      TableStart ની કિંમત દર વખતે ItemStyle મારફતે કહેવાય છે emited છે
      .
    -->
    <xsl:પરિવર્તનશીલ નામ="tableStart">
      <xsl:જો પરીક્ષણ="$CurPos = 1">
        <![CDATA[
        <ટેબલ સરહદ = 1>
          <tr bgcolor="blue">
            <ટીડી><font color="white"><બોલ્ડ>પ્રોજેક્ટ નામ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
            <td align="right"><font color="white"><બોલ્ડ>તારીખ પૂર્ણ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
            <td align="right"><font color="white"><બોલ્ડ>બજેટ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
            <td align="right"><font color="white"><બોલ્ડ>વાસ્તવિક ખર્ચ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
            <ટીડી><font color="white"><બોલ્ડ>એકંદર સ્થિતિ</બોલ્ડ></ખિસ્ત્રી દેવળનું પવિત્ર જલપાત્ર></ટીડી>
          </ટીઆર>
        ]]>
      </xsl:જો>
    </xsl:પરિવર્તનશીલ>

    <!--
      અન્ય ચલ, tableEnd ખાલી બંધ ટેબલ ટૅગ વ્યાખ્યાયિત.

      TableStart સાથે, તે હંમેશા emited છે.  તેની કિંમત છે આ શા માટે છે
      .
    -->
    <xsl:પરિવર્તનશીલ નામ="tableEnd">
      <xsl:જો પરીક્ષણ="$CurPos છેલ્લું $ =">
        <![CDATA[ </ટેબલ> ]]>
      </xsl:જો>
    </xsl:પરિવર્તનશીલ>

    <!--
      હંમેશા tableStart સમાવિષ્ટો સ્રાવ બહાર કાઢે છે.  આ પ્રથમ નહિં હોય, તો
      , પછી અમે તેની કિંમત ખબર
      .

      બહાર નીકળતો આઉટપુટને નિષ્ક્રિય કારણ કે જ્યારે tableStart તે ખાલી નથી, તે
      .  જો
      , it will generate
      stuff like "&એલટી;ટેબલ&જીટી;" instead of "<ટેબલ>".
    -->
    <xsl:કિંમત ઓફ પસંદ કરો="$tableStart" અક્ષમ-આઉટપુટ-નીકળતો="હા"/>


    <ટીઆર>
      <!--
      પી:Project_x005F_x0020_Name
      :Project_x005F_x0020_End_x005F_x0020_Date
      :Project_x005F_x0020_Budget
      :Project_x005F_x0020_Expenses
      :Project_x005F_x0020_Status
      -->
      <ટીડી>
        <xsl:કિંમત ઓફ પસંદ કરો="@ Project_x005F_x0020_Name"/>
      </ટીડી>

      <ટીડી એક હારમાં લાવવું="અધિકાર">
        <xsl:કિંમત ઓફ પસંદ કરો="@ Project_x005F_x0020_End_x005F_x0020_Date"/>
      </ટીડી>

      <ટીડી એક હારમાં લાવવું="અધિકાર">
        <xsl:કોલ નમૂનો નામ="formatcurrency">
          <xsl:સાથે પરમ નામ="કિંમત" 
પસંદ કરો="@ Project_x005F_x0020_Budget"></xsl:સાથે પરમ> </xsl:કોલ નમૂનો> </ટીડી> <ટીડી એક હારમાં લાવવું="અધિકાર"> <xsl:કોલ નમૂનો નામ="formatcurrency"> <xsl:સાથે પરમ નામ="કિંમત" પસંદ કરો="@ Project_x005F_x0020_Expenses">
</xsl:સાથે પરમ> </xsl:કોલ નમૂનો> </ટીડી> <ટીડી> <xsl:કિંમત ઓફ પસંદ કરો="@ Project_x005F_x0020_Status"/> </ટીડી> <!-- નીચેની બધી વસ્તુઓ સ્પષ્ટ કરવા માટે બહાર ટિપ્પણી થયેલ છે. તેમ છતાં, તેને પાછું લાવવા અને તેને સામગ્રી <ટીડી> તેના માટે જુઓ         . --> <!-- <div id="linkitem" class="item"> <xsl:if test="string-length($SafeImageUrl) != 0"> <div class="image-area-left"> <a href="{$SafeLinkUrl}" target="{$LinkTarget}"> <img class="image-fixed-width" src="{$SafeImageUrl}"
alt="{@ ImageUrlAltText}"/> </એક> </div> </xsl:જો> <div class="link-item"> <xsl:કોલ નમૂનો
name="OuterTemplate.CallPresenceStatusIconTemplate"/> <a href="{$SafeLinkUrl}"
target="{$LinkTarget}" title="{@ LinkTooltip}"> <xsl:value-of select="$DisplayTitle"/> </એક> <div class="description"> <xsl:value-of select="@Description" /> </div> </div> </div>
--> </ટીઆર> <!-- બંધ ટેબલ ટૅગ સ્રાવ બહાર કાઢે છે. અમે લોડ પંક્તિ પર ન હોય તો, આ ખાલી રહેશે. --> <xsl:કિંમત ઓફ પસંદ કરો="$tableEnd" અક્ષમ-આઉટપુટ-નીકળતો="હા"/> </xsl:નમૂનો> <xsl:નમૂનો નામ="formatcurrency"> <xsl:પરમ નામ="કિંમત" પસંદ કરો="0" /> <xsl:કિંમત ઓફ પસંદ કરો='બંધારણમાં નંબર($કિંમત, "$DDD,DDD,DDD.DD", "staff")' /> </xsl:નમૂનો>

22 પર "વિચારોએક ગ્રીડ સમાવિષ્ટ પ્રશ્ન વેબ ભાગ પરિણામો દર્શાવો / ટેબલ

  1. એન્ડ્રેસ

    તે લગભગ મારા માટે કામ કર્યું: હું આઉટપુટ માટે મેનેજ કરો </ટેબલ> સાચી ટૅગ અંત, પરંતુ શરૂ ટૅગ ગુમ થયેલ છે. It seems the test="$CurPos = 1" સાચું પાછા નથી. પરંતુ શા માટે?

  2. લિસા

    તમે વૈવિધ્યપૂર્ણ ContentQueryMain અને ItemStyle xsl ફાઈલો બનાવવા સાથે કોઇ પણ કાર્ય કર્યું છે? હું પૂછી કારણ હું મારા વૈવિધ્યપૂર્ણ શૈલીઓ કોઈપણ પેચો અથવા સુધારાઓ સાથે ફરીથી લખાઈ હોવા અંગે ચિંતા કરવા માંગો છો નથી. તમે ઉદાહરણો પાસે? હું પ્રકાર લાયબ્રેરી માટે ContentQueryMain.xsl અને અપલોડ કે નવા કસ્ટમ નકલ એક સરખા નકલ બનાવવા પ્રયત્ન કર્યો છે. આ. Webpart માતાનો MainXslLink મિલકત આ xsl ફાઈલ સંદર્ભ મૂકે ત્યારે, હું વિચાર 401 અધિકૃત નથી. વૈવિધ્યપૂર્ણ xsl ફાઇલ પ્રકાશિત આવૃત્તિ છે અને દરેકને તે વાંચવા માટે છે.

  3. ગ્રેગ શેરિડેનની

    મહત્તમ, આ પોસ્ટ ખરેખર મદદરૂપ હતી. હું તે બધા કામ છે, અને પણ માઇક બ્રાઉન માતાનો ફેરફાર અમલમાં તે જૂથો જેથી
    હું CQWB માતાનો ગુણધર્મોમાં પરિમાણ સુધીમાં ગ્રુપ તરીકે પસંદ ગમે દ્વારા ટેબલ અંદર પરિણામો.
    હું એક લિંક પણ શીર્ષક બનાવવામાં, તેથી તે સરસ રીતે કામ કરે છે. હું હજુ પણ એક સમસ્યા છે, છતાં. હું સાઇટ નામ દ્વારા પરિણામો વર્ગીકરણ છું. ટેબલ પર આધારિત, સરસ રીતે તે જૂથો તેમને, અને તે મહાન લાગે છે, પરંતુ તે હજુ પણ બધા જૂથ બહાર છાપવા છે
    નામો(મારા કેસ સાઇટ નામોમાં) ટેબલ ઉપર. કોઈને આ છુટકારો મેળવવા માટે કેવી રીતે ખબર નથી?
    આભારદર્શક શબ્દો,
    ગ્રેગ

  4. કોઈ નામ

    સરસ લેખ. હું યાદીના સ્ત્રોત કોડ વિશ્લેષણ કરીને મારા ટેબલ મૂળભૂત શેરપોઈન્ટ યાદી દેખાવ આપવા વ્યવસ્થાપિત. અહીં ItemStyle ફિટ કરવા માટે જરૂરી મુખ્ય HTML બ્લોક્સ છે:

    <TABLE width="100%" class="ms-listviewtable" border=0 cellspacing=0 cellpadding=1 dir="None">

    <!–HEADER–>
    <TR class="ms-viewheadertr" સંરેખિત = ટોચ>
    <TH nowrap scope="col" class="ms-vh2"><div style="width:100%;સ્થિતિ:સંબંધિત;બાકી:0;ટોચ:0;">
    <TABLE style="width:100%;" CtxNum="1" height="100%" cellspacing=1 cellpadding=0 class="ms-unselectedtitle">
    <TR>
    <TD width="100%" Class="ms-vb" nowrap>
    Texte ડુ titre ICI

    </ટીડી>
    <TD style="position:નિરપેક્ષ;">
    </ટીડી>
    </TR>
    </TABLE></div>
    </ટીએચ>

    <!–બધા હેડર કોષો માટે પુનરાવર્તન કરો–>
    </TR>

    <!– કોષ્ટક માહિતી –>
    <TR class="">
    <!–માહિતી કૉલમ, જો હાયપરલિંક સાથે પ્રથમ એક પોલ કોડ ઉપયોગ –>
    <TD Class="ms-vb2">અહીં માહિતી</ટીડી>

    <!–ખાલી કૉલમ–>
    <TD Class="ms-vb2">
    <span dir = નહીં></વેંત><
    /ટીડી>

    <!–તારીખ કૉલમ–>
    <TD Class="ms-vb2">
    <NOBR>11/12/2008</NOBR>
    </ટીડી>
    </TR>

    <!–***વૈકલ્પિક પંક્તિ – વર્તમાન પંક્તિ એડિશનનો 2 પર આધારિત વૈકલ્પિક વર્ગ સામેલ કરશે કે નવી XSL ચલ વાપરો–>
    <TR class="ms-alternating">

    </TR>
    </TABLE>

  5. માઇક બ્રાઉન
    Zoltan,
    I was working on the same issue as you. I wanted all my items displayed in a grouped manner rather than just a lits. Here is how I achieved it.
    ContentQueryMain.xsl
    <xsl:when test="@Style=’Grid’">
    <xsl:apply-templates select="." mode="itemstyle">
    <xsl:with-param name="CurPos" select="$CurPosition" />
    <xsl:with-param name="Last" select="$LastRow" />
    <!–નવું જૂથ શરૂ થઇ ગયું છે સૂચવે પરિમાણ માં પસાર કરવા માટે આ નવો વિભાગ ઉમેરો–>
    <xsl:with-param name="StartNewGroup" select="@__begingroup" />
    </xsl:-નમૂનાઓ અરજી>
    </xsl:ક્યારે>
    ItemStyle.xsl
    તમારી પરિમાણ ઉમેરો
    <xsl:param name="StartNewGroup"/>
    માહિતી પ્રથમ પંક્તિ તરીકે આ ટેક્સ્ટ ઉમેરો
    <xsl:પસંદ કરો>
    <xsl:when test="$StartNewGroup = ‘True’">
    <ટીઆર>
    <ટીડી >
    <xsl:call-template name="OuterTemplate.GetGroupName">
    <xsl:with-param name="GroupName" select="@*[નામ()= $ ગ્રુપ]"/>
    <xsl:with-param name="GroupType" select="$GroupType"/>
    </xsl:કોલ નમૂનો>
    </ટીડી>
    </ટીઆર>
    </xsl:ક્યારે>
    <xsl:અન્યથા>
    </xsl:અન્યથા>
    </xsl:પસંદ કરો>
    This should take care of your grouping issue in your grid. Each group will now begin with a new row indicating the group name. In my solution I actually added a blank <ટીડી /> તેમજ તેથી તે ઇન્ડેન્ટ માટે માહિતી માં જૂથ ખૂબ સારી બહાર હતી.
    Site1
    datacolumn1 datacolumn2 datacolumn3 etc

    datacolumn1 datacolumn2 datacolumn3 etc
    Site2
    datacolumn1 datacolumn2 datacolumn3 etc
    Site3

    datacolumn1 datacolumn2 datacolumn3 etc

    datacolumn1 datacolumn2 datacolumn3 etc
    વગેરે.
  6. Zoltan
    પીડી હેલો,
    પોસ્ટ માટે આભાર, હું એક ગ્રીડ મારા ક્વેરી પરિણામો આયોજન વ્યવસ્થાપિત, ખૂબ જ ઉપયોગી છે કે જે. તેમ છતાં, હું વધુ જાઓ અને સાઇટ્સ પર આધારિત છે જૂથ મારા પરિણામો જોઈએ. આ ક્ષણે, સાઇટ નામો પ્રથમ યાદી થયેલ છે, અને પછી માત્ર એક મોટા ગ્રીડ વિવિધ સાઇટ્સ બધી પંક્તિઓ ત્યાં ભેગી થયેલ છે. આ કંઈક:
    Site1 નામ
    Site2 નામ
    બધા સાઇટ્સ માટે ગ્રીડ માં માહિતી
    હું નીચે પ્રમાણે મારા માહિતી વિચાર કરવા માટે સંશોધિત જોઈએ તે વિશેના વિચારો:
    Site1 નામ
    Site1 માટે ગ્રીડ માં માહિતી
    Site2 નામ
    Site2 માટે ગ્રીડ માં માહિતી
    અગાઉથી આભાર,
    Zoltan
  7. પિયર Joubert
    વિચિત્ર પોસ્ટ, હું હતી મારી સમસ્યા હલ.
    મારી જ મુદ્દો AssignedTo ક્ષેત્ર પ્રદર્શિત થાય છે, I configure it with the "User" ફીલ્ડ પ્રકાર અને આયાત webpart પછી નીચેની ભૂલ દર્શાવે છે:
    "There was an error retrieving data to display in this Web Part."
    હું બધા શક્ય ક્ષેત્ર પ્રકારના ઉપયોગ કરીને કર્યો છે, with anything other that "User" તે ભૂલ પ્રદર્શિત નથી, but it does not display anything in the field. So I am assuming the User field type is correct, so I must be missing a setting somewhere.
    આ વિશેના વિચારો?
    સાદર
    પિયર
  8. Charftong
    ગ્રેટ પોસ્ટ!!! ખૂબ ખૂબ જ ઉપયોગી.
    ક્વિક પ્રશ્ન, તમે હાજરી સાથે AssignedTo અથવા ModifiedBy ક્ષેત્રો પ્રદર્શિત પર કોઇ પણ કાર્ય કર્યું છે? કેટલાક કારણોસર, હું CQWP માં ક્ષેત્ર સોંપેલ dipslay કરવાનો પ્રયાસ કરો ત્યારે, it always displays with as an example "203;#Charf Tong". I cant find a way around this.
  9. જેનિફર ડેવિસ
    પોલ
    ગ્રેટ લેખ, આભાર. હું ખૂબ જ કંઈક કરી પરંતુ યાદીમાં બદલે વસ્તુ કરતાં પ્રોજેક્ટ સાઇટ પર એક લિંક પ્રદર્શિત કરવા માંગો છો છું. ઉદાહરણ તરીકે, અમે 25 ટોચના સ્તરના પ્રોજેક્ટ સાઇટ્સ અને દરેક સામગ્રી પ્રકારોને સાથે યાદી સમાવી. આ પ્રોજેક્ટ નામ છે, ડિવિઝન, વર્ણન. હું આ માહિતી ખેંચવાનો સામગ્રી ક્વેરી વેબ ભાગ ઉપયોગ કરવા માંગો છો અને URL યાદીમાં આઇટમ પ્રવેશ મને લાગે છે અને હું ખરેખર તે પ્રોજેક્ટ સાઇટ પર મને લેવા માટે જરૂર મૂળભૂત રીતે, સિવાય કે સફળ. તમે મને કોઈ સલાહ આપી શકે છે?
    આભાર
    જેન
  10. કિયરન લખ્યું:

    મહત્તમ પીડી,

    આ XML / xsl અને સામગ્રી ક્વેરી વેબ ભાગ સાથે કામ ત્યારે, તમે તમારા XSLT સ્વરૂપિત કરવા માટે કોઈપણ સારી રીતે મળી છે? ફેરફારો કરો અને ડિઝાઇનના પરીક્ષણ કરવાનો પ્રયાસ કરી રહ્યા માત્ર લખાણ સંપાદકની મદદથી એક ** એક અધિકાર પીડા પુરવાર…

    તમામ શ્રેષ્ઠ

  11. માઈકલ Dipay
    Regarding the issue I was having last time where it doesn’t display the images from the grid view but instead displays the text (https://myweb.com/Marketing/images/icn-order.gif,). હું કસ્ટમ દૃશ્ય બનાવવા અને હું પ્રદર્શિત કરવા માંગો છો કે જે વૈવિધ્યપૂર્ણ કૉલમ્સ પસંદ દ્વારા શેરપોઈન્ટ ડિઝાઈનર ની મદદ સાથે તે ઉકેલવા માટે મેનેજ કરો. હું છબીઓ સ્તંભ પ્રકાર URL તરીકે બતાવવામાં આવે છે કે મળી(અલ્પવિરામચિહ્ન) (e.g. https://myweb.com/Marketing/images/icn-order.gif,). વર્તમાન બંધારણમાં લખાણ છે, તેથી હું સામાન્ય xsl માંથી ચિત્ર માટે તેને બદલી છે:કિંમત ઓફ બાબતો -> ચિત્ર તરીકે ફોર્મેટ. હું બતાવવા માગતા હતા કે વૈવિધ્યપૂર્ણ છબીઓ આ ફેરફાર પ્રદર્શન. હું છબી બતાવવા માટે કોડ નકલ ( <img સરહદ ="0" src="{શબ્દમાળા-પહેલાં(@ IcnOrder, ', ')}" /> ) And in the ItemStyle.xsl file I have to change the @PICTURECOLUMNNAME to the code <img સરહદ ="0" src="{શબ્દમાળા-પહેલાં(@ IcnOrder, ', ')}" /> . પછી તેને સંગ્રહો. હવે મારા ટેબલ ગ્રીડ પરિણામો લખાણ તેમજ કસ્ટમ છબી પ્રકાર કૉલમ બતાવવા માટે.
  12. હેલેન
    મહત્તમ પીડી,
    મહાન લેખ માટે આભાર!
    તમે શરતી સ્વરૂપણ ઉલ્લેખ કર્યો છે – "You can also put in conditional formatting, such as displaying projects who have exceeded their budget in red." Do you happen to have a code example for that?
    આભાર ફરી!
    હેલેન
  13. માઈકલ Dipay
    મહત્તમ પીડી,
    It was a great article and was able to generate the same results as expected. હું તેના કૉલમ એક તરીકે ગ્રીડ એક છબી બતાવવાની જરૂર છે. તે ગ્રીડ પર ઇમેજ પ્રદર્શિત નથી પરંતુ તેના બદલે URL ને એક સાથે છબી દર્શાવે છે (,) ઓવરને અંતે અલ્પવિરામ.
    (e.g. https://myweb.com/Marketing/images/icn-order.gif, )
    હું CommonViewFields ફીલ્ડ પ્રકાર માં ઈમેજ અથવા ચિત્ર વાપરવું જોઈએ? (e.g. InternalColumnName, છબી)
    આભારદર્શક શબ્દો,
    ધ્વનિવર્ધક યંત્ર
  14. Saji Ijiyemi

    Your post is exactly what I was looking for. તેમ છતાં, I can’t get it to work.

    I have documents that are stored in various doc. libraries but classified using a custom class column (વિકલ્પ: 1 અથવા 2. I want to use CQWP to show these documents based on thier class.
    I was able to add the CQWP, export it to SPD, configure the itemStyle.xls to show custom fileds in list view. તેમ છતાં, I could not successfully implement what you describe here.

    These are the columns I want to show in my CQWP:

    File Type (to show icon)
    File Title
    Date Last Modified
    Modified By Who
    Checked Out To
    Checked In Comments

    I currently have the result in a list format. How do I change it to a talble format.

    આભારદર્શક શબ્દો.

    Saji

એક જવાબ છોડો માઈકલ Dipay જવાબ રદ કરો

તમારું ઇમેઇલ સરનામું પ્રકાશિત કરવામાં આવશે નહીં. જરૂરી ક્ષેત્રો ચિહ્નિત થયેલ છે *