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

Dynamic Grid Feature updated !

Yesterday I realised that a lot of people were having troubles using the addGrid method in its current state, cause it was not flexible enough for everybody.

I just commited a new release of the 0.1.4.8 release in the AlivePDF SVN, here is how it works now.

First use is the following, you create a Grid and pass some data, you don't specify any width, alignement or even field or header text :

// create a Grid object as usual
var grid:Grid = new Grid ( dp.toArray(), 200, 120, new RGBColor (0x666666), new RGBColor (0xCCCCCC), new RGBColor (0), true, new RGBColor ( 0x0 ), Joint.MITER );

// pass the grid
myPDF.addGrid(grid);

What you will get is a grid with each column with a default width and each column field name as the header text.

Now here comes the good part :

// create columns with header text (here in French), field name, column width, header text and cell alignment
var gridColumnAge:GridColumn = new GridColumn("Age", "age", 20, Align.LEFT, Align.LEFT);
var gridColumnFirstName:GridColumn = new GridColumn("Prénom", "firstName", 20, Align.LEFT, Align.LEFT);
var gridColumnLastName:GridColumn = new GridColumn("Nom", "lastName", 40, Align.LEFT, Align.LEFT);
var gridColumnEmail:GridColumn = new GridColumn("E-Mail", "email", 45, Align.LEFT, Align.LEFT);
var gridColumnCity:GridColumn = new GridColumn("Ville", "city", 40, Align.LEFT, Align.LEFT);

// create a columns Array
// it determines the order shown in the PDF
var columns:Array = new Array ( gridColumnLastName, gridColumnFirstName, gridColumnAge, gridColumnEmail, gridColumnCity );

// create a Grid object as usual
var grid:Grid = new Grid ( dp.toArray(), 200, 120, new RGBColor (0x666666), new RGBColor (0xCCCCCC), new RGBColor (0), true, new RGBColor ( 0x0 ), Joint.MITER );

// pass the columns
grid.columns = columns;

// pass the grid
myPDF.addGrid(grid);

As you can see, a new GridColumn class is added, which allows you to represent physically in ActionScript each column, with a specific text header, a field, a width and alignment.

Keep in mind that if you use the columns property of the Grid class, it also allows you to filter some fields so that they do not appear in the grid. Let's say you do not want the email to show, you will simply modify the columns array this way :

var columns:Array = new Array ( gridColumnLastName, gridColumnFirstName, gridColumnAge, gridColumnCity );

Let's say you want to change the order of the columns in the grid :

var columns:Array = new Array ( gridColumnFirstName, gridColumnLastName, gridColumnCity, gridColumnAge );

Can you guys download this latest version and test it and let me know if it works nicely for you ? Thanks !

