Alicia Posted April 16, 2008 Author Share Posted April 16, 2008 yeah,,, i did try to change to fetch row but still the same .. showing empty page.. what seems to be the prob.. anyone can advise ? Quote Link to comment Share on other sites More sharing options...
Alicia Posted April 16, 2008 Author Share Posted April 16, 2008 it is working now but i have problem adjusting the position of the info : - how to add a line break ? is it just adjust the second value in a function ? - I tried to adjust the x position of the text but why when I adjust the first value in the function, nothinig is changed ? can somebody give me an idea how to accomplish this ? cell (x, y, 'value', a, b) can somebody double confirm with me the following : x - position left and right y - position up and down a - ??? b - ??? what is this a and b for ? i did read fpdf but dun really understand.. please advise... - why is the description is long, we have to use multicell instead of cell function ? $this->SetFont('Arial','B',12); $ypos = $this->getY() + 5; $this->setY($ypos); $this->Cell (100, 6, "$name ($code)", 0, 0); $this->Cell (30, 6, "\$$price", 0, 1, 'R'); $this->SetFont('Arial','I',10); $this->Cell (130, 6, 'Description', 0, 1); $this->SetFont('Arial','',10); $this->Cell(10); // indent $this->Multicell (90, 4, $desc); $ypos2 = $this->getY(); // end of text Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 16, 2008 Share Posted April 16, 2008 Cell Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, int fill [, mixed link]]]]]]]) Version 1.0 Description Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text. If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. Parameters w Cell width. If 0, the cell extends up to the right margin. h Cell height. Default value: 0. txt String to print. Default value: empty string. border Indicates if borders must be drawn around the cell. The value can be either a number: 0: no border 1: frame or a string containing some or all of the following characters (in any order): L: left T: top R: right B: bottom Default value: 0. ln Indicates where the current position should go after the call. Possible values are: 0: to the right 1: to the beginning of the next line 2: below Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. align Allows to center or align the text. Possible values are: L or empty string: left align (default value) C: center R: right align fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. link URL or identifier returned by AddLink(). Example //Set font $pdf->SetFont('Arial','B',16); //Move to 8 cm to the right $pdf->Cell(80); //Centered text in a framed 20*10 mm cell and line break $pdf->Cell(20,10,'Title',1,1,'C'); MultiCell MultiCell(float w, float h, string txt [, mixed border [, string align [, int fill]]]) Version 1.3 Description This method allows printing text with line breaks. They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other. Text can be aligned, centered or justified. The cell block can be framed and the background painted. Parameters w Width of cells. If 0, they extend up to the right margin of the page. h Height of cells. txt String to print. border Indicates if borders must be drawn around the cell block. The value can be either a number: 0: no border 1: frame or a string containing some or all of the following characters (in any order): L: left T: top R: right B: bottom Default value: 0. align Sets the text alignment. Possible values are: L: left alignment C: center R: right alignment J: justification (default value) fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0. Quote Link to comment Share on other sites More sharing options...
Alicia Posted April 16, 2008 Author Share Posted April 16, 2008 yeah.. i did read that from fpdf.org manual and the problem is, what I edited from the script doesnt seem to bring the effect I want.. for instance, i want it all to be aligned left with same left margin but failed even i used same value for x please advise./ Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 16, 2008 Share Posted April 16, 2008 is the above code you used ??? or a different one ??? Quote Link to comment Share on other sites More sharing options...
Alicia Posted April 16, 2008 Author Share Posted April 16, 2008 same code... but i adjust the value only... but i still couldnt align all the column and rows as I want... please advise Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 16, 2008 Share Posted April 16, 2008 will this not work? <?php $this->SetFont('Arial','B',12); $ypos = $this->getY() + 5; $this->setY($ypos); $this->Cell (100, 6, "$name ($code)", 0, 0,'L'); $this->Cell (30, 6, "\$$price", 0, 1, 'L'); $this->SetFont('Arial','I',10); $this->Cell (130, 6, 'Description', 0, 1, 'L'); $this->SetFont('Arial','',10); $this->Cell(10); // indent $this->Multicell (90, 4, $desc, 'L'); $ypos2 = $this->getY(); // end of text ?> Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 16, 2008 Share Posted April 16, 2008 <?php //understanding of how function works cell (x,y,'$string',border (1)or no border(0),frame(1) or no frame(0),alignment);?> Quote Link to comment Share on other sites More sharing options...
Alicia Posted May 3, 2008 Author Share Posted May 3, 2008 i am going crazy because of the alignment issue.. i tried to adjust the x and y in the script but y it is totally different from what it supposed to be ?? i even instered negative value to move the text to left... wondering is that a right way.. now I cant adjust the y alignment for the value $E multicell no matter what value i put for y.. can somebody please advise .. $this->SetFont('Arial','B',12); $ypos = $this->getY() + 5; $this->setY($ypos); $this->Cell (100, 6, "$D($B)", 0, 0,'L'); $this->SetFont('Arial','',10); $this->Cell(-98,-10); // indent // add 0 to remove the left column line $this->Multicell (0, 4, $E, 'L'); $ypos2 = $this->getY(); // end of text thanks Quote Link to comment Share on other sites More sharing options...
Alicia Posted May 10, 2008 Author Share Posted May 10, 2008 anyone can advise me on this ? thanks Quote Link to comment Share on other sites More sharing options...
Barand Posted May 10, 2008 Share Posted May 10, 2008 As we don't have a clue what you are trying to achieve, then it's bit difficult. I already gave you one sample script and its output. There are many on the fpdf.org site. Have you even considered reading the manual on Cell and Multicell? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.