I'm using two controls, a spreadsheet control and a report printing control. Unfortunately the two do not support the same data structures so to print a report Killink has to copy the data from the spreadsheet to the report which means looping. And when there are a million + rows with 3 columns the code is looping 3 million + times. Not much can be done to speed it up.
What I need is a way to keep the data in a single data structure that is supported by both components. I'm starting to have a better understanding why certain commercial software tends to not rely on 3rd party components and libraries. However, time is important to me so I must rely on 3rd party components for certain features.
For now Killink will have to warn the user before allowing a huge files to be printed. "You wish to print a file that is very large. It will take some time to prepare the data for printing. Do you wish to continue?"
The report I'm trying to preview during testing will have more than 15,000 pages. I don't see anyone realistically printing this many pages but you never know. posted by Kirby | 10-Apr-2007 3:22 PM | comments (2)
It may be the copying *as well* as the iteration which is hurting you. In any event, I wonder if either is necessary. You may be able to use the Adapter (GoF) pattern to make the "spreadsheet-style" data *appear* to be "report-style" data, and never copy the data at all.
posted by Craig Stuntz | April 11 08:22 AMInteresting approach. I'll look into it.
posted by Kirby Turner | April 12 05:09 AMAdd Your Comment
