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 developedis 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: [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;i<pages;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=view&id=
>> KC.tn_19241&extid=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 from Merlin 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 Securities, LLC is a registered broker-dealer. Services offered through Merlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC and may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security.

Reply via email to