Table is not getting border in PDF

View: New views
1 Messages — Rating Filter:   Alert me  

Table is not getting border in PDF

by propoo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I am using vb.net. My page has lot of complex Tables and data. I am trying to convert it to PDF. All data gets converted properly except table. I am not getting borders of table in pdf. Here is same code

<table cellspacing="0" cellpadding="0" width="100%" style="border: solid 2px black; font-size:8px;" id="tblMain" runat=server>
            <tr>
                <td width="100%" class="BorderBottom">
                    <table cellspacing="0" cellpadding="0" width="100%">
                        <tr>
                             <td width="50%" class="BorderRight" align=center  style="font-size:10px;">                                                                                                
                                      <h2> Application</h2>                                
                                         Do not exceed character restrictions indicated.                              
                            </td>
                            <td width="50%">
                                <table width="100%" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="BorderBottom" valign=top>
                                           
                                                <strong>
                                                    LEAVE BLANK- FOR INTERNAL USE ONLY
                                                </strong>
                                           

                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="100%">
                                            <table width="100%" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="50%" class="BorderRight BorderBottom">
                                                       
                                                            Reviewer
                                                       

                                                    </td>
                                                    <td width="50%" class="BorderBottom">
                                                       
                                                            Date Received
                                                       

                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="50%" class="BorderRight BorderBottom">
                                                       
                                                       

                                                    </td>
                                                   
                                                </tr>
                                               
                                                    <td width="50%">
                                                       
                                         <asp:Label ID="txtTitle" runat="server" MaxLength="81" />
                                                       

                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
</table>


code:
            Dim sw As New StringWriter()
            Dim hw As New HtmlTextWriter(sw)
            tblMain.RenderControl(hw)                    
            Dim sr As New StringReader(sw.ToString())
            Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
            Dim fs As New FileStream(Server.MapPath("../Application/" & id.ToString & ".pdf"), FileMode.Create)
            Dim writer As PdfWriter = PdfWriter.GetInstance(pdfDoc, fs)
            Dim htmlparser As New HTMLWorker(pdfDoc)
            pdfDoc.Open()          
            htmlparser.Parse(sr)            
            pdfDoc.Close()
            Response.Redirect("Approved.aspx")

Any Suggestions? I have deadline :(

Thanks!