Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

ElXTreePrinter: tpoShowHiddenItems not working? and tpoShowInvisibleItems works like tpoShowHidden?

  with ItemTreePrinter.TreePrintSettings do
  begin
    if IncludeHidden then
    begin
      TreePrintOptions := TreePrintOptions + [tpoShowHiddenItems, tpoShowInvisibleItems];
    end
    else // not IncludeHidden
    begin
      TreePrintOptions := TreePrintOptions - [tpoShowHiddenItems, tpoShowInvisibleItems];
    end;
  end;

I use this before calling Print() to render the pages to the ElPrinter.

I expected  TreePrintOptions := TreePrintOptions - [tpoShowHiddenItems] to preclude Hidden items, but the hidden items were printed.

It was only when I removed tpoShowInvisibleItems that Hidden items were not previewed (or printed).

Either there is a bug or one of these options is superfluous.

Also, if one is to show hidden items, one must make them visible or test for them being hidden. Either way, only one option does the job.

Is this a bug? If so, please explain to me what these options mean; I couldn't find them in the Help.

Thanks.
Raymond

Comments

  • 4 Comments sorted by Votes Date Added
  • Furthermore, if the Hidden items were not invisible, then they are previewed/printed regardless of the state of the options.

    This appears to be a bug.

    Raymond
  • edited March 2013 Posts: 0 Accepted Answer Vote Up0Vote Down
    First of all, if you want to fine tune tree printing, make sure that PrintAsIs property is set to false. Otherwise, it will be printed exactly as it shown regardless of options.

    Now,  tpoShowHiddenItems and tpoShowInvisibleItems:
    tpoShowHiddenItems overrides hiding items when FilteredVisibility is set to true. That is, if there are any items that are not shown because of their Hidden property is set to true and Tree's FilteredVisibility is set to true, then they will be printed if tpoShowHiddenItemsflag is set.
    tpoShowInvisibleItems means that items that are not visible because parent items are not expanded, will be printed.

  • So for tpoShowHiddenItems there is no effect if FilteredVisiblity is False?

    I need to be able to have FilteredVisibility = False, so that Hidden items are displayed. That's a user option.

    Then the user can select whether to print Hidden items or not, and I would use  tpoShowHiddenItems = False..to not print the hidden items. 

    This is not how it currently operates.

    According to your definition this should not have occurred: 
      "It was only when I removed tpoShowInvisibleItems that Hidden items were not previewed (or printed)."

    Hence it seems to me that the code has a bug in it.

    In any case, tpoShowHiddenItems = False should prevent Hidden items from being printed.

    Raymond
Sign In or Register to comment.