Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Touhid 97 posts 117 karma points
    Dec 27, 2010 @ 09:10
    Touhid
    0

    problem to work with pdf

    Hi

    I have used the following code:

    <fo:block width="320px" float="left" margin-top="0px">
    - Weatherdeck:<xsl:value-of select="$currentPage/ weatherdeck"/>
    </fo:block>

    Here, weatherdeck is page field. and output is-

    - Weatherdeck:70,90 x 17,30 m70,90

    But i want that it will show following format:

    - Weatherdeck:            70,90 x 17,30 m70,90

    just need to a specific gap. pls any body help me.

     

    Touhid

     

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 27, 2010 @ 10:16
    Kim Andersen
    0

    Hi Touhid

    So you just want to put in more space between the "Weatherdeck:" and the numbers, right?

    You should be able to do this in several ways. either you could insert some   between the two bocks, this would cause some empty space. Otherwise you can insert some spaces by using something like this:

    <xsl:text>      </xsl:text>

    You could also put the two blocks into two seperate span-tags, and then put some margin on one of the two span's.

    I hope that's what you are looking for.

    /Kim A

  • Touhid 97 posts 117 karma points
    Dec 27, 2010 @ 11:07
    Touhid
    0

    Hi kim

    thnks for reply. i need to specific empty space. like 20px or 2.3 cm . how can do this?

    Touhid

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Dec 27, 2010 @ 11:10
    Sebastiaan Janssen
    0

    Not sure how it would work with the pdf creator, but how about just using a good old <table> to do this?

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 27, 2010 @ 11:28
    Kim Andersen
    0

    You can try out the table-method that Sebastiaan suggested (I actually thought of this as well, but I don't like tables when it's just one row :D ), or else you should try out the span-tag solution I mentioned in my first post.

    Just by putting the two blocks into span-tags like this:

    <span>- Weatherdeck:</span><span><xsl:value-of select="$currentPage/ weatherdeck"/></span>

    Then you should be able to give one of the span's a margin of 20 px.

    /Kim A

  • Touhid 97 posts 117 karma points
    Dec 27, 2010 @ 11:49
    Touhid
    0

    I put them but it doesnt work:

    <fo:block width="320px" float="left" margin-top="0px">
    <span>- Weatherdeck:</span>
    <span><xsl:value-of select="$currentPage/ weatherdeck"/></span>
    </fo:block>

    Touhid

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 27, 2010 @ 12:01
    Kim Andersen
    0

    You need to put some margin on one of the span-tags (and maybe some float:left on the span's as well). I'm not sure if you can use an external stylesheet for this, but otherwise you should be able to put on some inline syling like you did on your fo:block.

    /Kim A

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 27, 2010 @ 12:02
    Jan Skovgaard
    0

    Hi Touhid

    As Kim is saying you need to add a margin to one of the span elements. Try for instance writing this: <span style="margin-right:20px">Weatherdeck</span>

    /Jan

  • Touhid 97 posts 117 karma points
    Dec 27, 2010 @ 13:05
    Touhid
    0

    Hi

    thnks. i put this but it shows only: -Weatherdeck

    <fo:block width="320px" float="left" margin-top="0px">
    -Weatherdeck
    <span style="margin-left:20px"><xsl:value-of select="$currentPage/ weatherdeck"/></span>
    </fo:block>

    Note: This code i used in pdf creator.

    Touhid

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 27, 2010 @ 15:13
    Kim Andersen
    0

    Hmm....I'm not sure if the creation of the pdf, strips the html-tags that we are inserting.

    But in the code that you provided above, could you try changing that to:

    <span style="float:left">-Weatherdeck</span>
    <span style="float:left;margin-left:20px"><xsl:value-of select="$currentPage/ weatherdeck"/></span>

    If this was rendered as normal html, then it would work. But I'm not quite sure if the transformation from XSLT to pdf, strips the html-tags and everything in it, as it looks like that, when you say that the $currentPage/weatherdeck is not rendered.

    /Kim A

  • Touhid 97 posts 117 karma points
    Dec 28, 2010 @ 10:13
    Touhid
    0

    HI kim

    Sory, that doesnt work and thnks you for reply me manytimes. but i have done this using following this code:

    <fo:block width="320px" float="left" margin-top="0px">
    <fo:list-block>
    <fo:list-item>
      <fo:list-item-label>
        <fo:block>-Weatherdeck</fo:block>
      </fo:list-item-label>
      <fo:list-item-body>
        <fo:block margin-left="150px"><xsl:value-of select="$currentPage/ weatherdeck"/>
    </fo:block>
     </fo:list-item-body>
    </fo:list-item>
    </fo:list-block>
    </fo:block>

     

    Touhid

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 29, 2010 @ 17:43
    Kim Andersen
    0

    Ahh great, so you actually made it work now?

    Didn't know that you needed to build the code like that to make it work when you transformed it into a PDF-file. May I ask how you convert it to a PDF? You use a umbraco PDF creator package or a third party service or how do you do it? I'm just curious ;)

    /Kim A

  • Touhid 97 posts 117 karma points
    Dec 31, 2010 @ 05:51
    Touhid
    0

    Hi Kim

    Its late. So dont mind. Yeh, its work fine. I have got the idea from w3schools.com and also used a pdf creator package .But i think the package is not complete for work.

    kim im not expert in umbraco, just learning and trying to learn much.

    Kim, im in another problem. The problem is like as , follow the link:

    http://www.scan-trans.com/history.aspx?STCNAV_ID=44&SUBSTCNAV_ID=11&bcrumb1=HOME&bcrumb2=ABOUT+US&bcrumb3=HISTORY

    Here is a dropdown, the dropdown contains some year and when a year is selected the corresponding content is show. So how can do this??

    Have you any idea ?

    Touhid

  • Kim Andersen 1447 posts 2197 karma points MVP
    Jan 02, 2011 @ 18:53
    Kim Andersen
    0

    Touhid, the way that such a dropdown could work would be to get the parameters from the URL, and then use those params as a filter of what to show on the page.

    If you just want to filter by year, then you probably only need one parameter in the URL. Eg. the URL could look something like this: domain.com/some-page.aspx?year=2005. Then in your XSLT(or .NET - whatever you preffer) you would grab the year-parameter and use this as the filter. Does it make sense?

    /Kim A

     

  • Touhid 97 posts 117 karma points
    Jan 03, 2011 @ 06:36
    Touhid
    0

    Hi Kim

    Thnks for give me the idea. The dropdown, which contain the years, is it in this way in xslt file:

    <option selected="selected" value="- Select a Year -">- Select a Year -</option>
     <option value="1975">1975</option>
     <option value="1995">1995</option>
     <option value="1996">1996</option>
     <option value="1997">1997</option>
     <option value="1998">1998</option>
     <option value="1999">1999</option>
     <option value="2000">2000</option> 

    Can you help me by give xslt code ?

    Touhid

  • Kim Andersen 1447 posts 2197 karma points MVP
    Jan 03, 2011 @ 08:53
    Kim Andersen
    0

    First of all you need to grab the value of the year-parameter. You can do this by using this small piece of code:

    <xsl:variable name="year" select="umbraco.library:Request('year')" />

    Now $year will have the value of the year-parameter, and then you can use this to filter your result using either a <xsl:choose>, <xsl:apply-templates> or whateve you preffer.

    When you change the value in the dropdown have you gotten the correct year-value in your url?

    /Kim A

  • Touhid 97 posts 117 karma points
    Jan 03, 2011 @ 09:04
    Touhid
    0

    Hi Kim

    Thnks. Its a good idea. Im doing that.

    Touhid

  • Kim Andersen 1447 posts 2197 karma points MVP
    Jan 03, 2011 @ 10:11
    Kim Andersen
    0

    Great. If you have further questions just ask and we'll fint a solution...

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft