Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible? - InfoPath Dev
in

InfoPath Dev

Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

Last post 08-27-2009 11:27 AM by Francis. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 08-21-2009 09:56 AM

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    I have a section with a repeating table and field headings inside it.  One of the fields is for currency, e.g., "Dollar", "Pound", "Franc", etc (via a drop-down list box).  Users can choose from 1 of 2 accounts.  One account uses several currencies, while the other is only in Dollars.  Otherwise, all the fields are the same in the 2 repeating tables.  Since the Dollar-only account doesn't need the currency field ("Dollar" is the default value), I would like the user not even have to see this field and heading.  How can I make this field and heading invisible, or to make the width 0, when the user chooses the Dollar-only account?

    I tried conditional formating, but it is still visible even though I disable it or hide it.  Can this be done with a rule (I'm not a programmer), or if not, can it be done with code?

    I did create 2 identical sections and repeating tables with the currency field and heading manually shrunk as much as possible in one of the repeating tables.  I then used conditional formating to hide one or the other section and repeating table, depending on the account chosen.  However, I'm not sure that this is the best method, especially since both are bound to the same data source. I may also need to add other accounts, and may have to do something similar to other fields.

    By the way the data source is a SQL Server endpoint used as the web service that uses stored procedures with input parameters, e.g., the account ID is an input parameter.

  • 08-24-2009 04:29 PM In reply to

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    This should be possible using conditional formatting. Can you explain what conditional formatting you used and how it is not working? You shouldn't need go get into code for this. It's a matter of setting the right condition to hide the field when the user makes a selection elsewhere on the form.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 08-25-2009 04:53 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    Thank you for replying ErnestoM.  I wasn't as specific as I should have been.  In this particular field in the repeating table I use a drop-down list box.  When I put conditional formatting on this control, e.g., hide or disable, it works as it should.  However, the field heading "Currency" and space where I have the control is still visible.  I don't want this to appear at all to the user; they would be confused by this.  How can I make this disappear, or how can I set the width for this column equal to 0, whenever the user chooses this particular account to work on?  By the way some users will only see this one account and not any others -- that's why they might be confused by the "Currency" field.

     I looked into conditional formatting on the repeating table itself, but I couldn't find a eway to limit it to a particular field.

     Thank you.

  • 08-25-2009 05:58 AM In reply to

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    hey why dont you put a simple text box in the repeating column title. And hide/unhide it based on conditional formatting. that should work best in your case

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 08-25-2009 07:43 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    InfoPath wouldn't let me replace the column title with a text box.  I then changed the repeating table property so that the header wouldn't show, and then applied conditional formatting on the drop-down list box.   The header didn't show, but the space for the "Currency" field was still there, only minus the dropdown list box.

     

    Is there a way to program this?

  • 08-25-2009 03:15 PM In reply to

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    We don't have access to form controls in the code behind, only the data fields.

    You may have to use more than one table, or instead of using a repeating table, why not use a repeating section? You could create a 'header' in a layout table, using an expression box for your column headings that you don't want to display.

    Hilary Stoupa

  • 08-26-2009 04:26 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    Currently I'm using 2 repeating tables with the field in one of them manually shrunk as much as possible.  I then use conditional formatting to hide one or the other.  This doesn't create any problems?

    I'm creating this form based on an MS Access form that has a datasheet in it -- several columns and several rows (I'm migrating the Access database to SQL Server).  Would using repeating sections mimic the Access form?  I quickly looked into it a couple of months ago, but it didn't seem to look that great.

    Thanks for your help.

  • 08-26-2009 06:43 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    Hilary,

    I did as you suggested, and created the repeating section and a layout table for the header.  I placed a drop-down list box for the currency, and an expression box for "Currency" in one of the cells for the header. I then added conditional formatting for both.  Everything looked pretty good; both appeared when they should, and weren't there for that particular account.

     The only problem was that the column (cell) in the header where the expression box was still was visible.  So the header cell with "Currency" remained visible (the word "Currency" disappeared), and the columns in the repeating section shifted to the left putting the headers and columns out of sync.  I tried to find a way to make the column in the header table disappear also, but couldn't.  I couldn't find a way to do conditional formatting on 1 cell of the header table.  Could you suggest a way?

     Thanks.

  • 08-26-2009 10:23 AM In reply to

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    There isn't a way to make a column's width conditional. Perhaps you could put your 'disappearing' column at the end of your table? Remove borders and shading from the table and use expression boxes for your header values, maybe with borders and shading on those so that they look like a traditional table header? Or, I wonder, what if you used a single column with expression boxes for the header labels? Then they'd all shift when one was hidden....

    Hilary Stoupa

  • 08-27-2009 04:01 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    Since the users are used to seeing the Currency field in a particular position, I'll try the second suggestion.  If that doesn't work, I'll just use my idea of 2 repeating tables -- apparently that doesn't cause any problems.

  • 08-27-2009 04:48 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    I experimented with your suggestion of using a single column with several expression boxes with borders, and it works.  It'll take a bit more time to adjust widths, heights, etc., but it's very doable.  I had to create new fields for every column header with the header name as the default value, and used these fields in the expression boxes.  If there's a better way, please let me know.

    Thank you very much, Hilary.

  • 08-27-2009 09:39 AM In reply to

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    I would have just entered text in the expression boxes. I know, when you add a new expression box, it looks like you can only use a form field for the value, but that isn't the case. Just put quotes around your text:

    "MyText"

    And your expression box will have a text value. That way you don't have to have those extra fields cluttering up your data source.

    Hilary Stoupa

  • 08-27-2009 11:27 AM In reply to

    • Francis
    • Not Ranked
      Male
    • Joined on 07-06-2009
    • Washington, DC
    • Posts 14

    Re: Can the width of a field and heading in a repeating table be shrunk to 0 or be made invisible?

    Thanks for the tip, Hilary.  I tried to enter text directly without quotes, and it wouldn't let me.

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