Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8269999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:25:18+00:00 2026-06-08T06:25:18+00:00

I am having some trouble with php and fpdf. I have to make a

  • 0

I am having some trouble with php and fpdf.

I have to make a report in pdf format through fpdf and php in which i want to show students a teacher is teaching.

What i want is that the fpdf should create a page with multiple column with same field.

link of the pic: http://i1267.photobucket.com/albums/jj552/ThePerfectH/abc.png

in this image as you can see, i want the data till 30 in one column and after that it should move in different column in one page.

Example Code:

$result=mysql_query("select p.p_sname as pap from sgm, students st
    left join sps on st.studentid=sps.studentid
    left join papers p on p.p_id=sps.paperid where p.type='optional' and
    sgm.studentid=st.studentid and sgm.groupid=3 and st.course=3 and
    st.status='Regular' order by name");
    if($result === FALSE)
{
die(mysql_error()); // better error handling
}
$i=0;
$max=30;
$s=1;
$row_height = 6;
$y_axis = 33 + $row_height;
while($row = mysql_fetch_array($result))
{
//If the current row is the last one, create new page and print column title
if ($i == $max)
{
    $y_axis= 33 + $row_height;
    $pdf->SetX(80);
    $pdf->SetTextColor(153,0,102);
    $pdf->SetFont('Arial','',10);
        //print column titles for the current page
    $pdf->SetY(33);
    $pdf->SetX(80);
    $pdf->Cell(20,6,'S No.',1,0,'C',1);
    $pdf->SetY($y_axis);
    $pdf->SetX(80);
    $pdf->Cell(20,6,$s,1,0,'C',1);
    $y_axis = $y_axis + $row_height;
        $i = $i + 1;
    $s=$s+1;


}

        $rollno=$row['rollno'];
    $name=$row['name'];
    $cat=$row['cat'];
    $pap=$row['pap'];
    $pdf->SetY($y_axis);
    $pdf->SetX(48);
    $pdf->SetFont('Arial','',10);
    $pdf->Cell(20,6,$s,1,0,'C',1);
    //Go to next row
    $s=$s+1;
    $y_axis = $y_axis + $row_height;

        $i = $i + 1;    }       

As you can see in the pic, this is leading to overlapping of my row after creating just one new column.

Can any one help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:25:20+00:00Added an answer on June 8, 2026 at 6:25 am

    I have done it by changing SetX to x_axis and as it reaches 30 it addes to x_axis

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble extending Classes in PHP. Have been Googling for a while.
I'm having some trouble using sessions with php.. I think I have figured out
I am having some trouble mixing PHP with XML. I currently have a PHP
I'm having some trouble saving some data after using PHP's simplexml_load_file function. I want
I am having some trouble with php. I have a variable $image that contains
I am having some trouble with my PHP code. Basically I have a list
How I can make a HTTPResponse in php? I'm having some trouble :( I
I'm having some trouble with my .htaccess redirections. I want a situation in which
I'm having some trouble deciding which approach I should take. I want to allow
I'm having some trouble parsing malformed XML in PHP. In particular I'm querying a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.