Is it possible to export a VirtualStringTree to Excel or CSV?
I am using Delphi 2007 and trying to save my VirtualStringTree data records as Excel or CSV format.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
We have an
ExcelWriterhelper class, that can dump all kinds of things to Excel, e.g.In this case the fast way (and easy to copy-paste here) is the overload that can dump a variant array into Excel:
We have a
TVirtualListViewdescendant ofTVirtualStringTreethat made it easy to transition to VirtualTrees (it hasTVirtualListItem, etc). It then has a helper methodContentToVariantArray, which is similar toContentToHtmlandContentToRtf:The main downside here is that we’re automating Excel in order to use it. This means your customer/server will need Excel installed.
The above code shows the user Excel (having to save a file to the hard drive just to look at it is wasteful), rather than creating an export file. But wouldn’t be hard to call
.Saveor whatever the API is.