AddField函数不能按预期方式工作

时间:2018-05-09 09:29:44

标签: vbscript qlikview

我有以下代码块,它们遍历每个表的字段并分别添加当前表的字段,以便创建许多表框。

// select element
let el: HTMLElement = document.getElementById('filter-container');
//  style the height of psydo element
el.pseudoStyle("before", "height", newHeight);
...

上面的代码创建了表格框,但每次都减少了一个字段(最后一个字段丢失)。如果我将'iterate through every table For i=1 To arrTCount 'the arrFF array holds the names of the fields of each table arrFF = Split(arrFields(i), ", ") arrFFCount = UBound(arrFF) 'create a tablebox Set TB = ActiveDocument.Sheets("Main").CreateTableBox 'iterate through the fields of the array For j=0 to (arrFFCount - 1) 'add the field to the tablebox TB.AddField arrFF(j) 'Msgbox(arrFF(j)) Next Set tboxprop = TB.GetProperties tboxprop.Layout.Frame.ObjectId = "TB" + CStr(i) TB.SetProperties tboxprop Next 循环从For更改为For j=0 To (arrFFCount - 1),则会创建空的表框,并且似乎永远执行。关于此更改,我使用For j=0 To (arrFFCount)命令测试了字段名称,它显示了正确的字段名称,因为我希望它们位于QlikView的UI中的表格框中。

有人知道这里似乎有什么问题吗?我可以用不同的方式做到这一点吗?

为了澄清这里的情况和我到目前为止所测试的情况,我有11个表来制作表盒,我只试过其中一个或其中一些。我在代码中看到的结果在左侧,我期待看到的是在下图的右侧。请注意,每个表的字段数不尽相同,图像只有其中一个作为示例。

enter image description here

0 个答案:

没有答案
相关问题