SDK example ReportsExample shows how to define an Item Type Report programmatically.
There is a commented line that illustrates a filter, to restrict the rows generated in the Report...
reportNode->SetRowFilter (L"this.DgnCustomItemTypes_VendorCatalogItem::VendorItem::OutofStock=False");
How does one write the filter string coloured blue above? It's enigmatic in so many ways.
DgnCustomItemTypes_VendorCatalogItem
VendorItem
That filter looks to me as if it were almost written for a C# parser, not a C++ EC report node; however, = is not a C# equality operator. Any suggestions?
=
Bump!
Regards, Jon Summers LA Solutions
It's an ECExpression. I don't know if you are familiar with the syntax of those, or if it's even publicly documented.
This expression isn't really intended for human consumption. It is spit out by the expression editor included in the Reports dialog.
The weird double-colon stuff is a 'fully-qualified access string'. The format of such is 'SchemaName::ClassName::PropertyAccessString'. This prevents ambiguity in the case in which multiple ECInstances of different ECClasses are involved and potentially have properties with the same name.
Paul Connelly said:This expression isn't really intended for human consumption
I'll accept that persuasive argument.
So how does one construct a report filter programmatically? If ReportDefinitionNode is the right class to work with, and method SetRowFilter (WCharCP filterString) is the only method of setting a filter, what should we do?
ReportDefinitionNode
SetRowFilter (WCharCP filterString)
Today, one would need to manually construct the expression and hope not to mess up the syntax.
The condition editor controls used in Reports and Display Rules dialogs make use of an undocumented API in DgnPlatform which allows them to define the condition at a higher level and will convert it to an ECExpression string. Maybe we can include that in the next version of the SDK - I'll ask Robert Hook.
FYI. Enhancement 869966 has been filed to add Report Filter Syntax support to the MicroStation SDK.
Robert Hook said:add Report Filter Syntax support to the MicroStation SDK
Robert Hook Did that enhancement request have a conclusion?
Hi Jon,
Update 13 had high focus on stability and performance related items (very few features). Let me check with our development scheduling to see if we can have this available in product API headers/docs for Update 14 (or at least a preliminary blog - then docs).
Thank you,Bob