From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-29-2018 07:25 PM
We have a large report what we would like to change from the [Group Index] Structure to the [Group Name] Structure so we can add and delete channel and find them by name rather than index.
I expected that changing the syntax dropdown from:
|
to
Variable: ExtendChnName
|
Would allow me to automatically find the new groups after I change the order of Channel groups on a pre-generated report. However, thus far I have been unable to get the report to update.
The settings are explained here: http://zone.ni.com/reference/en-XX/help/370858M-01/varoff/extendchnname/
I changed the setting from the general settings page: http://zone.ni.com/reference/en-XX/help/370859J-01/dlgshell/dlgshell/dlgconfshell_dialog/
If Brad or another guru doesn't know this off the top of their head I can provide an example project.
Thanks for the help guys.
Solved! Go to Solution.
02-02-2018 01:34 AM
Hi TheWyrd,
The setting of ExtendChnName is only used for interactive behavior, for example drag & drop. It depends on the type of problem which setting is the best. If once a layout is created the channel reference is fix and there is no build-in function to change this.
So, if you will change the current setting in the layout, you must do this with a script. For this you load the layout and a corresponding dataset. Then read the current channel reference for X and Y channel, find these channels in the Dataportal and write back the new reference.Here is an example for the loaded dataset and layout. To finalize it you must add a loop over all REPORT sheets and objects.
Dim o2DCurves, oShapeType, iLoop
Set o2DCurves = Report.ActiveSheet.Objects.Item("2D-Axis1").Curves2D for iLoop = 1 to o2DCurves.Count select case o2DCurves(iLoop).ShapeType case e2DShapeLine call ChangeReference(o2DCurves(iLoop)) case e2DShapeLineAndPoints call ChangeReference(o2DCurves(iLoop)) ' case .... end select next '------------------------------------------------------------------------------- sub ChangeReference(o2DCurves) dim oChnList ' in case of waveform channel -> no entry if o2DCurves.Shape.XChannel.Reference <> "" then set oChnList = data.GetChannels(o2DCurves.Shape.XChannel.Reference) if oChnList.Count > 0 then o2DCurves.Shape.XChannel.Reference = oChnList.Item(1).GetReference(eRefTypeNameName) end if end if if o2DCurves.Shape.YChannel.Reference <> "" then set oChnList = data.GetChannels(o2DCurves.Shape.YChannel.Reference) if oChnList.Count > 0 then o2DCurves.Shape.YChannel.Reference = oChnList.Item(1).GetReference(eRefTypeNameName) end if end if end sub
Greetings
Walter
02-02-2018 10:16 AM
Hi Walter,
Thanks for the reply, I appear to have posted the same question twice somehow. Brad also had some input here:
Your explanation makes sense and extends on what he explained.