This is my code for using FPDF in PDF PHP. I want to display semester, bill month and bilayer in PDF file. I do not want to display values in the table.
I want to display at the top of the page How can I do this? Any remedy? Thanks in advance. Cheers.
& lt ;? Php session_start (); ('Fpdf / fpdf.php') is required; // Connect to your database $ R1 = $ _ session ['cm1']; $ Thor = mysql_connect ('localhost', 'root', ''); If (! $ Con) {dead ('Unable to connect'. Mysql_error ()); } Mysql_select_db ('hostel', $ con); $ Result = mysql_query ("selection r.hosteladmissionno, r.student_name, r.semester, r.blockname r.branch, m.billmonth, m.billear, (s.days_mess * perdayrate) AS mess_charges, m.perdayrate, s Days_mess , Registration from s.nv_tokens r, student_months, messexp m WHERE s.hosteladmissionno = r.hosteladmissionno and r.mess_type = m.messtype and m.billmonth = 'march' and m.billier = '2014'); $ number_of_products = mysql_numrows ($ Result); while ($ line = mysql_fetch_array ($ result)) {$ hostad = $ row [hosteladmissionno]; $ name = $ line ['student_name']; $ block = $ line ['blockname']; $ branch $$ ['branch']; $ Perday = $ line ['perdayrate']; $ day = $ line ['days_mess']; $ messch = $ row [' mess_charges']; $ NV = $ line ['nv_tokens ']; $ Column_no = $ column_no. $ Osted. "$ Column_name = $ column_name. $ Name." \ N "; $ Sem_details = $ sem_details. $ Block." \ N "; $ Comm_details = $ comm_details. $ Branch." \ N "; $ Course_details = $ course_details. $ Perday. "\ N"; $ courseyr_details = $ courseyr_details. $ Days "\ N"; $ Mess_details = $ mess_details. $ Messch "\ N"; $ Block_details = $ block_details $ Nv. "\ N"; } Mysql_close (); // Create a new PDF file $ PDF = new FPDF ('P', 'MM', 'A4'); $ Pdf- & gt; AddPage (); // field name status $ Y_Fields_Name_position = 40; // table status, $ Y_Table_Position = 46 under field name; $ PDF- & gt; Cell (15,50, 'Anna University Hostel'); // First make each field name // fill the gray color Each field name box $ pdf- & gt; SetfillCollar (232,232,232); // bold font for field name $ pdf-> Setfont ('ariel', 'b', 9); $ Pdf- & gt; SetY ($ Y_Fields_Name_position); $ Pdf- & gt; SetX (5); $ Pdf- & gt; Cell (23,6, 'Access No', 1,0, 'L', 1); $ Pdf- & gt; SetX (28); $ Pdf- & gt; Cell (37,6, 'Student Name', 1,0, 'L', 1); $ Pdf- & gt; SetX (65); $ PDF- & gt; Room (18.6, 'block name', 1,0, 'L', 1); $ Pdf- & gt; SetX (83); $ Pdf- & gt; Cell (20,6, 'branch', 1,0, 'L', 1); $ Pdf- & gt; SetX (103); $ Pdf- & gt; Cell (22,6, 'rate per day', 1.0, 'L', 1); $ Pdf- & gt; SetX (125); $ Pdf- & gt; Cell (22,6, 'day number', 1,0, 'L', 1); $ Pdf- & gt; SetX (147); $ Pdf- & gt; Room (20,6, 'Mass Charge', 1,0, 'L', 1); $ Pdf- & gt; SetX (167); $ Pdf- & gt; Cell (18,6, 'NV Tokens', 1,0, 'L', 1); $ Pdf- & gt; SetX (185); $ Pdf- & gt; Cell (25,6, 'block name', 1,0, 'L', 1); $ Pdf- & gt; Ln (); // Now 3 Columns $ pdf- & gt; Show set font ('Aerial', '', 12); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (5); $ Pdf- & gt; MultiCell (23.6, $ column_no, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (28); $ Pdf- & gt; MultiCell (37,6, $ column, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (65); $ Pdf- & gt; MultiCell (18,6, $ block, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (83); $ Pdf- & gt; MultiCell (20,6, $ branch, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (103); $ Pdf- & gt; MultiCell (22,6, $ perday, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (125); $ Pdf- & gt; MultiCell (22,6, $ days, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (147); $ Pdf- & gt; MultiCell (20,6, $ messch, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (167); $ Pdf- & gt; MultiCell (18,6, $ NV, 1); $ Pdf- & gt; SetY ($ Y_Table_Position); $ Pdf- & gt; SetX (185); $ Pdf- & gt; MultiCell (25,6, $ block_details, 1); $ I = 0; $ Pdf- & gt; SetY ($ Y_Table_Position); While ($ i
Why do not you use the standard "header ()" function of FPDF?
Comments
Post a Comment