I'm trying to restore a custom layout for my report.
There is a base report called RptBase with some common features and helper methods.
This is an empty report with some methods and an EntityServerModeSource for report data.
Than we have an inherited RptCustomer which inherits from RptBase.
It has a layout with a few fields/labels and some details (phone, address and email).
Finally we have the RptCustomerByCategory which inherits RptCustomer.
It adds a group for details, grouping customers by their category on the system.
These reports are working fine if I use the static method (which loads class info too).
But if I save the layout and restore it, DataMember is lost for details and the end-user has to re-assign it every single time.
The whole layout is all restored fine, just the DataMember part is lost.
Thanks for your reply.
I've figured out what was happening:
1) The duplacated name was breaking the export process. After changing, export/load was fine.
2) The EntityServerModeSource object must always be initialized BEFORE layout loading. This is required because if you load the layout before, there will be no definition of a type for an element and the loaded layout looses DataMember references. Changing code to set EntityServerModeSource.EntityType before the LoadLayout call solved this other issue.
Thanks, really, for the reply.
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.