将视图/临时表记录添加到表单网格 [英] Adding view/temporary table records to Form Grid

查看:81
本文介绍了将视图/临时表记录添加到表单网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过x ++动态创建一个表单. 我想将数据源表示为2个或更多网格,具体取决于某个字段的实例数量.我正在寻找类似以下内容的东西,但能够使用由范围查询或某种类型定义的数据源的不同实例.

I am dynamically creating a form through x++. I want to represent a datasource into 2 or more grids, depending on the number of instances of a certain field. Am looking for something like the one below but am able to use different instances of the datasource, defined by a range query or some sort.

formString = formBuildGridControl.addDataField(formBuildDatasource.id(), fieldNum(SomeTable, SomeField));

我也有以下代码:

fds = formRun.dataSource();
qbds = fds.query().dataSourceTable(TableNum(SomeTable));
qbr = Qbds.addRange(fieldnum(SomeTable, SomeField));
qbr.value(SomeValue);

但是它影响所有网格.在上面的代码中每个网格都有不同的SomeValue的地方,我可以用不同的方式来定义每个网格吗?

However it affects all the grids. Is there something I can use to define each grids differently where the above code has a different SomeValue for each grid?

推荐答案

单个数据源不能在两个网格中具有不同的过滤器或范围.

A single datasource cannot have different filters or ranges in two grids.

您很可能需要将表拖两次以创建两个数据源,然后在数据源的initexecuteQuery方法中应用不同的过滤器.记住要更改网格的datasource属性以匹配正确的网格.

You will most likely need to drag your table twice to make two datasources, then apply the different filters in the init or executeQuery methods of the datasources. Remember to change the datasource attribute of the grids to match the correct one.

void init()
{
    super();
    this.queryBuildDatasource().addRange(fieldnum(SomeTable, SomeField)).value(queryValue(SomeValue));
}

这篇关于将视图/临时表记录添加到表单网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