delphiprintingreporttstringgridtgrid

Recommendations for the most useful Delphi TStringGrid (Grid) replacement


One of the weaker areas of Delphi are the grids (eg TStringGrid) where, although it does a good basic job, it becomes harder when you need to print it or customise its appearance. I've used it for about 15 years thus its pretty embedded within my apps and over time I've home-rolled solutions for TGrid-to-RTF conversion (for printing via MSWord) and used TDrawGrid for a bit more customisation. My solutions (still) have to work in both Delphi 7 and Delphi XE. As it happens, none of my grids are DB-bound, they are all cell-populated in code.

Now I'm planning to sort out my reporting and 'pretty-up' my forms which means replacing the grid with a more capable implementation. There are loads out there and I've got two of them Developer Express Quantum Grid and the TMS Grid Pack. Time is very limited though to experiement with fonts, colours and printing and I would appreciate recommendations for which of the many grid / print-display report combinations I should adopt. I presenty do not have a report generator and was considering FastReports but I'm open to suggestions.


Solution

  • In about 1998 I got tired of TStringGrid and began a long journey outwards. I have used virtual grid view controls heavily, including Roman Mochalev's ExGridView (ported to Delphi 2010/XE here) and developer express's quantum grid control, and the printing suite that goes with it, as well as Virtual Tree View by Mike Lischke. Yes. It's a tree view. But if you don't create multiple levels of nodes, it makes a pretty great virtual grid too.

    In the end, none of these are perfect. Your application's requirements may include:

    There are many more "additional requirements" that are possible in your case, than I can possibly think of and list here. But it's these "also" things that will (or should) dictate your choice. Your application has to run 24/7/365.25? Well, then keep it simple, and avoid fancy stuff that will hurt you later.

    Since you state you need printing, nice looking themed painting, and you already own the Developer Express components, that would be the #1 most logical choice. It is a stable, mature, and high-quality component suite. For other people who view this question later, my only caveat is that it's a complex, heavy-weight solution, and not right for 100% of all Delphi apps that "just need a workable grid better than TStringGrid". DevEx Quantum Grid can copy just about every grid feature you have ever seen in Outlook, for example, including "group by" functionality.