I'm certain there's a simple solution and missing something fairly obvious here. I am attempting to feed a multi source tree control from a procedure that produces XML. Despite having what I thought would be a hierarchy from two BY fields, I'm instead presented with the Parent repeated for every child.
I'm currently on 8105M. I tried to follow the example presented in the release manual (https://infocenter.informationbuilders.com/wf81rel/index.jsp) , but couldn't achieve what I was seeking.
Procedure: How to Add a Tree Control to an HTML Page Using an Existing Procedure You can select an existing procedure to add to the tree control in an HTML page. When you select a procedure, it should use fields from the parent/child hierarchy and be set up as follows:
TABLE FILE file
SUM FST.dispfield
BY ParentUniqueField
BY UniqueField
BY datafield
ON TABLE PCHOLD FORMAT XML
END
where:
file Is the name of the data source.
dispfield Is the field whose values display in the tree control.
ParentUniqueField Is the field that represents the parent for the parent/child hierarchy (PROPERTY = PARENT_OF).
UniqueField Is the field that represents the unique IDs for the hierarchy members (PROPERTY=UID).
datafield Is the field whose values are passed as the parameter value.
On the Canvas I click on the component of the control, went to Properties and set the Number of Levels to (2); on the Parameters section, the control had the corresponding portions of the Levels, selected the first level, went to the Settings tab and applied the first level of the hierarchy, then did the same for the second level.
I wasn't able to find my answer in searching the forums. I'd love to see a simple CAR file example if at all possible. I'm guessing there is a simple nuance I'm missing, please forgive my ignorance on this one. Many thanks for any assistance.This message has been edited. Last edited by: Mike Williams,
WF Version 8105
January 16, 2019, 01:51 PM
Hallway
quote:
it should use fields from the parent/child hierarchy
Does the data source have a parent/child hierarchy? I don't think that the CAR file does.
Of course (as usual) I can find ZERO documentation on how to create a parent/child hierarchy This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
January 16, 2019, 03:25 PM
Mike Williams
quote:
Originally posted by Hallway:
quote:
it should use fields from the parent/child hierarchy
Does the data source have a parent/child hierarchy? I don't think that the CAR file does.
Of course (as usual) I can find ZERO documentation on how to create a parent/child hierarchy
If I recall correctly the CAR Master does.
A Janky example that uses multi-select OR's with the CAR:
-DEFAULT CAR=_FOC_NULL;
TABLE FILE CAR
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
WHERE ( CAR.ORIGIN.COUNTRY EQ &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY IN CAR)).COUNTRY:. ) AND ( CAR.COMP.CAR EQ &CAR.(OR(FIND CAR.COMP.CAR IN CAR)).CAR:. );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
ENDSTYLE
END
So create a new HTML canvas doc and drag a report then reference that procedure on the HTML canvas, reorder the params with country first, choose the multi source tree so the &CAR is appended to the &Country. Verify the Properties tab is set to 2 levels, then goto params to check settings for the two elements of the hierarchy.