Welcome, Guest. Please login or register.
Did you miss your activation email?
31 Jul 2010, 11:32:24 UTC
Forum home
+  flexdeveloper.eu Forum
|-+  Other boards
| |-+  Other Programming Languages (Moderator: James)
| | |-+  get the data from a filtered datagrig and print them in simple text?
« previous next »
Pages: [1] Print
Author Topic: get the data from a filtered datagrig and print them in simple text? (Read 4119 times)
dimiorla
Newbie FD
*
Posts: 4


« on: 13 Jun 2009, 21:57:29 UTC »

Hey everyone,
Is it possible to get the data from a filtered datagrig from flex and print them (server side) in simple text with php?
I thing it is, with the help of php_printer.dll but I’m not experienced with php, and I cant find a lot of info on the net.
P.S. The printer is installed on the webserver (intranet).
Thanks in advance, Dimitri.
Logged
flexy
flexdeveloper.eu
Guru/Addict FD
*****
Posts: 3,155


Recovering Coffee Addict & Adobe Expert


WWW
« Reply #1 on: 15 Jun 2009, 10:29:54 UTC »

Are you successfully able to send the required data from your Flex app to the server?
Logged

dimiorla
Newbie FD
*
Posts: 4


« Reply #2 on: 15 Jun 2009, 17:59:16 UTC »

I have found a way to export the data in a csv
http://www.abdulqabiz.com/blog/archives/2007/08/03/datagriddataexporter-export-datagrid-data-as-csv/
and i supose i could print the file with php
Code:
<?
$handle = printer_open("HP Deskjet 930c");
printer_start_doc($handle, "proj.csv");
printer_start_page($handle);
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
?>
but thear has to be a better way
Logged
dimiorla
Newbie FD
*
Posts: 4


« Reply #3 on: 16 Jun 2009, 14:12:55 UTC »

@ flexy: is this what you mean?
Their are probably some errors in the code, but am i on the write track?
Code:
<mx:Button click=" print.send();"/>
<mx:HTTPService id="print" url="/print.php"
showBusyCursor="true" method="POST" useProxy="false">
<datatoprint>{datatoprint .text}</ datatoprint >
</mx:HTTPService>
php code
Code:
<?
$datatoprint = $_POST["datatoprint"];
$handle = printer_open("HP Deskjet 930c");
printer_write($handle, $ datatoprint);
printer_set_option($handle, PRINTER_MODE, "raw");
printer_close($handle);
?>
Logged
dimiorla
Newbie FD
*
Posts: 4


« Reply #4 on: 17 Jun 2009, 08:04:00 UTC »

For anyone who is interested the above code works  Kiss
Logged
flexy
flexdeveloper.eu
Guru/Addict FD
*****
Posts: 3,155


Recovering Coffee Addict & Adobe Expert


WWW
« Reply #5 on: 18 Jun 2009, 10:34:24 UTC »

Thanks for posting your solution. I'm going to move this to the other programming languages board, as it's purely a PHP question.
Logged

Pages: [1] Print
« previous next »
Share this on: Twitter Twitter Del.icio.us del.icio.us Digg Digg
Jump to:

©2006-2010 Flexdeveloper.eu/Jodie O'Rourke. All rights reserved.
Adobe®, Adobe® Flash™, Adobe® AIR™ and Adobe® Flex™ are registered trademarks of Adobe Systems Incorporated in the United States and other countries. All rights reserved.

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC