In the object class ing of nhib.pdf, if the attributes of the object class can be obtained only through SQL calculation, you can use the Formula option.
Nhib.pdf has the following requirements for Formula:
Formula (optional): an SQL expression that defines the value for a computed property. Computed properties do not have a column mapping of their own.
Scenario 1: Map attributes to be calculated
The following Category ing is used as an example:
<?xml version="1.0" encoding="utf-8" ?>
If you want to add the NameAndDesc attribute and connect the CategoryName and Description fields, use Formula to do the following:
<property name="NameAndDesc" formula="[CategoryName] + ' ' + [Description]" type="string" />
Scenario 2: ing complex SQL types
SQL 2008 supports spatial data types geography and geometry. ing spatial data types can be solved through the spatial expansion of nhib.pdf, Which is troublesome to operate, if the client does not need a spatial data type or cannot process the spatial data type, you can use Formula for processing. The structure of the example table is defined as follows:
CREATE TABLE SpatialTable ( id int IDENTITY (1,1), GeogCol1 geography,);
The foring file using Formula is as follows:
<?xml version="1.0" encoding="utf-8" ?>