Dataset

Trả về giá trị của cột Field trên dòng dữ liệu hiện hành của dải dữ liệu DataSet. Nếu giá trị mặc định default được cung cấp, nó sẽ được sử dụng khi cột Field không tồn tại trong dải dữ liệu, hoặc dải dữ liệu không tồn tại.

Nếu bạn không cung cấp giá trị mặc định và cột dữ liệu không tồn tại, KNOWINS sẽ báo lỗi khi chạy báo cáo.

Cú Pháp

<#DataSet.Field>
<#DataSet.Field;default>

Ví Dụ

Nếu bạn có một dải dữ liệu Customers với một cột có tên là LastName,

<#Customers.LastName> sẽ được thay thế bằng giá trị của cột LastName trong dòng dữ liệu hiện hành của dải dữ liệu Customer.

<#if(<#Customers.#RowCount> = 0;<#delete row>;)> sẽ xóa một hàng trong bảng trình bày nếu dải dữ liệu không có bản ghi nào. Bạn có thể sử dụng công thức này để xóa các tiêu đề chi tiết trên báo cáo mẹ-con khi báo cáo mẹ không có dữ liệu con nào cả.

<#Customers.LastName;Không có khách hàng> sẽ thay giá trị của cột LastName nếu cột đó tồn tại trong dải dữ liệu, ngược lại thay bằng dòng chữ Không có khách hàng.

<#Customers.LastName;> sẽ thay bằng một giá trị trống nếu cột LastName không tồn tại.

<#Customers.ByName.LastName> sẽ tham chiếu đến cột ByName.LastName của dải dữ liệu Customers.

<#[Customers.ByName].LastName> cột LastName của dải dữ liệu Customers.ByName.

KNOWINS always searches for the first dot in the string to separate the table name from the field name. So if you have for example <#one.two.three>, FlexCel will understand that the table is "one" and the field is "two.three". If you wanted the table name to be "one.two" and the field to be three, you would have to use square brackets to keep together the table name: <#[one.two].three>

There are two defined “pseudocolumns” that you can use on any dataset:

  1. <#DataSet.#RowCount> will return the number of rows on a dataset.

  2. <#DataSet.#RowPos> will return the current position on the dataset (the first record is 0).

Normally you can write any character in the column name, including a column named similar to "Data(Max)". But in some cases, like when for example there is a simple parenthesis, or if you have the character ">" inside the column name, you might need to quote the name. For example, if your column name is "a(" you will have to write the tag as <#"DataSet.a(">. When quoting a name, you can include a quote inside by writing 2 quotes. For example, the column a"b can be written as <#"DataSet.a""b">

Last updated