2010-12-20 13 views
-1

zu übertreffen Wie können wir den Stil auf den Tisch gesetzt, während eine PHP-Datei exportierenexportieren Sie eine PHP-Datei

mit dem folgenden Code zu übertreffen wir eine PHP-Datei exportieren

header("Content-Disposition: attachment; filename=".$fname."Application.xls"); 

print "<html xmlns:x=\"urn:schemas-microsoft-com:office:excel\"> 
<style> 

@page 
    {margin:1.0in .75in 1.0in .75in; 
    mso-header-margin:.5in; 
    mso-footer-margin:.5in;} 
tr 
    {mso-height-source:auto;} 
col 
    {mso-width-source:auto;} 
br 
    {mso-data-placement:same-cell; 
    } 

.style0 
    {mso-number-format:General; 
    text-align:general; 
    vertical-align:bottom; 
    white-space:nowrap; 
    mso-rotate:0; 
    mso-background-source:auto; 
    mso-pattern:auto; 
    color:windowtext; 
    font-size:10.0pt; 
    font-weight:400; 
    font-style:normal; 
    text-decoration:none; 
    font-family:Arial; 
    mso-generic-font-family:auto; 
    mso-font-charset:0; 
    border:none; 
    mso-protection:locked visible; 
    mso-style-name:Normal; 
    mso-style-id:0;} 
td 
    {mso-style-parent:style0; 
    padding-top:1px; 
    padding-right:1px; 
    padding-left:1px; 
    mso-ignore:padding; 
    color:windowtext; 
    font-size:10.0pt; 
    font-weight:400; 
    font-style:normal; 
    text-decoration:none; 
    font-family:Arial; 
    mso-generic-font-family:auto; 
    mso-font-charset:0; 
    mso-number-format:General; 
    text-align:general; 
    vertical-align:bottom; 
    border:none; 
    mso-background-source:auto; 
    mso-pattern:auto; 
    mso-protection:locked visible; 
    white-space:nowrap; 
    mso-rotate:0;} 
.grids 
    {mso-style-parent:style0; 
    border:.5pt solid windowtext;}.head{ 
    font-weight:bold; 
} 

</style> 
<head> 
<!--[if gte mso 9]><xml> 
<x:ExcelWorkbook> 
<x:ExcelWorksheets> 
<x:ExcelWorksheet> 
<x:Name>Application List</x:Name> 
<x:WorksheetOptions> 
<x:Print> 
</x:Print> 
</x:WorksheetOptions> 
</x:ExcelWorksheet> 
</x:ExcelWorksheets> 
</x:ExcelWorkbook> 
</xml> 
<![endif]--> 
</head> 
<body>"; 

print '<table width="100%" border="0" cellspacing="1" cellpadding="2" class="tbl_content">'; 

print ' <tr class="head" valign="bottom"> 
                 <td align="center" width="7%" height="22"><b>SL No</b></td> 
                <td align="left" width="18%"><b>Name Of Party</b></td> 
                <td align="left" width="18%"><b>Godown</b></td> 
                <td align="center" width="16%" ><b>Invoice No</b></td> 
                <td align="center" width="12%"><b>Date</b></td> 
                <td align="right" width="17%"><b>Taxable Turnover</b></td> 
                <td align="right" width="14%"><b>VAT Amount</b></td> 
                <td align="right" width="8%"><b>Cess Amt.</b></td> 
                <td align="right" width="16%"><b>Total Turnover</b></td> 
               </tr>'; 

print '</table></body></html>'; 

aber den Stil zu übertreffen wird nicht angezeigt, wenn im Browser angezeigt wird.

+0

Welche Bibliothek verwenden Sie die Excel-Dateien zu generieren? – ZeissS

+0

Bitte fügen Sie viel mehr Details zu dieser Frage hinzu. Es ist sehr verschwommen. Bitte geben Sie weitere Informationen über den von Ihnen verwendeten Exportprozess an –

Antwort

Verwandte Themen