export to PDF" />

GridTemplateColumn with <table/> export to PDF

6 posts, 0 answers
  1. Scott
    Scott avatar
    45 posts
    Member since:
    Apr 2008

    Posted 31 Oct 2008 Link to this post

    Can I do anything to be able to export a table within a itemplate to PDF?  The objects above the table exports fine, but not the <table/>


    <telerik:GridTemplateColumn UniqueName="Col1">  
        <ItemTemplate> 
            <div style="text-align:center">  
            <asp:Image runat="server" ID="imgTest" Visible="true" /> 
            </div> 
              
            <div style="font-size:small;font-family:Arial;">  
            <h1><font color="olive"><asp:Literal runat="server" ID="ltrlDate" /></font></h1> 
            <asp:Label runat="server" ID="lblTime" /> 
            </div> 
              
            <!--This does not display in PDF-->          
            <table> 
            <tr> 
                <td>Name</td><td>City</td><td>State</td> 
            </tr> 
            <tr> 
                <td>John</td><td>Some City</td><td>CA</td> 
            </tr> 
            </table>          
        </ItemTemplate> 
    </telerik:GridTemplateColumn> 
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 03 Nov 2008 Link to this post

    Hi Scott,

    Please add following to this table and let me know about the result:

        <table>
           <colgroup>
               <col />
               <col />
               <col />
           </colgroup>

            <tr>
                <td>Name</td><td>City</td><td>State</td>
            </tr>
            <tr>
                <td>John</td><td>Some City</td><td>CA</td>
            </tr>
        </table>      

    Sincerely yours,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Scott
    Scott avatar
    45 posts
    Member since:
    Apr 2008

    Posted 03 Nov 2008 Link to this post

    without the <colgroup/>, the page exports fine but without any table.  I added the <colgroup/> and got this error:

    Exception Details: System.SystemException: System.SystemException: At least one of minimum, optimum, or maximum IPD must be specified on table.  
      at Telerik.Web.Apoc.ApocDriver.FireApocError(String message)  
      at Telerik.Web.Apoc.Fo.Flow.Table.SetIPD(Boolean bHasProportionalUnits, Int32 maxAllocIPD)  
      at Telerik.Web.Apoc.Fo.Flow.Table.CalcFixedColumnWidths(Int32 maxAllocationWidth)  
      at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)  
      at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)  
      at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)  
      at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)  
      at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()  
      at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader) 
  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 04 Nov 2008 Link to this post

    Hello Scott,

    Attached to this post you will find a sample application demonstrating export to PDF with table in GridTemplateColumn.ItemTemplate.

    When you are exporting to PDF you should have in mind that your RadGrid must be XHTML compliant.
    You can find more information here.

    Best regards,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Neal
    Neal avatar
    114 posts
    Member since:
    Apr 2008

    Posted 07 Sep 2009 Link to this post

    Hi Telerik team

    I have had the same error, even when copying the attached solution provided. I am using Q1 2009 version
    ( Telerik_RadControls2009.1\bin\Telerik.Web.UI.dll )
    i.e.
    System.SystemException: At least one of minimum, optimum, or maximum IPD must be specified on table.
      at Telerik.Web.Apoc.ApocDriver.FireApocError(String message)
      at Telerik.Web.Apoc.Fo.Flow.Table.SetIPD(Boolean bHasProportionalUnits, Int32 maxAllocIPD)
      at Telerik.Web.Apoc.Fo.Flow.Table.CalcFixedColumnWidths(Int32 maxAllocationWidth)
      at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
      at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
      at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
      at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)


    My MArkup is

     

    <telerik:RadGrid ID="grvSchedules"

     

     

    runat="server" Width="100%"

     

     

    CssClass="GridVClass"

     

     

    AutoGenerateColumns="False"

     

     

    AllowPaging="True"

     

     

    GridLines="None"

     

     

    PagerStyle-AlwaysVisible="false"

     

     

     

    OnItemCommand="grvSchedule_ItemCommand"

     

     

    OnItemDataBound="grvSchedule_ItemDataBound"

     

     

    OnDetailTableDataBind="grvSchedule_DetailTableDataBind"

     

     

    OnNeedDataSource="grvSchedule_NeedDataSource"

     

     

    OnDataBound="grvSchedule_DataBound"

     

     

    OnItemCreated = "grvSchedule_ItemCreated"

     

     

    HorizontalAlign="Left">

     

     

     

    <ExportSettings IgnorePaging="true" >

     

     

    <Pdf PageHeight="270mm" PageWidth="540mm" PageTitle="Client Schedule" />

     

     

    </ExportSettings>

     

     

    <PagerStyle Mode="NumericPages" AlwaysVisible="False">

     

     

    </PagerStyle>

     

     

     

    <MasterTableView

     

     

    Width="100%"

     

     

    DataKeyNames="RecId" CellSpacing="1" pagesize="20">

     

     

    <DetailTables >

     

     

    <telerik:GridTableView

     

     

    Name="grvAnimalDetl"

     

     

    BorderColor="Gray"

     

     

    BorderStyle="Solid"

     

     

    BorderWidth="1px"

     

     

    DataKeyNames="AnimalId, AnimalTypeId, insval, Val"

     

     

    BackColor="LemonChiffon"

     

     

     

    Width="100%" runat="server" CellSpacing="-1"

     

     

    GridLines="Horizontal" HierarchyDefaultExpanded="True"

     

     

    PagerStyle-Visible="false" >

     

     

     

    <Columns>

     

     

     

    <telerik:GridBoundColumn DataField="AnimalName"

     

     

    HeaderText="Name" UniqueName="AnimalName">

     

     

    <ItemStyle HorizontalAlign="Left" Width="130px" Font-Size="XX-Small" />

     

     

    <HeaderStyle HorizontalAlign="Left" Width="130px" Font-Size="XX-Small" />

     

     

    </telerik:GridBoundColumn>

     

     

     

    <telerik:GridCheckBoxColumn DataField="AccidentalVC"

     

     

    HeaderText="AccidentalVC" UniqueName="AccidentalVC" >

     

     

    <ItemStyle Width ="75px" HorizontalAlign="Center" Font-Size="XX-Small" />

     

     

    <HeaderStyle Width="75px" HorizontalAlign="Center" Font-Size="XX-Small"

     

     

    wrap="True" />

     

     

    </telerik:GridCheckBoxColumn>

     

     

    </Columns>

     

     

     

    <ItemStyle BackColor="White" Font-Names="Times New Roman" HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />

     

     

    <AlternatingItemStyle BackColor="GhostWhite" Font-Names="Times New Roman" HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />

     

     

    <HeaderStyle BackColor="LemonChiffon" />

     

     

     

    </telerik:GridTableView>

     

     

    </DetailTables>

     

     

     

    <Columns>

     

     

    <telerik:GridTemplateColumn

     

     

    DataField="Schedule Date" HeaderText="My Template Column">

     

     

    <ItemTemplate>

     

     

    <table>

     

     

    <colgroup>

     

     

    <col />

     

     

    <col />

     

     

    </colgroup>

     

     

     

    <thead>

     

     

    <tr>

     

     

    <th >Name</th>

     

     

    <th >City</th>

     

     

    </tr>

     

     

    </thead>

     

     

    <tbody>

     

     

    <tr>

     

     

    <td > xx </td>

     

     

    <td > yy </td>

     

     

    </tr>

     

     

    </tbody>

     

     

    </table>

     

     

    <br />

     

     

    <br />

     

     

    <br />

     

     

    </ItemTemplate>

     

     

    </telerik:GridTemplateColumn>

     

     

    </Columns>

     

     

    </MasterTableView>

     

     

     

    <ClientSettings>

     

     

    <Selecting AllowRowSelect="True" />

     

     

    </ClientSettings>

     

     

    <AlternatingItemStyle Font-Size="X-Small"></AlternatingItemStyle>

     

     

    <ItemStyle Font-Size="X-Small"></ItemStyle>

     

     

    </telerik:RadGrid>

     

  6. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 10 Sep 2009 Link to this post

    Hello Neal,

    I have just downloaded the code that I have send on my previous post and tested with Q1 version of RadControls for ASP.NET AJAX and RadGrid is properly exported to PDF.
    If you are still experience the problem I will suggest you to open formal support ticket and attach sample application that replicates the issue.

    Greetings,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top