How To…DataSnap

Question

“How can I use DataSnap to implement an end-user reporting solution?”

Solution

On the client side, use the DADE plug-infor DataSnap (daDataSnap.pas) and ClientDataSets. On the server side implement a simple dsServerModule with the supporting data access components.

Download: rbDataSnap.zip

DataSnap Client

1. Connect the ReportExplorer to ClientDataSets.

2. Include daDataSnap.pas. This will register a DADE session type called DataSnapSession.

3. Set the Designer.DataSettings. Set SessionType to DataSnapSession, DatabaseName to dsProviderConnection1. Configure other DataSettings based database type etc.

DataSnap Server

1. Implement the dsServerModule with the supporting data access components for ReportExplorer and optionally the DataDictionary.

2. Add an additional query component called qryDummy. This is used to provide data to the DataSnapSession on the client.

3. Implement a public GetTableNames method. This is used to provide the DataSnapSession table names via the dsServerProxy.pas included in the client project.