Currently, the sample for C++ is a hidden gem in the form of the "Print and Design Reports (SQL data source)" sample. If you're about to start your development in C++, this is the recommended starting point. That's also the reason why we removed and deprecated several other C++ samples in LL21. Of course, we'll fully support the "old" way of working with List & Label with your custom print loop. However, if you're looking for advanced features, the IDataProvider interface will be the way to go. This is what the interface looks like:
interface ILLDataProvider : public IUnknown // IID_ILLDATAPROVIDER 0x3cbae450,0x8880,0x11d2,0x96,0xa3,0x00,0x60,0x08,0x6f,0xef,0xff { virtual HRESULT _stdcall OpenTable(LPCWSTR pszTableName, IUnknown** ppUnkOfNewDataProvider)=0; virtual HRESULT _stdcall OpenChildTable(LPCWSTR pszRelation, IUnknown** ppUnkOfNewDataProvider)=0; virtual HRESULT _stdcall GetRowCount(INT* pnRows)=0; virtual HRESULT _stdcall MoveNext()=0; virtual HRESULT _stdcall DefineRow()=0; virtual HRESULT _stdcall Dispose()=0; virtual HRESULT _stdcall SetUsedIdentifiers(const VARIANT* arvFieldRestriction)=0; virtual HRESULT _stdcall ApplySortOrder(LPCWSTR pszSortOrder)=0; virtual HRESULT _stdcall ApplyFilter(const VARIANT* arvFields, const VARIANT* arvValues)=0; virtual HRESULT _stdcall ApplyAdvancedFilter(LPCWSTR pszFilter, const VARIANT* arvValues)=0; virtual HRESULT _stdcall SetOption(INT nIndex, const VARIANT* vValue)=0; };
Your code needs to implement this interface and pass it via option to List & Label – just like in the screenshot from this tweet: https://twitter.com/jbartlau/status/649907919241244672. The sample shows an implementation for SQLite databases that will quite easily translate to other relational database systems.
The interface functions are quite easy to understand:
Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.