Is there an easy way of having a conditional carriage return on print view - InfoPath Dev
in

InfoPath Dev

Is there an easy way of having a conditional carriage return on print view

Last post 01-27-2009 05:35 PM by Ian Dawson. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-19-2009 04:47 PM

    • Ian Dawson
    • Top 50 Contributor
      Male
    • Joined on 01-01-2009
    • Shellharbour NSW Australia
    • Posts 154

    Is there an easy way of having a conditional carriage return on print view

    I have many lines of code, as mentioned in eartlier posts regarding how to limit text output.

    But my question now is,

       In some instances, I would like to separate blocks of text from other text.  As a paragraph.

    Each paragraph could be quite long. So I don't want to insert an expression box with dozens of conditions built in.

     

    So I thought how about one control applying a carriage return, linefeed.  (chr(10) and chr(12)  Basic+ formats etc etc) 

     Any clues anyone?

    LET ME BE CLEARER

    I have a large Print View screen,  i.e.  many Controls and expression boxes. All of which are optionally  (Check box selected) printed out.

    The issue is, Sometimes, depending on what is selected, I would like to see a Carriage return / Line feed inserted.
    This insertion is ALSO optionally selectable.

     Any Clues anyone????

  • 01-20-2009 01:00 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Is there an easy way of having a conditional carriage return on print view

    Hello,

    You have to write the code to set one filed value either true or false depends on your print view condition. You can use that field value to print those or not.

  • 01-20-2009 04:14 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Is there an easy way of having a conditional carriage return on print view

    Instead of an expression box, could you just use a normal textbox bound to a field, and set the field equal to the 'string-concatenate' of all the other fields where the paragraphs are?

    Then set the text box as read only and change the formatting to look like an expression box.

    Not sure if this is what you are after.

  • 01-21-2009 01:29 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Is there an easy way of having a conditional carriage return on print view

    Revisintg his post - and seeing the 'let me be clearer' bit which I may have missed first time around, or is new information, I have the following suggestion.

    Instead of having a sequence of expression boxes themselves each conditionally hidden, stick them in a sequence of sections (one per expression box) that are conditionally hidden (based on your checkboxes as before).

    You can use the same datasource group bound to the sections - Infopath remembers each of the individual conditional formatting, so you don't need to make many many data-source groups, just one.

    Now, for the ones you want to have carriage returns, put a carriage return after the expression box, but still inside the section it resides in.

    Wa lah! those sections when visible will have a carriage return, and the others will not.

    Hope this helps.

  • 01-23-2009 10:36 PM In reply to

    • Ian Dawson
    • Top 50 Contributor
      Male
    • Joined on 01-01-2009
    • Shellharbour NSW Australia
    • Posts 154

    Re: Is there an easy way of having a conditional carriage return on print view

    Yes that seems to make sense. I will try it out next week, and let you now how it will work, and fit my needs. But it does sond pretty well right. Thanks again
  • 01-24-2009 02:06 AM In reply to

    • Ian Dawson
    • Top 50 Contributor
      Male
    • Joined on 01-01-2009
    • Shellharbour NSW Australia
    • Posts 154

    Re: Is there an easy way of having a conditional carriage return on print view

    It all sounded so promising :-)

    I constructed several sections, and inserted one sentence to each section. 

    But, when testing,  I am faced with a new line with each section in the printview.
    So if I have a separate section for each sentence.
    I will end up with 1 sentence paragraphs. That is not desired  :-(

    I thought of having just one section for all the sentences including and before the sentence (if selected) that requires the CR.

    And another section after, for all the other trailing sentences. 
    I still end up with a newline whether I want it or not. 
    I removed all CRs in each section that I created.
    I also note that you cannot abut sections on the same line.
    There seems to be a built in CR after each section.

    Am I seeing your solution correctly??

     

  • 01-24-2009 03:39 PM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Is there an easy way of having a conditional carriage return on print view

    By default sections have margins and borders set on.

    Check out the attached demo form - and see if this is what you are trying to do - I may not understand your need.

    To set margins: right click section and select properties -> size tab -> put 0 px in all the margin boxes

    To set borders: right click section and select borders and shading -> go to the borders page, and deselect all the border option - It LOOKS like there are no borders, but there ARE - they are clear and take up 1 px, if you unselect the border buttons, you will see what I mean.

    Hope this helps - I will be on leave for 3 weeks now - If it still not working for you, and you still need help when I come back - I will endevour to help - otherwise someone else may be able to :-)

    Good luck.

  • 01-27-2009 05:35 PM In reply to

    • Ian Dawson
    • Top 50 Contributor
      Male
    • Joined on 01-01-2009
    • Shellharbour NSW Australia
    • Posts 154

    Re: Is there an easy way of having a conditional carriage return on print view

    Thanks for the info about margins skarn. But it didn't answer the question.

    I have found by adding a section,  and applying a condition to the section I can insert a Carriage Return.
    The only data in the section is a CR of course. 

    But, I am not sure at this point, if the fact that the CR is there in the form, a lCR is forced, regardless of the condition being true.

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.