RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work?
I get the same misbehavior with that. Hmmm. Tracy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:10 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work? Hi Tracy, All I did was change the datagrid name. (If I can remember correctly) but here is my code just incase (Hoping that someone will help w/ the headder and footer adding): == Start Code == function doPrint() { var pj : PrintJob = new PrintJob(); // position of currently visible rows stored var prev_vPosition:Number = historyDg.vPosition; var prev_width:Number = historyDg.width; var prev_height:Number = historyDg.height; if(pj.start() != true) return; historyDg.setSize(pj.pageWidth,pj.pageHeight); // number of rows per view, ignoring fractions (floor) var rowsPerPage:Number = Math.floor((historyDg.height - historyDg.rowHeight)/ historyDg.rowHeight); // number of pages to be printed, if there are any fractions, have one page for that (ceil) var pages:Number = Math.ceil(historyDg.dataProvider.length / rowsPerPage); for (var i=0;ipages;i++) { // move the visible row position. historyDg.vPosition = i*rowsPerPage; // size box relative to the grid var b= {xMin:0,xMax:historyDg.width,yMin:0,yMax:historyDg.height} pj.addPage(historyDg,b); } pj.send(); delete pj; // position of currently visible rows restored historyDg.setSize(prev_width,prev_height); historyDg.vPosition = prev_vPosition; } == END Code == thanks, -Art Quoting Tracy Spratt [EMAIL PROTECTED]: Have you run the example as is? Maybe there is something else necessary? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:01 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Sample code for printing from a DataGrid: doesnot work? Hi Tracy, I'm using that same function w/o problems to print the info in the datagrid BUT I whish I could figure out how to add a headder and footer to the printjob. I'm just too unfamiliar with the print function. I've actually never used it before this project. -Art Quoting Tracy Spratt [EMAIL PROTECTED]: The Sample code for printing from a DataGrid posted on the MM site under the url below does not work: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?event=viewid= KC.tn_19241extid=tn_19241 It is close, it is actually putting the data into the page, but still only the visible area prints. If I generate 100 lines, the output is the correct three pages and each page starts on the correct line, but only the 8 visible lines print on each page. Has anyone else tried this and succeeded? Tracy Yahoo! Groups Links Yahoo! Groups Links Yahoo! Groups Links
RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work?
Tracy, Its funny you send this email because I posted something about printing last nightI am using the same exact code youre using from the example on MMs site and I would say it works intermittently, at best, when I try to print my datagridat first, if you read my post from last night, I thought it was only when I tried to print it in landscape, because the first few times I tested it, it was actually working in portrait but when I switched the landscape, it stopped printinglike you said, it printed the correct number of pages but only the visible content was printedthen I tried to print again in portrait layout and it stopped working in that format as wellvery strange behavior. The whole printing functionality in Flex is very weak and is sort of the bane of my existence at the moment being as the application I developedis a reporting application. Right now, as terrible as it sounds, I tell the users to launch the PDF version of the report theyre viewing and use that to print anything they wantthing is not everything in the application is available in PDF formatmaybe Flex 2.0 will come around to thisI really hope so anyways. Ideally, if they could provide a mx:FlashPaper component for Flexnow THAT would be the epitome of awesomeness. Im going to continue to investigate this, as I hope you and Art will to and maybe we can come up with something collaborativelybecause there doesnt seem to be a quick fix to this conundrum. Best, Rob From: Tracy Spratt [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24,2005 2:32 PM To: [EMAIL PROTECTED] Subject: RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work? I get the same misbehavior with that. Hmmm. Tracy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:10 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work? Hi Tracy, All I did was change the datagrid name. (If I can remember correctly) but here is my code just incase (Hoping that someone will help w/ the headder and footer adding): == Start Code == function doPrint() { var pj : PrintJob = new PrintJob(); // position of currently visible rows stored var prev_vPosition:Number = historyDg.vPosition; var prev_width:Number = historyDg.width; var prev_height:Number = historyDg.height; if(pj.start() != true) return; historyDg.setSize(pj.pageWidth,pj.pageHeight); // number of rows per view, ignoring fractions (floor) var rowsPerPage:Number = Math.floor((historyDg.height - historyDg.rowHeight)/ historyDg.rowHeight); // number of pages to be printed, if there are any fractions, have one page for that (ceil) var pages:Number = Math.ceil(historyDg.dataProvider.length / rowsPerPage); for (var i=0;ipages;i++) { // move the visible row position. historyDg.vPosition = i*rowsPerPage; // size box relative to the grid var b= {xMin:0,xMax:historyDg.width,yMin:0,yMax:historyDg.height} pj.addPage(historyDg,b); } pj.send(); delete pj; // position of currently visible rows restored historyDg.setSize(prev_width,prev_height); historyDg.vPosition = prev_vPosition; } == END Code == thanks, -Art Quoting Tracy Spratt [EMAIL PROTECTED]: Have you run the example as is? Maybe there is something else necessary? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:01 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Sample code for printing from a DataGrid: doesnot work? Hi Tracy, I'm using that same function w/o problems to print the info in the datagrid BUT I whish I could figure out how to add a headder and footer to the printjob. I'm just too unfamiliar with the print function. I've actually never used it before this project. -Art Quoting Tracy Spratt [EMAIL PROTECTED]: The Sample code for printing from a DataGrid posted on the MM site under the url below does not work: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?event=viewid= KC.tn_19241extid=tn_19241 It is close, it is actually puttingthe data into the page, but still only the visible area prints.If I generate 100 lines, the output is the correct three pages and each page starts on the correct line, but only the 8 visible lines print on each page. Has anyone else tried this and succeeded? Tracy Yahoo! Groups Links Yahoo! Groups Links Yahoo! Groups Links This message contains information fromMerlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, pleaserefrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission. Merlin
RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work?
Hi All, Well so far my printing has made me go baldlol but seriously. I have got it to print a header on one page the datagrid contents on another page, and my footer on the last page. Not fun at all. I for what the server costs you'd expect better functionality than this. Little things like this make clients unhappy and in the end MM looses because if this issue doesn't get taken care of quick this will really hinder the future of Flex. Hey Matt! I agree with Robert. there should be some kind of mx:FlashPaper tag for v2.0 of Flex. that would make my day. also could you look at my print function located in this email below and help me get a headder on each page w/ a footer on the last page? thanks, -Art Quoting Robert Brueckmann [EMAIL PROTECTED]: Tracy, It's funny you send this email because I posted something about printing last night...I am using the same exact code you're using from the example on MM's site and I would say it works intermittently, at best, when I try to print my datagrid...at first, if you read my post from last night, I thought it was only when I tried to print it in landscape, because the first few times I tested it, it was actually working in portrait but when I switched the landscape, it stopped printing...like you said, it printed the correct number of pages but only the visible content was printed...then I tried to print again in portrait layout and it stopped working in that format as well...very strange behavior. The whole printing functionality in Flex is very weak and is sort of the bane of my existence at the moment being as the application I developed is a reporting application. Right now, as terrible as it sounds, I tell the users to launch the PDF version of the report they're viewing and use that to print anything they want...thing is not everything in the application is available in PDF format...maybe Flex 2.0 will come around to this...I really hope so anyways. Ideally, if they could provide a mx:FlashPaper component for Flex...now THAT would be the epitome of awesomeness. I'm going to continue to investigate this, as I hope you and Art will to and maybe we can come up with something collaboratively...because there doesn't seem to be a quick fix to this conundrum. Best, Rob From: Tracy Spratt [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:32 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work? I get the same misbehavior with that. Hmmm. Tracy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:10 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Sample code for printing from a DataGrid:doesnot work? Hi Tracy, All I did was change the datagrid name. (If I can remember correctly) but here is my code just incase (Hoping that someone will help w/ the headder and footer adding): == Start Code == function doPrint() { var pj : PrintJob = new PrintJob(); // position of currently visible rows stored var prev_vPosition:Number = historyDg.vPosition; var prev_width:Number = historyDg.width; var prev_height:Number = historyDg.height; if(pj.start() != true) return; historyDg.setSize(pj.pageWidth,pj.pageHeight); // number of rows per view, ignoring fractions (floor) var rowsPerPage:Number = Math.floor((historyDg.height - historyDg.rowHeight)/ historyDg.rowHeight); // number of pages to be printed, if there are any fractions, have one page for that (ceil) var pages:Number = Math.ceil(historyDg.dataProvider.length / rowsPerPage); for (var i=0;ipages;i++) { // move the visible row position. historyDg.vPosition = i*rowsPerPage; // size box relative to the grid var b= {xMin:0,xMax:historyDg.width,yMin:0,yMax:historyDg.height} pj.addPage(historyDg,b); } pj.send(); delete pj; // position of currently visible rows restored historyDg.setSize(prev_width,prev_height); historyDg.vPosition = prev_vPosition; } == END Code == thanks, -Art Quoting Tracy Spratt [EMAIL PROTECTED]: Have you run the example as is? Maybe there is something else necessary? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:01 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Sample code for printing from a DataGrid: doesnot work? Hi Tracy, I'm using that same function w/o problems to print the info in the datagrid BUT I whish I could figure out how to add a headder and footer to the printjob. I'm just too unfamiliar with the print function. I've actually never used it before this project. -Art Quoting Tracy Spratt [EMAIL PROTECTED]: The Sample code for printing from a DataGrid posted on the MM site under the url below does not work: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?event=viewid= KC.tn_19241extid=tn_19241 It is close, it is actually putting the data into the page, but still only the visible area prints. If I generate