This code can be improved, but I don't think you can easily make UI more responsive. Basically, you think correctly. Just one thing: in this case,
is a bit better then
, but I don't think you can see a big difference (but try it). Creation of a thread this way is expensive (there are three alternatives which are faster), but you did not report any observable delay before the invocation of the
It looks like the only time-consuming operation is the rendering of the
content, but you the assignment should be performed through the dispatcher as you correctly do, anyway; and the rendering itself is done in a separate rendering thread.
I would experiment with the following: could you generate a new report if the same size and assign it to the viewer again. Does it take the same time? If it always the same, I would think about starting with a very short content and appending small pieces one by one from your separate thread. It would make total time even more, but could keep the UI responsive. After all, I don't know why 6 pages could be so slow. Maybe the simple reason is that the