What happens if you call valdateNow() right after invalidateDisplayList()? One good test is to put the PrintVBox in an app, set up a Button that sets verticalScrollPosition, run the app, hit the button and make sure it does move. If it does move, then you are facing an invalidation timing problem and probably just need to call validateNow() at the right time. If it doesn't, then there is something about the content of the VBox that is fooling the VBox. You might also want to print out the value of verticalScrollPosition to make sure it is changing as expected. If you never put the PrintVBox on the display list, it won't get layed out and won't have a height. And, you can always create a mini-example and post it. It might give us more clues as to what might be going on. -Alex
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of dmiramontesval Sent: Monday, December 11, 2006 10:08 AM To: [email protected] Subject: [flexcomponents] Re: Printig multipage output Actually i am following the same approach, i receive an Array and i iterate it adding child components to the report, every x objects in the array i add a new page. It works fine except that when i send them to print, it always prints the first page even though i am scrolling down the screen. That's what the PrintDataGrid does, scrolls down and then sends to print, i am doing the same but it always prints the first page i dunno why, maybe i am missing something but i have no idea. The function that does this scrolling looks like this: public function nextPage() : void { verticalScrollPosition += height; invalidateSize(); invalidateDisplayList(); } Any ideas of what i am missing? --- In [email protected] <mailto:flexcomponents%40yahoogroups.com> , "zenwarden" <[EMAIL PROTECTED]> wrote: > > I've started down the same path you have. I have not finished what I > am working on, but it's a custom report with charts in a VBox that is > of variable length. I'm dynamically adding components and I need to > print them out as a report. > > Basically I would suggest creating an array (or any collection you > like) and adding the components (or references to them) that you want > to have in the printed report to that array. > > Then when you do a print job, you will need to iterate through the > array and print those things out. You will probably need to preprocess > that array and figure out where the page breaks are going to be. > > That at least the approach that I am considering right now. > > You might also want to look at the src code for the data grid print > for ideas. > > All the best. > > Chris > > P.S. In anyone thinks this is a bad appraoch let me know. I would be > happy to have a better solution. > > > --- In [email protected] > <mailto:flexcomponents%40yahoogroups.com> , "dmiramontesval" > <dmiramontesval@> wrote: > > > > In my last post i made myself clear when i told Peter not to take it > > personally, who seemed to get the point since he later replied to give > > me a piece of advice on how to do this. > > > > Since my first post, i was asking for that, for any ideas on how to do > > it manually, i NEVER asked for explanations of why Adobe didn't > > include multipage support in every component and I wasn't expecting > > Adobe to magically release a solution in one day either. > > > > If Peter felt offended, i apologize to him, like i said in that post > > which seemed to have caused such a big deal, i wasn't taking it on > > him, sorry if anyone felt it that way. > > > > Going back to the original question and how to solve it, i am doing > > what Peter suggested, print, scroll then print again, i think i am > > close to accomplish it but i can't get page break to work properly. > > I'll examine PrintDataGrid.as a little more to see if i there's > > anything that can help me out > > > > Any ideas will be of great help > > > > > > --- In [email protected] > > <mailto:flexcomponents%40yahoogroups.com> , Peter Bell <pbell@> wrote: > > > > > > It is the same issue I am having with a major new product I¹m > > rolling out at > > > SystemsForge. It isn¹t just scaffolding a la Rails or Model-Glue, but > > > neither can it do every possible thing automatically that an > imperative > > > programming language can. It allows you to generate many classes > of web > > > applications using re-usable metadata in minutes, but if you want > > completely > > > custom elements, you either need to create your own metadata or > > sometimes > > > you need to go out and write your own objects to subclass the > framework. > > > Maybe we need to start selling a copy of Fred Brookes ³The > Mythical Man > > > Month² with ALL of the development tools we all create. There really > > is no > > > silver bullet! > > > > > > Best Wishes, > > > Peter > > > > > > > > > On 12/9/06 7:57 AM, "Yakov Fain" <yfain@> wrote: > > > > > > > > > > > > > > > > > > > > > > > I kinda agree with Peter, Flex is just a tool, and if it does > not have > > > > some features, you should not assume it should have them. Yes, > the OP > > > > should tell his users that it's doable, but will cost them. > > > > > > > > The problem is that currently the main theme of Flex sales force is > > > > "you can create a fully functional application in Flex in less than > > > > one minute". True, if your application just needs to populate a > > > > datagrid from an XML source and this is all the user wants. But > in the > > > > real world, you should deliver a message that clearly states, > "Flex is > > > > a tool that can substantially speed up your development, but when it > > > > comes to customization, it's not faster than any other software > tool". > > > > > > > > Regards, > > > > Yakov Fain > > > > Farata Systems > > > > > > > > --- In [email protected] > > > > <mailto:flexcomponents%40yahoogroups.com> > > > > <mailto:flexcomponents%40yahoogroups.com> , Peter Bell <pbell@> > wrote: > > > >> > > > > >> > With respect, I would tell them that Flex can do exactly what > they > > > > want. It > > > >> > has a built in tool PrintDataGrid that supports their > > requirements > > > > (with > > > >> > any limitations there might be for your use case) and if that > > > > doesn¹t work > > > >> > for them for a substantially higher fee you could code a custom > > > > component to > > > >> > meet their specific needs. I don¹t think that support for > > multi-page > > > > print > > > >> > pagination support on all controls is the kind of feature you > would > > > > expect > > > >> > by default and I¹m actually glad to hear that Flex even supports > > > > that in the > > > >> > PrintDataGrid component. > > > >> > > > > >> > I don¹t see what the beef is. They bought a development tool > > that has a > > > >> > built in control to solve the class of problem and that has the > > > > capacity to > > > >> > be extended using custom controls if the standard controls don¹t > > > > meet their > > > >> > needs. Was there a label on the box saying ³all controls support > > > > multi-page > > > >> > pagination²? Did someone from Adobe call you up and say ³buy Flex > > > > because > > > >> > the multi-page pagination support on our Vbox is cool²? > > > >> > > > > >> > What if I purchased VS.NET and found (because I hadn¹t checked in > > > > advance) > > > >> > that one of the controls didn¹t do something I¹d just assumed > > that it > > > >> > should? Maybe Microsoft should reschedule their production > release > > > > because > > > >> > I¹m in a bind? > > > >> > > > > >> > It is perfectly appropriate to ask respectfully for feature > > > > enhancements and > > > >> > I¹m guessing they¹ll get evaluated by the product team and may be > > > > added to > > > >> > the production schedule based upon whatever criteria they > have for > > > >> > evaluating such requests. If you think a missing feature makes > > a product > > > >> > unusable, select a different alternative. Flex is amazing but I > > can¹t > > > >> > believe it solves every single problem for every single use case. > > > > But what > > > >> > is with the attitude? It seems to me like the only mistake > that was > > > > made was > > > >> > that a consultant assumed a feature would exist, made a > > > > recommendation based > > > >> > on that assumption and is now in a bind. I¹ve been there too > none > > > > of us > > > >> > are perfect, but that wasn¹t Adobes fault. > > > >> > > > > >> > FYI, I am completely unaffiliated with Adobe, and I don¹t > know Alex > > > > at all. > > > >> > But to be honest, the tone of your post just pissed me off. > > Sorry you¹re > > > >> > having a bad day, but it isn¹t Alex or Adobe¹s fault. > > > >> > > > > >> > Best Wishes, > > > >> > Peter > > > >> > > > > >> > > > > > > > > > > > > > > > > > > >
