online cheap medications order generic bactrim price, and buy cheap online buy cheap discount lasix, and cheap pharmacy lipitor without rx, and online ordering accutane review, and order cheap how much acyclovir to kill, and buy cheapest synthroid order online, and pharmacy cheapest cheap baclofen pill, and order online directions for taking clomid, and online cheap medications cheap hydrochlorothiazide without rx, and cheap pharmacy purchase amoxil cod overnight delivery, and cheap pharmacy arimidex online overnight, and buy cheap online buy buy zithromax pill online, and order online online valtrex prescription in utah, and buy cheapest buy cheap discount online flagyl, and buy online zovirax (acyclovir) cheapest, and buy cheap how to buy prozac online without a rx, and cheap pharmacy cash on delivery paxil, and cheap pharmacy diflucan cod delivery next day, and purchase no prescription propecia cancer prevention, and generic medications neurontin and online overnight delivery, and purchase no prescription norvasc fedex shipping, and online ordering purchase doxycycline next day cod, and ordering online feminizing effects of premarin, and buy cheap online buspar and wellbutrin, and online cheap medications order overnight retin-a, and

New feature – Showing data in AlivePDF

I noticed that one of the things that you guys really needed was showing data in your PDF.

Currently, if you want to show some data, you are using the addImage method, which captures for instance a DataGrid and shows it as an image in the PDF.

This is a cool feature but I thought I could do something better for handling data.

What I am working on, for the next release of AlivePDF is an addGrid() method which takes different parameters, here is the addGrid method signature :

public function addGrid ( x:int, y:int, grid:IGrid ):void

This allows you to pass an org.alivepdf.data.Grid instance and a position, and there you go, you get a vector DataGrid in your PDF.

The cool thing is how you fill your Grid instance with data, let's take a look at the Grid constructor :

public function Grid( data:Array, width:int, height:int, headerColor:IColor, backgroundColor:IColor, cellColor:IColor, alternateRowColor:Boolean, borderColor:IColor, joints:String)

The idea is to create a Grid instance and fill it with existing data from any data component. So you can pass a simple ArrayCollection like this :

var dp:ArrayCollection = new ArrayCollection ();

dp.addItem( { firstName : "Bob", lastName : "Groove", city : "Paris" } );
dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );

var grid:Grid = new Grid ( dp.toArray(), 200, 100, new RGBColor (0x00CCFF), new RGBColor (0xFFFFFF), new RGBColor ( 0x0 ), Joint.ROUND );

myPDF.addGrid( 5, 5, grid );

But you can also pass any data from an existing data component :

var grid:Grid = new Grid ( myDataGrid.dataProvider.toArray(), 200, 100, new RGBColor (0x00CCFF), new RGBColor (0xFFFFFF), new RGBColor ( 0x0 ), Joint.ROUND );

myPDF.addGrid( 5, 5, grid );

This results in the following grid in the PDF :

AlivePDF - Dynamic DataGrid

Of course you will be able to skin the Grid with a custom CSS or appropriate parameters.

So you may wondering why am I converting everything to Array ?

The only reason is because, we need to stay compatible with the Flash framework which does not integrate any ArrayCollection class.

Of course this concept will be extended to charts components and more so that you got the most flexible API to integrate data in your PDF :)

Let me know what you think about it, don't hesitate to throw some ideas.