Comments 80

  1. JPM974 wrote:

    Toujours le même !
    Il me semble que le tableau aligns n’est plus initialisé. Du coup, les alignements ne fonctionnent plus.

    A+

    Posted 13 Mar 2009 at 11:02 am
  2. Matthieu wrote:

    Bonjour, en fait ne penses-tu pas qu’il serait plus simple de passer directement un datagrid ?

    En prenant un datagrid tu as le nom des colonnes, l’ordre, les données !

    Tout en fait :) ! Qu’en penses-tu ? J’avais remarqué également que la position du tableau n’était pas prise en compte :) Merci des corrections et de ta réactivité ! Tu fais du bon boulot.

    Posted 13 Mar 2009 at 11:40 am
  3. bmoss wrote:

    Nice, I did same work yesterday :)

    Posted 13 Mar 2009 at 3:51 pm
  4. bmoss wrote:

    And you have there error. Before pagebreak u need real height of row like this.

    //get number of lines
    for(var l : int=0 ; l < lngProp ; l++ )
    {
    pdfColumn = columns[l] as PDFGridColumn;
    nb = Math.max( nb,nbOurLines( pdfColumn.width, !buffer[i] ? pdfColumn.labelField : buffer[i][ pdfColumn.dataField ] ) );
    }

    //if pagebreak, add new page
    checkOurPageBreak(5*nb);

    Posted 13 Mar 2009 at 3:57 pm
  5. Roy wrote:

    Hi Thibault,

    Just wanted to say I love your stuff, it already works great and really has some potential for the future!

    Two thing I’d like to say though:
    - first of all i noticed your documentation is not quite up-to-date (Grid doc is missing for example)
    - when i use the method writeText, and define the margins for the document (L40, R40 in MM, A4), some but not all lines slip past the right margin and continue until its out of document bounds. Any idea what is causing this?

    For the rest, keep up the excellent work!

    Roy

    Posted 13 Mar 2009 at 4:21 pm
  6. Thibault Imbert wrote:

    Salut JPM974,

    Télécharge la nouvelle release que je viens de commit sur le SVN, ce bug est corrigé. Désormais dans le constructeur de la classe GridColumn tu peux passer un alignement pour le header et pour la cellule :)

    Thibault

    Posted 13 Mar 2009 at 5:26 pm
  7. Thibault Imbert wrote:

    Salut Matthieu,

    En effet il semblerait plus logique au départ de passer une DataGrid, mais je souhaite conserver une compatibilité avec les composants Flash ou Flex qui ont une API qui n’est pas forcement la même, et ensuite permettre à un développeur de passer une simple collection de données provenant d’une base de données ou d’un fichier XML et non issu d’un composant.

    Pour cela, je préfère garder une classe Grid qui accepte simplement un tableau :) Au pire, le développeur préparera les données pour la Grid, à l’inverse ça risquerait de bloquer le développeur.

    As tu testé la dernière version sur le SVN ? Normalement le souci de position de la grille qui ne prenait pas en compte les paramètres x et y est corrigé.

    Posted 13 Mar 2009 at 5:31 pm
  8. Roy wrote:

    Thibault,

    Regarding to my previous post i found out what was breaking the margin; in my case the special character ‘ï’ was messing things up. I suspect it has something to do width encoding.

    I’m now trying to use the writeFlashHtmlText method, but i believe i’m missing something; i keep getting compiler errors with this method. Any guesses?

    Thanks

    Posted 13 Mar 2009 at 5:44 pm
  9. Thibault Imbert wrote:

    Hi Roy,

    Interesting bug for the ‘i’ character, I will take a look.

    What kind of error do you get concerning the WriteFlashHtmlText method ?

    Thibault

    Posted 13 Mar 2009 at 5:46 pm
  10. Roy wrote:

    Hi Thibault,

    Thanks for the response, i’m looking forward to your fix.
    Regarfing the WriteFlashHtmlText problem; I overlooked some of the content my client provided me, somewhere down the line it said . Your function tried to parse it as XML and failed. So your function works fine ;)

    Roy

    Posted 13 Mar 2009 at 6:41 pm
  11. Roy wrote:

    Whoops, your comment parser removed some text after ‘down the line it said…’. What should be there is some malformed XML tag, just to point out the problem.

    Posted 13 Mar 2009 at 6:45 pm
  12. JPM974 wrote:

    Bonsoir à tous,

    Je ne serai pas au bureau cette semaine…donc pas de tests jusqu’àu lundi 23.

    J’ai rencontré un souci de “wordWrap” tout à l’heure : au lieu d’augmenter la hauteur de cellule, la méthode addMultiCell, je crois, affiche la 2e ligne de texte dans la cellule suivante (dans certains cas seulement). Je jette un oeil dès mon retour.

    Bonne semaine.

    Posted 13 Mar 2009 at 8:13 pm
  13. Clive wrote:

    Works perfectly for me! Thank you :-)

    Posted 14 Mar 2009 at 6:31 am
  14. Quentin wrote:

    great work !!! as usual

    bonne journée

    Quentin

    Posted 16 Mar 2009 at 3:40 pm
  15. Mike wrote:

    Terrific stuff!

    It would great for those of us using Unit.INCHES if Number was used in place of int for GridColumn.width, Grid.width and Grid.height.

    Posted 17 Mar 2009 at 3:11 pm
  16. Matthieu wrote:

    Bonjour et merci de ta réponse. J’ai une question comment puis-je faire en sorte de ne pas avoir systématiquement des bordure ?

    Pour résumé si tu regarde un DataGrid standard de flex tu vois qu’il n’y a pas de trait horizontal uniquement des verticaux !

    Peut-on envisager cette possibilités avec ta classe actuelle ?

    Merci d’avance,
    Matthieu

    Posted 17 Mar 2009 at 7:34 pm
  17. Thibault Imbert wrote:

    Hi Mike,

    I will make the update, thanks for the info :)

    A new release will be available today fixing this.

    best,

    Thibault

    Posted 18 Mar 2009 at 10:42 am
  18. willis wrote:

    Thibault, addGrid is amazing function. Now I’m using this. But found one bug for the checkPageBreak(5). It seems that the page break is wrong. I can not upload image from here. Same like bmoss wrote before.
    And according to bmoss’ suggestion, I add codes like below to addGrid() to resolve this page break bug.
    //added by willis 18-Mar-2009
    var nb:int = 0;
    for(var kk:int=0;kk<lngColumns;kk++){
    nb = Math.max(nb,nbLines(columns[kk].width,rows[kk]));
    }
    //~end
    textStyle( color, 1 );
    //checkPageBreak(5);
    //modified by willis
    checkPageBreak(5*nb);

    Posted 18 Mar 2009 at 11:07 am
  19. Thibault Imbert wrote:

    Hi willis,

    Happy you like addGrid feature :)

    I noticed that bug the other day and changed the way it is done in the current release I have. I will post it today and it will have several other enhancements.

    Thanks !

    Thibault

    Posted 18 Mar 2009 at 11:11 am
  20. Bastard wrote:

    I’m new to flex and programming in general so forgive the stupid question…does create.cs file need to be copied into the lib directory? where does it exactly need to be?

    thanks in advance!

    Posted 19 Mar 2009 at 9:31 pm
  21. willis wrote:

    Hi Thibault,
    Thank you for your response. The latest code resolve exactly the addGrid() break page issue. Thanks you guys hard work.
    Here for my special requirement, I think we need display the Grid Header Text at every page when Grid has multiple page datas. Fortunately, I only make little code change in the addGrid() & addRow() to implement this function to always write the DataGridHeader at every page.
    If you can add this function it will be great!

    Posted 20 Mar 2009 at 4:27 am
  22. Dipingere wrote:

    Thibault Imbert… wow!!!! your work based in FPDF is great, you are Wonderful.

    Thank you so much…

    your Movie “alivepdf_dynamic_grid.swf” it´s really beautiful.

    I Have some Questions…

    Q: Could you upload a .fla (flash CS4 AS 3.0) of “alivepdf_dynamic_grid”? or this was generated in flex?

    Q: How can I use addImage or inputText in PDF file?
    Q: Can you make some tutorial about it?

    I tried to use AlivePDF “Grid” using only Flash CS4 (not Flex) the AS3 code inside the swf file “class path” when I click “generate_btn” it only generates a PDF with a blank page “create.pdf (1k)”

    now it´s ok. It was an import and dataProvider error.

    but when I try to edit them using dataGrid component of flash CS4, the .swf with dataGrid it is ok, the PDF created takes all data form dataprovider.addItem, but I want to remove the last Column only in the PDF not in the .swf

    I tried AlivePDF using:

    - import org.alivepdf.data.GridColumn;

    - “var column1:GridColumn = new GridColumn(…”

    - “var someColumns:Array = new Array (…”

    the PDF generates the Grid with columns but empty.

    This “create.pdf” is not taking any data from dataProvider.

    kind Regards

    Posted 22 Mar 2009 at 4:00 am
  23. Noel wrote:

    Hi great work !!!

    how do i hide the border of the grid ?…i tried changing the color to white but i still see the black border

    var grid:Grid = new Grid ( ar.toArray(), 200, 120, new RGBColor (0xFFFFFF), new RGBColor (0xFFFFFF), new RGBColor (0), false, new RGBColor (0xFFFFFF), Joint.MITER );

    Posted 25 Mar 2009 at 4:22 pm
  24. Tejas Sanghavi wrote:

    Hi Thibault,

    Thanks for making such a wonderful app and the addGrid functionality. We just start making use of the Grid feature and realized that it still needs more enhancements. Would be happy to help you on this

    1. Multiline (wrapped) rows and headers if happening near the end of a page cause the application to display junk (1 page per column).
    2. How to implement multiline headers and footer which merge various columns

    I will be happy to share the output to you if needed

    Regards,
    Tejas

    Posted 06 Apr 2009 at 4:33 pm
  25. Ric wrote:

    Hi all,

    Just a question. Dos the grid actually works? Been trying and nothing. Could i please have a piece of source code that i would just copy and past and will work?

    Many thanks

    Posted 07 Apr 2009 at 3:10 pm
  26. Thibault Imbert wrote:

    Hi Ric,

    Yes the Dyamic Grid works, can you show me the code you tried ?

    best,

    Thibault

    Posted 07 Apr 2009 at 6:26 pm
  27. Vimal wrote:

    Hi All,

    I’m not able to make this work. I’m getting a blank PDF only with page title. I’m using Pdf version 8. Could you please provide a working example?

    Thanks
    Vimal

    Posted 09 Apr 2009 at 1:06 am
  28. Zane wrote:

    NOTE you also need to setfont like the following or you will get a null value error when rendering the grid:

    myPDF.setFont ( FontFamily.ARIAL, Style.NORMAL, 12 );

    Hope that saves some headache for someone…

    Posted 19 Apr 2009 at 9:59 am
  29. FORA wrote:

    maybe Ihave this problem because i’m not using AIR but juste flex app ????

    what do u think ???

    Posted 20 Apr 2009 at 12:16 pm
  30. FORA wrote:

    Hello All,

    I have a problem with the dynamic grid when i try to add a grid with dataProvider (the array) containing a number of items that need more than one PDF page. the first page is well generated but the othres are Badly structured.

    Posted 20 Apr 2009 at 12:18 pm
  31. Thibault Imbert wrote:

    Hi Fora,

    Can you please send me a PDF example to see the problem ? Can you also show the array collection you use to feed the grid ?

    best,

    Thibault

    Posted 20 Apr 2009 at 12:24 pm
  32. FORA wrote:

    here is the dataGrid

    Posted 20 Apr 2009 at 12:34 pm
  33. FORA wrote:

    hi Thibault,
    if your are not againt i prefer speak french.
    j’arrive pas à envoyer mon code, peut etre c par ce que c’est trop long

    Posted 20 Apr 2009 at 12:36 pm
  34. FORA wrote:

    hi Thibault,
    i can’t send the code in posts , maybe it’s too long, i retry now

    Posted 20 Apr 2009 at 12:38 pm
  35. FORA wrote:

    Here is the data grid :

    Posted 20 Apr 2009 at 12:44 pm
  36. FORA wrote:

    do you have it ????????

    Posted 20 Apr 2009 at 12:46 pm
  37. FORA wrote:

    Salut Thibault,
    comme je l’ai dis juste avant, je n’arrive pas à envoyer le code de l’arraycollection(le poste de 12:34pm et de 12:44pm), je ne vois pas non plus comment je peus t’envoyer l’exemple du PDF car je ne peus pas joindre le documentPDF à un poste. as tu une idée de comment je peus te faire parvenir le code et l’exemple du pdf ????

    Posted 20 Apr 2009 at 1:13 pm
  38. FORA wrote:

    Salut Thibault,

    Voici sur la 1ere page de mon blog, le document PDF et le code utilisé.

    le blog : http://fora.blogvie.com/

    MERCI

    Posted 20 Apr 2009 at 1:31 pm
  39. FORA wrote:

    Finalement j’ai pu resoudre mon probleme, pour cela j’ai du reconstruire l’array que je passe à la méthode en lui précisant les colonnes et ca marche. En tout cas merci bcp

    Posted 22 Apr 2009 at 3:30 pm
  40. yimo wrote:

    Hi,

    I don’t know what I’m doing wrong, I downloaded AlivePDF 0.1.4.8.zip file, because the project I’m working on I have to export the datagrid information to a pdf, but every time I tried to export the information using the instruction myPdf.addGrid( grid ); it gives the following error “Unable to access a property or method of a reference to an null object” ‘at org.alivepdf.pdf::PDF/nbLines()[..'
    the function I use to save the pdf file is:
    private function pdfSave():void{
    var private var dp:ArrayCollection = new ArrayCollection ( [{ firstName : "Bob", lastName : "Groove", city : "Paris" },
    { firstName : "Bob", lastName : "Wise", city : "Paris" },
    { firstName : "Bob", lastName : "Wise", city : "Paris" },
    { firstName : "Bob", lastName : "Wise", city : "Paris" }]);
    //Create columns with headers
    var gridColumnName:GridColumn=new GridColumn(“Name”,”firstName”,200,Align.LEFT,Align.RIGHT);
    var gridColumnLastName:GridColumn=new GridColumn(“Last Name”,”lastName”,200,Align.LEFT,Align.LEFT);
    var gridColumnCity:GridColumn=new GridColumn(“City”,”city”,100,Align.LEFT,Align.LEFT);

    //Create columns array
    var columnsArray:Array = new Array(gridColumnName,gridColumnLastName,gridColumnCity);

    //create a grid object
    var grid:Grid = new Grid ( dp.toArray(), 200, 120,
    new RGBColor (0×666666), new RGBColor (0xCCCCCC),
    new RGBColor (0), true, new RGBColor ( 0×0 ), Joint.MITER );

    grid.columns = columnsArray;

    myPdf = new PDF(Orientation.PORTRAIT,Unit.CM,Size.LETTER);
    myPdf.setDisplayMode(Display.FULL_WIDTH,Layout.SINGLE_PAGE,PageMode.USE_NONE,1);
    myPdf.addPage();
    myPdf.textStyle(new RGBColor(0),1);
    Alert.show(String(dt));
    myPdf.addGrid( grid );
    myPdf.save(Method.REMOTE,”http://localhost/ejemplos/create.php”,Download.ATTACHMENT,”GeneratedPdf.pdf”);
    }
    I hope you can help me out, to figure it out what I’m doing wrong
    Thanks in advance….

    Posted 25 Apr 2009 at 12:16 am
  41. Thibault Imbert wrote:

    Hi yimo,

    First thing to try is the latest version of AlivePDF available on the SVN :

    http://code.google.com/p/alivepdf/source/browse/#svn/tags/alivepdf-0.1.4.8

    let me know !

    best,

    Thibault

    Posted 25 Apr 2009 at 12:23 am
  42. hridaya wrote:

    Hi! I’m having a little bit of a hard time trying to import the ArrayCollection class. Could you point me in the right direction? I have CS3 and CS4 but no Flex! Thank you so much! %)

    Posted 27 Apr 2009 at 2:07 am
  43. hridaya wrote:

    Here’s the only useful link I got…
    http://www.novio.be/blog/?p=9

    Posted 27 Apr 2009 at 2:26 am
  44. kelvin.zhao wrote:

    To yimo:

    I have the same problem as you. check out the error information i figured it out.

    You must to set the font type first.
    add this:
    //myPdf.addPage();
    pdf.setFont(FontFamily.ARIAL , Style.NORMAL, 12);

    I think this can resolve your problem.

    Posted 28 Apr 2009 at 12:35 pm
  45. Sameer wrote:

    Hi Thibault!!

    Your FPDF work is great. Thank you so much.
    I have few questions regarding the addGrid method:

    1) Is there any way to apply labelFunction to grid columns data? (I am using a dynamic grid with date and float columns and I need to format their values for display in pdf.)

    2) How to provide left/right padding to grid columns?

    Thanks in advance.
    - Sameer

    Posted 05 May 2009 at 12:47 am
  46. Bea wrote:

    This seems to work well but I can only get it to work when the page size is set in MM. The rest of my system is designed around Inches. Any idea when the update for Inches will take place?

    Posted 07 May 2009 at 7:00 pm
  47. oviyan wrote:

    Hi
    AlivePDF really great stuff. when i try to add grid into myPDF im getting error as follows
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.alivepdf.pdf::PDF/nbLines()
    at org.alivepdf.pdf::PDF/getRect()
    at org.alivepdf.pdf::PDF/addGrid()
    at DrawingDemo/generatePDF()
    at DrawingDemo/__generate_btn_click()

    Please help me out to solve the issue. im using Flex2.0

    Thanks in advance

    Posted 15 May 2009 at 11:36 am
  48. Danny Kopping wrote:

    Hey Thibault!

    Congrats on a fantastic API!
    Is it possible to add an image to a cell in a grid?

    Posted 19 May 2009 at 4:52 pm
  49. Portillo wrote:

    How can I put my datagrid information inside an Alive PDF grid???

    Posted 10 Jun 2009 at 1:12 pm
  50. umarfarook84 wrote:

    When we are adding more than 10 -15 columns to a grid which does not fit the page , how can we handle adding the remianing columns to the new page (just like excel).

    Any idea on this will be great helpful

    Posted 26 Jun 2009 at 9:38 am
  51. xcom wrote:

    All the columns does he(she) support alivepdf????

    Posted 27 Jun 2009 at 2:34 pm
  52. umarfarook84 wrote:

    Hi Thaibult,

    Can we add a image to the column in the datagrid. If so how to do that.

    Regards,
    Farook

    Posted 03 Jul 2009 at 8:13 am
  53. UmarFarook84 wrote:

    I tried to overcome this above issue by extending the PDF class and overriding the
    addMulticell method.
    The addMulticell method currently takes a string object alone. If this method is
    generalized to get all objects including the image or bytearray the above issue will
    be resolved.

    currently i am overriding the addMulticell to achieve the above functionality.
    Below is the sample code.

    override public function addMultiCell ( width:Number, height:Number, text:String,
    border:*=0, align:String=’J', filled:int=0):void
    {
    this.width=width;
    this.height=height;
    cw = currentFont.cw;
    var imageType:String=”";

    if(text.indexOf(“Image:”)!=-1)
    {
    imageType=text.substr(text.indexOf(“:”));
    addImageStream
    (Application.application.bytes,currentX,currentY,0, 0, 1);

    }
    else
    {
    if ( width==0 ) width = currentPage.w-rMargin – currentX;

    var wmax:Number = (width-2*cMargin)*1000/fontSize;
    var s:String = findAndReplace (“\r”,”,text);
    var nb:int = s.length;

    if( nb > 0 && s.charAt(nb-1) == “\n” ) nb–;

    var b:* = 0;

    if( border )
    {
    if( border == 1 )
    {
    border=’LTRB’;
    b=’LRT’;
    b2=’LR’;
    }
    else
    {
    b2=”;
    if(border.indexOf(‘L’)!= -1) b2+=’L';
    if(border.indexOf(‘R’)!= -1) b2+=’R';
    b = (border.indexOf(‘T’)!= -1) ? b2+’T’ : b2;
    }
    }

    var sep:int = -1;
    var i:int = 0;
    var j:int = 0;
    var l:int = 0;
    var ns:int = 0;
    var nl:int = 1;
    var c:String;

    var cwAux:int = 0;

    while (i0)
    {
    ws=0;
    write(’0 Tw’);
    }
    addCell(width,height,s.substr(j,i-j),b,2,align,filled);
    i++;
    sep=-1;
    j=i;
    l=0;
    ns=0;
    nl++;

    if(border && nl==2) b=b2;
    continue;
    }

    if(c==’ ‘)
    {
    sep=i;
    var ls:int = l;
    ns++;
    }

    // TBO
    cwAux = cw[c] as int;
    if (cwAux == 0) cwAux = 580;
    l += cwAux;

    if (l>wmax)
    {
    if(sep==-1)
    {
    if(i==j) i++;
    if(ws>0)
    {
    ws=0;
    write(’0 Tw’);
    }
    addCell(width,height,s.substr(j,i-j),b,2,align,filled);
    }
    else
    {
    if(align==Align.JUSTIFIED)
    {
    ws=(ns>1) ? (wmax-ls)/1000*fontSize/(ns-1) : 0;
    write(sprintf(‘%.3f Tw’,ws*k));
    }

    addCell(width,height,s.substr(j,sep-j),b,2,align,filled);
    i=sep+1;

    }
    sep=-1;
    j=i;
    l=0;
    ns=0;
    nl++;
    if ( border && nl == 2 ) b = b2;
    }
    else i++;
    }
    //Last chunk
    if(ws>0)
    {
    ws=0;
    write(’0 Tw’);
    }

    if ( border && border.indexOf (‘B’)!= -1 ) b += ‘B’;
    addCell ( width,height,s.substr(j,i-j),b,2,align,filled );
    currentX = lMargin;
    }
    }

    Posted 06 Jul 2009 at 5:42 pm
  54. Thomas wrote:

    Hi, how to display the image in the gridColumn if one of GridColumn store the image file path and name (such as /abc/abc.jpg in the gridColumn) ? Many Many Thanks!

    Posted 13 Jul 2009 at 4:32 am
  55. Peter wrote:

    Hey Thibault. Awesome project. I hate to sound dumb here but I keep getting a 1067: Implicit coericion on a value of type String to an unrelated type Number when i copy your var grid:Grid = new Grid ( dp.toArray(), 200, 120, new RGBColor (0×666666), new RGBColor (0xCCCCCC), new RGBColor (0), true, new RGBColor ( 0×0 ), Joint.MITER ); line. I think it has something to do with the Joint.Miter part.. is there something obvious im doing wrong here? thank you!!

    Posted 14 Jul 2009 at 7:44 pm
  56. Franz Jordan wrote:

    Hi, i have a litle probem the header text in my grid appears like a black line, i have tried to change the colors to display the header text but nothing is posible, could you help me please?

    Posted 16 Jul 2009 at 8:01 pm
  57. Franz Jordan wrote:

    I have solved my problem putting this sentence after the grid sentence
    pdf.textStyle(new RGBColor(0×666666));

    PDF Alive works very well!!!!

    Posted 17 Jul 2009 at 6:11 pm
  58. David Émond wrote:

    Hi, I try to add a grid in my pdf and I have a problem. See this message error :

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.alivepdf.pdf::PDF/nbLines()[/Users/timbert/Documents/Flex Builder 3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:3014]
    at org.alivepdf.pdf::PDF/getRect()[/Users/timbert/Documents/Flex Builder 3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:2972]
    at org.alivepdf.pdf::PDF/addGrid()[/Users/timbert/Documents/Flex Builder 3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:2923]
    at TableauPDF/CreatePDF()[C:\Documents and Settings\demond\My Documents\Flex Project\_Example_Flash10-3D\TableauPDF\src\TableauPDF.mxml:60]
    at TableauPDF/___TableauPDF_Button1_click()[C:\Documents and Settings\demond\My Documents\Flex Project\_Example_Flash10-3D\TableauPDF\src\TableauPDF.mxml:74]

    I use flex3 and alivePDF 1.4.9

    Please help me. Thanks

    Posted 04 Aug 2009 at 3:41 pm
  59. David Émond wrote:

    Sorry, the real message associated with alivePDF 1.4.9 is : (the lines problems are differents)

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at org.alivepdf.pdf::PDF/nbLines()[/Users/timbert/Documents/Flex Builder 3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:3079]
    at org.alivepdf.pdf::PDF/getRect()[/Users/timbert/Documents/Flex Builder 3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:3037]
    at org.alivepdf.pdf::PDF/addGrid()[/Users/timbert/Documents/Flex Builder 3/AlivePDF/src/main/flex/org/alivepdf/pdf/PDF.as:2988]
    at TableauPDF/CreatePDF()[C:\Documents and Settings\demond\My Documents\Flex Project\_Example_Flash10-3D\TableauPDF\src\TableauPDF.mxml:83]
    at TableauPDF/___TableauPDF_Button1_click()[C:\Documents and Settings\demond\My Documents\Flex Project\_Example_Flash10-3D\TableauPDF\src\TableauPDF.mxml:103]

    Posted 04 Aug 2009 at 4:48 pm
  60. davidemond wrote:

    Hi all, I found my problem. You must set the textStyle and the Font before added the grid. Thanks at all.

    myPDF.textStyle( new RGBColor(0), 1 );
    myPDF.setFont ( FontFamily.ARIAL,Style.BOLD, 12 );

    Posted 04 Aug 2009 at 5:08 pm
  61. David Mustafa wrote:

    first i would like to say thanks for all your work alivepdf is way better then sending transfer objects to php to convert into pdf. now that i dont have to take images of datagrids even better :) .

    i get one little problem when i start using alivepdf grids and mxml grids at the same time. Can not resolbe a multiname reference unambiguously mx.containers:Grid and org.alivepdf.data:grid. im sure its something stupid on my part any help?

    Posted 04 Aug 2009 at 11:29 pm
  62. Thibault Imbert wrote:

    Hi David,

    Happy to see that it now works smoothly for you ;)

    best,

    Thibault

    Posted 06 Aug 2009 at 2:15 pm
  63. Dan wrote:

    I just found this and I hope that it can help. I’m frustrated with the native print functionality in Flex. My concern is printing grids of data; (where the grids have a varying amount of data; like the items in a shopping cart.) and the data “spilling” over to multiple pages. Does this really work?
    How is this different from the native Flex printing?

    Posted 07 Aug 2009 at 8:42 pm
  64. Martin wrote:

    Hi,

    This question has been asked before, but there is no answer. Is it possible to to apply labelFunction to grid columns data?

    Posted 08 Aug 2009 at 4:48 pm
  65. Mallik wrote:

    Hey looks great. I love it. But seems like we need to create AlivePDF Grids with the dataprovider. I needed something similar to this but I have a canvas that srolls with static charts and grids and I want AlivePDF to readjust and print the whole canvas ignoring the scrollbar. Is it going to be possible to create a image of the whole canvas and allow AlivePDF to figure out how many pages it needs to fit the who big fat image of h: 1900 w: 600 ??

    Please post any suggestions

    Thanks

    -Mallik

    Posted 02 Sep 2009 at 3:49 pm
  66. Jonas357 wrote:

    Hi Thibault,

    Thanks for an excellent product! And i hope you keep working on it!

    Unfortunately I have a hard time finding information about what you can do with AlivePDF. Like this “grid” that seems wonderful, but the examples are not complete and I have to do a lot of detective work to understand it. This could be helped if there was complete example files with data creation and imports allready present.

    You unfortunately leave out the “dp” and the ArrayCollection creation on this page in the examples.

    Could you please post comlete examples that can be built right away?

    It is also hard to find all the classes you need to import, they are not included in the examples.

    Many thanx!

    /Jonas

    Posted 16 Sep 2009 at 4:48 pm
  67. Amanda wrote:

    thank you for this wonderful too. just wanted to share that its very easy to return data to a grid from a web service by loading it into an array collection. works like a charm.

    Posted 17 Sep 2009 at 3:24 pm
  68. Shankar wrote:

    Hi Thibault,

    This is my code, it does not produce the DataGrid in the PDF, its empty for me.

    Let me know the possible error.

    var gotIt:ArrayCollection = new ArrayCollection(this.dataGrid.dataProvider as Array);

    var grid:Grid = new Grid(gotIt.toArray(), 150, 150, new RGBColor(0×666666), new RGBColor(0xCCCCCC), new RGBColor(0), true, new RGBColor(0×0), 1, Joint.ROUND);
    myPDF.addGrid( grid );

    Thanks in Advance

    Posted 22 Sep 2009 at 6:41 pm
  69. Eugene Kardash wrote:

    Is there a way to add a footer to the generated PDF with the grid? And page numbers?
    Thanks!

    Posted 25 Nov 2009 at 3:28 am
  70. Eugene Kardash wrote:

    I figured out the footre problem. I had to modify PDF.as code a little:

    public function footer():void
    {
    /* to be overriden (uncomment for a demo ) */
    // Uncommented and modified by Eugene Kardash on 11/24/2009
    this.saveFont();
    this.setY (-15);
    this.setFont( FontFamily.ARIAL, Style.ITALIC, 8 );
    this.addCell(0,10,’Page ‘+totalPages,0,0,’C');
    this.newLine(20);
    this.restoreFont();
    }

    // Added by Eugene Kardash on 11/24/2009
    private var lastSavedFont:Array = new Array();

    // Added by Eugene Kardash on 11/24/2009
    public function saveFont():void
    {
    lastSavedFont = new Array(this.fontFamily.toLowerCase(), this.fontStyle.toUpperCase(), this.fontSizePt);
    }

    // Added by Eugene Kardash on 11/24/2009
    public function restoreFont():void
    {
    if (lastSavedFont != null && lastSavedFont.length > 1)
    this.setFont(lastSavedFont[0], lastSavedFont[1], int(lastSavedFont[2]));
    }

    Posted 25 Nov 2009 at 4:43 am
  71. dasaint_gray wrote:

    Hi Mr. Imbert

    How to add image stream into Grid? Is this possible for version 0.1.4.8?

    Thank you very much

    Posted 11 Dec 2009 at 2:24 pm
  72. Miguel wrote:

    Hi.
    I have a problem with a Grid:
    If the header text is too long, the last line of it overflows into the cell below. Is there any way to avoid this ?
    Thanks.

    Posted 18 Feb 2010 at 8:04 pm
  73. Christian K. wrote:

    Hi,
    a question to the Grid Feature of this great Package:
    i am loading data into a Grid, where the height of the rows is different. This is because I am putting different Text Fields into one cell of the grid. My Problem begins with the Pagebreak. Can I get the information about the height of the grid to calculate the Pagebreak ??

    Thanks for any help.

    Posted 28 Feb 2010 at 1:59 pm
  74. Thiru wrote:

    Hi
    i am working on AlivePDF, to convet advanced datagrid into pdf, the ADG has almost 20 columns, I when Ia m conveting the data most of the column gets cut, so the user cant able to view the content.
    1. I like to know how to fit the whole gril in a page, like the option u have for “addImage”

    2. Do u have any option so I can able to split the data into 2 parts so I display first 10 column, then nex 10 column I will show bellow the first 10

    Regards
    Thiru

    Posted 05 Jul 2010 at 1:50 pm
  75. Mohammed wrote:

    Hi,
    I need some help to add image in cell of grid

    regards

    Posted 18 Oct 2010 at 6:57 pm
  76. Santanu Karar wrote:

    I’m using the latest build release of AlivePDF, creating a new page with ‘addPage’, adding some texts with ‘writeFlashHtmlText’ and then trying to adding a Grid component through ‘addGrid’ method. Well, all got added and can generate a PDF too, but the Grid always adding with a new page! Any idea?

    Posted 12 Nov 2010 at 1:32 pm
  77. Santanu Karar wrote:

    On an addition to my previous post, I’ve found this happens only when adding ‘writeFlashHTMLText’ – probably this methods takes up a whole page height and the method also doesn’t have any fixed height property. ‘addText’ though keep the text and grid in the same.. but it doesn’t have any text wrapping property (?)

    Posted 15 Nov 2010 at 6:39 am
  78. khushboo wrote:

    hi,
    This is a great API..
    can you please tell me if there is a way to auto adjust the width of the grid so that the text fits in the cell of addgrid method??

    Posted 24 Jan 2011 at 8:26 am
  79. Billy Bob wrote:

    Hi, is there a way to explicitly set each cell’s background color? Something like grid.setCellColor(2,3, 0xff0000) would set the 4th cell in the 3rd column to that color.

    Posted 10 Jun 2011 at 6:22 pm
  80. Dima wrote:

    Is it possible to get already compiled version of SWC file or SWF file from you? Its a great tool but it makes my life nightmare to work with it using a javascript. I dont have flex sdk to build this version, and looks like latest u have in download do not support Grid feature. Thank you very much for your help.

    Posted 21 Feb 2012 at 8:58 pm

Post a Comment

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