How can I eliminate the gaps between sections if some sections are hidden? - InfoPath Dev
in

InfoPath Dev

How can I eliminate the gaps between sections if some sections are hidden?

Last post 11-17-2016 11:29 AM by AndreaP. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-01-2012 04:43 PM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    How can I eliminate the gaps between sections if some sections are hidden?

    I have 4 sections on my form (IP 2007) - the 2nd section, section2 is hidden if it is not needed (if checkbox2 = FALSE, section2 hidden).

    When section2 is hidden, in client form after the form is submitted to SharePoint (not using browser forms)),  there is a huge gap between section1 and section3.  When I hover the mouse over section 1 in client,  the dotted border appears around section1.  In Design mode this gap appears in Design mode but it is not quite as large.  Each section has a table, with section in table rows. I have zero'd all padding in the sections and in cells to prevent gaps but to no avail.

    How can I eliminate the gaps between sections when a section is hidden?

  • 05-01-2012 06:24 PM In reply to

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    Make sure any layout table rows are set to auto for height.

    Hilary Stoupa

  • 05-03-2012 08:51 AM In reply to

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    I came across this same issue.  When a section was hidden I'd have a large space between other sections.  For some reason gaps between sections are saved somehow.  You can chck this by selecting the section which is going to be hidden and cut it.  After you cut the section, if you have a big gap between both sections, click in the gap and delete/backspace until both sections come together.  Select a line between the sections and paste your section back in.  This is how I got around this.

     

    Regards

  • 12-06-2012 04:57 PM In reply to

    • Nickers52
    • Not Ranked
      Male
    • Joined on 12-06-2012
    • Sacramento
    • Posts 3

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    I have set all rows in all tables in all sections to auto for height. Still I have one px (or maybe 1pt) worth of space for each hidden section. I have a form with 10 major columns and a help button for each. There are eleven hidden sections between the heading row and the detail rows. So there are 11 pixels of space until you click a help button. I renamed the xsn to cab (I know you can also export from within InfoPath, but the rename  is easier) and edit the xsl files separately and I was able to remove all the space that was there from simply designing with InfoPath except for the one pixel.  In the first "style controlstyle" there is embedded ".xdSection{border:1pt solid transparent ;margin:0px 0px 0px 0px;padding:0px 0px 0px 0px;}" (and also a similar xdRepeatingSection and an xdSignatureLine with same parms). I tried changing them from "1pt solid transparent" to "none" and InfoPath just changed it back.  I tried changing it to "0pt solid transparent" and it left it that way, but I still get the space. I am going to keep at this until I figure it out, but a little help would be much appreciated if anyone has another tricks in mind.
  • 12-06-2012 05:53 PM In reply to

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    My latest thing is changing the colors on EVERYTHING so I can see what is taking up space. But you might want to use a single section and put in 11 expression boxes (calculated values) and show / hide the expression boxes instead of the section....
    Hilary Stoupa

  • 12-07-2012 08:05 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    Some things I do for rows which you've already done is to set row height to auto.  The other thing I do for hidden sections is set the section height to auto and width to 100% if practical. I also remove borders (if not needed) to reduce gaps.  These things, for the most part take care of most of my gap issues.

    I do experience those 1 pixel gaps from time to time - it is annoying and make the report look unprofessional. 

  • 12-07-2012 11:48 AM In reply to

    • Nickers52
    • Not Ranked
      Male
    • Joined on 12-06-2012
    • Sacramento
    • Posts 3

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    Thanks for the suggestions, ladies. Hilary, the form already was in color, that's why the whitespace was so annoying. Doreen, I clicked each section on the form and on the "Control Tools" ribbon "Properties" tab I checked everything. The bottom margin was set to 0 px and the other three said "Auto". I changed all of them to 0, no difference. I changed all of them to auto, no difference. I also realized I also have two sections that are never hidden with nothing in between and yet there is always one pixel row between the sections. I have editted the xsl file and changed all occurrences of 1px to 0 px, to 10 px, to -1px, 1pt to 0 pt, 10pt, etc., changed all occurrences of transparent to black, white to black, #ffffff to #000000, many many changes, too numerous to remember, let alone mention. That one pixel row between each section would not go away. Then I realized my problem.  I had put each section inside a table cell. Even though the table was only one column wide so when I hid a section I was emptying the whole row. I guess it still needed to be represented somehow. If you leave a row in a table empty you still can't set the row height to less than 4, so I am surprised that I didn't have that much gap for each row.

    Basically, I was converting an Excel spreadsheet to a form we could implement on SharePoint.  It had one sheet as a form and one sheet of instructions.  I was putting it all in a single form with the instructions hidden unless you click a little button. I started with a table with one column and 16 rows. In each row I put a section and in each section a table containing a portion of the cells of the spreadsheets.
    I simply cut each section from the table it was in and pasted it outside the table, one after the other and everything looks good now.

  • 12-07-2012 12:15 PM In reply to

    • Nickers52
    • Not Ranked
      Male
    • Joined on 12-06-2012
    • Sacramento
    • Posts 3

    Re: How can I eliminate the gaps between sections if some sections are hidden?

    Well, the gaps were gone in the InfoPath preview, but when I choose the option to use it in a web browser instead of InfoPath Filler the gaps are back but each only 1 pixel instead of one for each hidden section. Also, 3pt borders in some places display as they should and most other places they have a gap so it's 1pt black on both sides of a 1pt gap which is grey or white or most often matches the background of one of the adjacent cells.  Well, IE is the default browser, I wonder what it looks like with the other browsers.
  • 11-17-2016 11:29 AM In reply to

    Re: How can I eliminate the gaps between sections if some sections are hidden?

     What type of sections should we be using? I use Facultative Section so there's always a link no matter if I put the rule 'Hidden if checkbox=false'

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