Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ExcelListener
Message
From
05/11/2006 12:13:28
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01166487
Message ID:
01167182
Views:
12
Hi Lisa,

Thank you for your answer. I have read several of your articles in FoxTalk 2.0. One in particular, "When is a report nor a report" (or something along those lines) was an eye opener.

Using a report Listener is only my latest attenpt to send VFP reports/data to Excel. Can I send it to you? I would appreaciate your comments and guidance.

Alex

>
>At first I used automation, but it was too slow, so after that I did it creating an spreadsheetML file in memory and then writing it to file with xls extension.
>

>
>That's what I do also. It works great with regular table-shaped data, such as cursors, and the results can be really beautifully formatted in Excel (basically everything but charts, and the charts can come in too if you save them as images rather than trying to bind to a chart control). You can add everything else that Excel has to offer.
>
>But you will find it works less well with reports, which are not "regular" or table-shaped data. You can develop some sort of algorithm to figure out what position on the spreadsheet (what row/column) corresponds to the same physical position (top/left) on a report page, you can size cells to accommodate the height/width of the original report element, but you are still left with the issue of z-order (overlaid report elements). And there's more.
>
>IOW, you will find it difficult to "generalize" what you've done.
>
>There are other approaches which involve not taking a literal look at the the report formatting at all, but rather treating the report run and its results as a data source for the Excel. IOW *not* trying to replicate the same formatting except for whatever metadata hints the FRX provides about styling, considering what is the best or most optimal Excel version of that report. This can be much, much more successful.
>
>I wrote a paper about this (and some related stuff) for MS, including pretty specific information dealing with issues such as data type translations. There are some additional thoughts about reasons you might, or might not, want to switch to using XLSX in Office 2007. When/if it ever gets up on MSDN maybe that will help you.
>
>I routinely create very highly formatted Excel output using this strategy. I don't bother trying to generalize the SSML creation, however, since the whole point is to provide exactly the Excel end result that the user is after, without any compromises, not to try to force the end result into some generalized version of the output.
>
>When "generalized" is good enough, I don't use SSML. I create an HTML formatted version of the report output, whether using the default HTMLListener result (which will work fine for many report layouts simple enough to "generalize") or an HTML result more specifically "tuned" to Excel. Excel will read the HTML just fine, with an XLS extension it will be the default application.
>
>HTH, good luck,
>
>>L<
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform