Issues/1859 export from grid fails when virtual fields are present

This fix assumes there are either real fields or virtual fields in a grid. It works in my test cases and is a big improvement over current functionality (tickets are no longer generated and export behaves as expected). But more work may be needed.