Comments 48

  1. Alexander Kludt wrote:

    You’re doing great things for the community, do you need somebody for testing the new release, or do you need some co developer ? I’d really appreciate to get it a little earlier since I need some of the new features you mentioned ;)

    Did you ever notice that the lib doesn’t work with linux ? As soon as you add any images the pdf generated will be broken since writeMultiBytes somehow crashes on linux.

    Posted 08 Jul 2008 at 9:16 am
  2. Thibault Imbert wrote:

    Hi Alexander,

    I am happy to hear that you like this feature.

    I would be happy having your opinion on those features and I am opened for some co-development :)

    I never noticed it was buggy on Linux, thanks for the info I will double check that.

    best,

    Thibault

    Posted 08 Jul 2008 at 9:22 am
  3. Alexander Kludt wrote:

    Hi Thibault,

    For all co-development related stuff this comment box is kind of unusable =)

    Please drop me an email coding[at]aggrosoft.de

    best,
    Alexander

    Posted 08 Jul 2008 at 12:33 pm
  4. Wes Kempa wrote:

    This is a great addition Thibault, thank you for your devotion to this process.

    I am looking forward to this upcoming release and already have a use in mind for implementation into an existing project exporting medical records to an AlivePDF.

    A great add-on feature would be to allow the grid to divide easily into multiple pages similar to the flexPrintJob’s printDataGrid, although this release itself would be great without this specific feature.

    Posted 14 Jul 2008 at 5:48 pm
  5. Daniele wrote:

    Ciao!

    I’d like to have this feature too, but in order to be usable we need something that will auto handle page breaks for long lists of data.

    the same blessing would be cool for normal text too

    of course I don’t want to push you in any way, but do you have a date when this version will be out?

    thanks

    Posted 17 Jul 2008 at 12:10 pm
  6. Dal Mon wrote:

    Looks very promising. Would it be possible to download the latest dev code?

    I’m unable to pull anything from svn http://alivepdf.googlecode.com/svn/trunk/ alivepdf-read-only

    Posted 17 Jul 2008 at 5:01 pm
  7. Ansury wrote:

    This will be great if we’re able to create something formed like this without too much trouble:

    First Page:

    Mid pages:

    Last page:

    Since we can specify the width and height, it looks like it will be possible to do this without too much trouble, and I hope without having half-cut-off rows at the end. It looks like we will have to manage which data rows get sent to each page manually, right? I guess that’s okay though.

    Maybe you should hold off putting stuff like this up before it’s ready, because now you get people like me saying “when will it be done?” ^_^

    Posted 23 Jul 2008 at 9:14 pm
  8. Ansury wrote:

    Okay, that stupid page text didn’t go through. (Stupid web software)
    Let’s try again…

    First Page:
    header
    first-page-only-header
    data
    footer

    Mid Page:
    header
    data
    footer

    Last Page:
    header
    data
    last-page-only-footer
    footer

    Posted 23 Jul 2008 at 9:16 pm
  9. Ansury wrote:

    Just realized also, I shouldn’t be taking something for granted: for the “data” placeholder above, we need to be able to have headers for each column, in addition to any page header information (which could be totally separate information, about the report itself, for example).

    Of course this is all perfect-case. If we can do this ourselves using some improved API calls that’s okay of course. Just wanted to provide some feedback with a specific example of some real life requirements.

    Posted 23 Jul 2008 at 9:57 pm
  10. Stuart wrote:

    Very much looking forward to the upcoming addGrid() method.. When do you anticipate releasing 0.1.5 ?

    Posted 25 Jul 2008 at 1:30 am
  11. cs wrote:

    Hi,
    First off, Thank you very much for your contribution to the community.
    Question/Request for feature – I have all numbers to be displayed in the grid. Can I do a right alignment of the numbers?

    Posted 13 Aug 2008 at 8:18 am
  12. cs wrote:

    Another request/question – How about word wrap within the grid cell.

    Posted 13 Aug 2008 at 8:19 am
  13. cs wrote:

    Hi,
    Also, will need some FontMetrics data for doing center alignment. There will be many cases in which I will need to center the data and hence will need to know how wide the string is going to be.
    Thanks
    CS

    Posted 13 Aug 2008 at 8:24 am
  14. Jairo Alfonso Lopez wrote:

    what version of the library is used for this sample??? because i’m using 0.1.4.5 and i don’t found the function for create a data grid

    Posted 26 Sep 2008 at 9:44 pm
  15. Djamol wrote:

    Maan, that would be awesome. Creating DataGrids in PDF would be one of the greatest features of this library. I can’t wait to see this feature in work!…Thanks man, thanks.

    Posted 06 Oct 2008 at 12:55 pm
  16. Logan Price wrote:

    I am looking forward to this feature. Currently, I have data that would fill more than one page, and using a single image doesn’t work.

    Logan

    Posted 12 Oct 2008 at 6:24 am
  17. Christophe Scholly wrote:

    Bonjour Thibault,

    Pourrais-ton avoir une fourchette de date quant à la sortie de la prochaine version de AlivePDF implémentant cette nouvelle fonctionnalité ? ;)
    Merci beaucoup,

    Bye

    Posted 05 Nov 2008 at 2:57 am
  18. Thibault Imbert wrote:

    Salut Christophe,

    Ca arrive, je suis en train de bosser dessus en ce moment :) Je peux pas te donner de dates mais ça arrive très prochainement. Je dirai ce mois-ci :)

    Thibault

    Posted 05 Nov 2008 at 1:25 pm
  19. Christophe Scholly wrote:

    Impeccable, j’attends ça avec impatience ! merci beaucoup.

    Posted 06 Nov 2008 at 1:30 pm
  20. Jack W wrote:

    Hi Thibault

    If you could find some time and explain to me, how could I add the following to a PDF?
    Array of custom components build dynamically in Flex.
    Each component consists of:
    -text from dynamically build TextArea
    -image
    -second text from another dynamically build TextArea.
    (they are all stacked in VBox in Flex )

    What I would like to achieve is to get position of each element according to changes in height of textArea (different length of text entered by the user).
    Taking into consideration changing number of components and height of their individual elements listed above, I would like to add pages accordingly.
    Currently I can transfer a whole VBox with all data (components array) as an image (snapshot) but I do not have control over the individual segments so sometimes an image is printed partially on consequent pages.
    Being new to AlivePDF I will greatly appreciate any help.

    Posted 26 Nov 2008 at 5:32 am
  21. Christophe wrote:

    Salut Thibault,
    Je reviens vers toi pour avoir des nouvelles de la prochaine version incluant notamment le support des DataGrid.
    Lors de mon dernier commentaire, tu la prévoyais pour le mois de novembre.
    Qu’en est-il à l’heure actuelle ?
    Merci de nous tenir informé :)

    Posted 13 Dec 2008 at 2:47 pm
  22. Bilouf wrote:

    Yop thibault ! As-tu une date pour la nouvelle version stp ?

    Posted 18 Dec 2008 at 4:50 pm
  23. Christophe wrote:

    Thibault, pourrais-tu nous tenir informé pour la nouvelle version…? Ca fait quelque temps que tu ne réponds plus :(
    Que se passe-t-il ?

    Posted 22 Dec 2008 at 10:22 pm
  24. Thibault Imbert wrote:

    Salut Christophe,

    Désolé je suis débordé avec le book qui sort dans quelques mois. Je n’ai pas encore finalisé la nouvelle version contenant cette fonctionnalité.

    Un énorme boulot a été fait sur la gestion des polices et ce n’est pas fini. Je termine le book mi janvier. Une fois terminé je me remets activement sur le développement de AlivePDF pour de nouvelles aventures et un tas de nouvelles features.

    Pour le moment je suis assez impuissant car trop pris, merci pour tout l’intérêt que tu portes à AlivePDF ;)

    Posted 22 Dec 2008 at 11:57 pm
  25. kim wrote:

    what version is this feature in? because i badly need it. There’s no addgrid() in the .6 alivepdf though, In need of your reply. It would be super to hear from you. Thanks!

    Posted 05 Jan 2009 at 6:47 pm
  26. Dal Mon wrote:

    This would be really be very useful. I know you are very busy writing your book. Is there any way to open source what is currently available for DataGrid so we can tinker around with it as well?

    Posted 07 Jan 2009 at 4:07 pm
  27. vaniacampos wrote:

    Hello world =)

    I need print dynamic datagrid (i dont know number of columns nor rows) and the object such as printdatagrid of flex dont work well… (cells are cut and too narrow then i can’t see the cell content…)

    Somebody recommend me AlivePDF, and i´m looking for information about this.

    Here, talk about Grid…. and my question is: What version of AlivePDF do content addGrid….??? I need it very much….

    The link to beta version has a FlexUnit.swc, but it dont have a method addGrid…

    Do someone know how deploy a datagrid in a PDF…?
    thanks in advance
    regards,
    vania

    Posted 04 Feb 2009 at 12:03 am
  28. Radek wrote:

    Indeed it would be perfect if data in the grid could be word wrapped and row height would match data content !

    Now i’m struggling with the same problem with PrintDataGrid in Flex and i can’t get row height to match my text in cell. only thing i could done was either to all rows have the same size – variableRowHeight = “true” doesn’t work either :(

    Meaby You will have some thoughts in spare time

    Posted 04 Mar 2009 at 12:35 am
  29. derickmayberry wrote:

    I am a little confused. I have the latest release of the library but when I instantiate a Grid the class does not take any parameters. Do I only THINK I have the latest release? I am fairly new to flex so I am sure I am just missing something.

    Posted 21 Apr 2009 at 7:08 pm
  30. Geetha Narayan wrote:

    I couldnt see addGrid() method in any of the documentation, is this live?

    Posted 22 Sep 2009 at 1:32 am
  31. Manohar wrote:

    Is there any way we can hide header of the grid

    Posted 11 Nov 2009 at 11:42 am
  32. Thibault Imbert wrote:

    Hi Manohar,

    Good idea, I will add this in the next drop.

    Stay tuned!

    Thibault

    Posted 11 Nov 2009 at 8:48 pm
  33. Vimal wrote:

    How to add a Tree Grid (Grouped Data) to PDF using AlivePDF?

    Thx.

    Posted 01 Feb 2010 at 11:44 pm
  34. Dan Luevano wrote:

    I’ve tried to use this component but I have some error in it, could someone help me? I’m begginer on this.
    please contact me via email.
    Regards!

    Posted 03 Mar 2010 at 4:57 am
  35. Stefano wrote:

    Hi,
    someone knows how to apply different colours to the data grid rows? (for example sutisfying some conditions about the cell content).

    Thanks
    Stefano

    Posted 30 Mar 2010 at 3:22 pm
  36. Sivakami wrote:

    Hi Thibault,

    In downloads page, i see 1.5 is still a RC version.

    Please let me know if it is a stable release.

    Posted 10 Jun 2010 at 8:17 am
  37. juan nicolas wrote:

    HI!

    I’m starting to use AlivePDF and is awesome! I need to do a trick like this, the problem is that the data to be presented or printout in the pdf is teh data comes from an XML file.

    Posted 30 Jun 2010 at 9:16 pm
  38. Deepak wrote:

    This one’s really coooool…. : )

    I’ve got the latest swc now. And I can see that the signature of myPDF.addGrid( 5, 5, grid ); has got changed, it’s now … addGrid(grid, 5, 5);

    But I get a “Cannot access a property or method of a null object reference” runtime error at that line….. : (

    not able to figure out what’s goin wrong,,,

    Posted 16 Jul 2010 at 6:07 am
  39. Kishore wrote:

    Hi, I tried to use this. I have placed the latest AlivePdf.swc in my lib.

    I have used the below way to create a grid
    var grid:Grid = new Grid ( dataGrid.dataProvider.toArray(), 200, 100, new RGBColor (0x00CCFF), new RGBColor (0xFFFFFF), new RGBColor ( 0×0000000 ), Joint.ROUND );

    But this is giving me compile time error :
    Multiple markers at this line:
    -1067: Implicit coercion of a value of type String to an unrelated type org.alivepdf.colors:IColor.
    -RGBColor
    -RGBColor
    -RGBColor

    Please help me soon.

    Also I would like to word-wrap the text inside my cells. I want fixed width but height should automatically get increased if content in a cell is more than the width provided for that cell.

    Please help soon as I have to deploy code in few days.

    Posted 21 Aug 2010 at 5:40 am
  40. Kishore wrote:

    I was able to resolve the said issue by writing the cod e as follows.
    var grid:Grid = new Grid ( dataGrid.dataProvider.toArray(), 200, 100, new RGBColor(0x00CCFF), new RGBColor(0xFFFFFF), true,new RGBColor ( 0×0 ) );

    But now I am facing another issue.

    compiles fine, runs fine. But pdf not getting generated. If I remove the below line, pdf gets generated successfully.

    pdf.addGrid(grid, 15, 300, true);

    Not able to figure out what would be the issue.

    Posted 21 Aug 2010 at 5:58 am
  41. usman wrote:

    hi, good work . but i have some problem when i want to add AdvanceDataGrid with grouping of columns in Pdf file. anyone who can help me..?

    Posted 30 Aug 2010 at 6:13 am
  42. Santanu Karar wrote:

    I’ve an application here which is an online version of Excel like software. Though AlivePDF helps me a lot with it’s new API with grid printing as PDF, I’m confused for column wrapping to multiple pages. If I would have several columns which may not fit in a page, how could them I break to multiple pages – as Excel does.

    Posted 06 Nov 2010 at 6:02 am
  43. Rishi wrote:

    hi Thibault,

    I am looking to generate pdf out of a dynamic datagrid . Is there a way for me to divide the datagrid data into mutipages using the addGrid method. Any pointers or working sample would be highly appreciated.

    Thanks

    Posted 06 Dec 2010 at 5:25 am
  44. Siddharth wrote:

    I am having the same problem as usman… I need to export grouped columns of an advanced data grid to PDF… Currently i have made a workaround of creating 2 instances of Grid… But I need the grouped column headers to appear on each page of the grid… Any suggestions ?

    Posted 31 Mar 2011 at 11:00 am
  45. hardik wrote:

    Hi …

    facing one problem.

    var grid:Grid = new Grid ( dp.toArray(),40,50,new RGBColor (0×0), new RGBColor (0xCCCCCC),new RGBColor (0),true,new RGBColor ( 0×0 ),1,JointStyle.ROUND);

    Here, when we pass ArrayCollection as below,

    dp.addItem( { Total: “Bob”, Applied: “Groove”, Status : “Paris” } );
    dp.addItem( { Total : “Bob”, Applied : “Wise”, Status : “Paris” } );

    In Generated Grid, Columns are automatically sorted alphabetically.

    like Applied | Status | Total

    Quite annoying …

    Is there any solution ?

    Cheers.

    Posted 14 Sep 2011 at 12:02 pm
  46. Robert Eaglestone wrote:

    Hello all. First, thanks for AlivePDF – it’s very cool and useful!

    Now I have a question: how about another method in PDF that adds a DataGrid? Since I already have a datagrid in my application, it would be really nice to be able to say:

    mypdf.addDataGrid( myDataGrid );

    Behind the scenes, this method would (I imagine) construct a Grid at least partly advised by the source DataGrid, use its dataProvider as its data source, and attach that to the PDF.

    Posted 27 Dec 2011 at 9:38 pm
  47. sundara wrote:

    AlivePDF is an excellent library to make PDF using ActionScript codes.

    How do I use this library with multiple columns without truncating (obviously with landscape mode display) data?

    This is highly required when displaying large sets of columns of DataGrid.

    Thank You.

    Posted 25 Jan 2012 at 9:20 am
  48. abhishek wrote:

    can we embed different fonts for different grid columns
    thx in advanced,
    :)

    Posted 03 Sep 2012 at 9:25 am

Trackbacks & Pingbacks 2

  1. From AlivePDF - AlivePDF 0.1.4.4 release on 11 Jul 2008 at 5:42 pm

    [...] For the next release, I am working actively on improving character set support for all of you guys working with special characters. The next release should integrate a first version of the dynamic grid feature. [...]

  2. From AlivePDF - Dynamic Grid coming in 0.1.4.8 on 27 Feb 2009 at 4:27 pm

    [...] am about to release the next version of AlivePDF which is having a new nice feature I already talked about a few months ago, I know you guys needed this one for some projects, you can already download the [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *