Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] Re: table with dynamic column-width using FOP

Expand Messages
  • Unknown
    Amit just try this code
    Message 1 of 6 , Dec 12, 2003
    • 0 Attachment
      Amit just try this code

      <xsl:template match="tablequestion">
      <xsl:variable name="cell">
      <xsl:value-of select="count(ancestor::table/row[position()=1]/tablequestion)"/>
      </xsl:variable>
      <xsl:variable name="flag">
      <xsl:value-of select="count(parent::table/row[position()=1])"/>
      </xsl:variable>

      <xsl:variable name="cellSpan">
      <xsl:choose>
      <xsl:when test="$cell=2">
      <xsl:value-of select="'100'"/>
      </xsl:when>
      <xsl:when test="$cell=3">
      <xsl:value-of select="'67'"/>
      </xsl:when>
      <xsl:when test="$cell=4">
      <xsl:value-of select="'50'"/>
      </xsl:when>
      <xsl:when test="$cell=5">
      <xsl:value-of select="'40'"/>
      </xsl:when>
      <xsl:when test="$cell=6">
      <xsl:value-of select="'33'"/>
      </xsl:when>
      <xsl:when test="$cell=7">
      <xsl:value-of select="'29'"/>
      </xsl:when>
      <xsl:when test="$cell=8">
      <xsl:value-of select="'25'"/>
      </xsl:when>
      <xsl:when test="$cell=9">
      <xsl:value-of select="'22'"/>
      </xsl:when>
      <xsl:when test="$cell=10">
      <xsl:value-of select="'20'"/>
      </xsl:when>
      <xsl:when test="$cell=11">
      <xsl:value-of select="'18'"/>
      </xsl:when>
      <xsl:when test="$cell=12">
      <xsl:value-of select="'16'"/>
      </xsl:when>
      <xsl:otherwise>
      <xsl:value-of select="'14'"/>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:variable>
      I cannt explain this to u right now but Iam sure it will help. Just decalare around 220 cells for your table and using the above if statements you can change the width of these columns.

      Anshul katoch


      inderbir_ruby <inderbir_ruby@...> wrote:
      Hi Amit,

      From what i understand from ur posting is that number of columns to
      be shown in a a table are dependent upon some data (probably from
      xml or so).
      Well one way of doing thing is that you can define various
      templates containing tables with diff number of columns in it.

      Depending upon ur condition u can call the desired template.







      Hope this helps..

      Inderbir.



      --- In XSL-FO@yahoogroups.com, "amit_gupta21"
      wrote:
      > Hi,
      >
      > I am using Apache FOP to generate data in PDF format. I was trying
      to
      > create a table with dynamic column-width but failed. Just
      wondering
      > if we could create table without specifying column width using
      FOP.
      >
      > thanks
      > Amit



      To unsubscribe from this group, send an email to:
      XSL-FO-unsubscribe@egroups.com



      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


      Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.