This is a migrated thread and some comments may be shown as answers.

Export to PDF - Borders

8 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 10 Aug 2014, 08:27 PM
I'm struggling with borders on my Grid export to pdf. I have a grid that contains 3 detail tables. My biggest problem is that the 2nd and 3rd detail grids are not exporting with borders. The first detail grid exports with a border. I've tried changing all settings, and tried applying the borders in the code-behind to no avail. I'm also unable to remove borders. I tried setting the BorderType to "NoBorders", but the output still contains borders. Is there an issue with multiple detail tables? I've attached a sample export.

​Here's my grid definition:
<telerik:RadGrid ID="CDMGrid" runat="server"
                AllowPaging="True"
                AllowSorting="true"
                PageSize="25"
                AutoGenerateColumns="false" Skin="Office2007"
                OnNeedDataSource="CDMGrid_NeedDataSource"
                OnItemDataBound="CDMGrid_ItemDataBound"
                OnPreRender="CDMGrid_PreRender"
                OnDetailTableDataBind="CDMGrid_DetailTableDataBind"
                Height="657">
                <ExportSettings IgnorePaging="false" OpenInNewWindow="true">
                    <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="25mm" BorderStyle="Thin" BorderColor="#666666" BorderType="AllBorders" />
                </ExportSettings>
                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" />
                <MasterTableView TableLayout="Fixed" DataKeyNames="ServiceCode, HospRegn, TechnicalDesc" Name="MasterTableView">
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="HospRegn" DataField="HospRegn" HeaderText="Region" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60" />
                        <telerik:GridBoundColumn UniqueName="ServiceCode" DataField="ServiceCode" HeaderText="Svc Code" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="80" />
                        <telerik:GridBoundColumn UniqueName="GeneralDesc" DataField="GeneralDesc" HeaderText="General Description" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" ItemStyle-Font-Size="11px"  />
                        <telerik:GridBoundColumn UniqueName="TechnicalDesc" DataField="TechnicalDesc" HeaderText="Technical Description" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" Visible="false" />
                        <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price1" DataField="Price1" HeaderText="Current Price" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="85" />
                        <telerik:GridBoundColumn UniqueName="SvcTypeDesc" DataField="SvcTypeDesc" HeaderText="Svc Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="100" />
                        <telerik:GridBoundColumn UniqueName="InsCdStr" DataField="InsCdStr" HeaderText="Ins Cd" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="140" />
                        <telerik:GridBoundColumn UniqueName="GLKeyStr" DataField="GLKeyStr" HeaderText="GL Key" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                        <telerik:GridDateTimeColumn UniqueName="InactiveDate" DataField="InactiveDate" HeaderText="Inactive Date" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="95" />
                    </Columns>
                    <DetailTables>
                        <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" DataKeyNames="" Name="PriceDetail" Width="100%" Font-Size="11px">
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="FormulaCode" DataField="FormulaCode" HeaderText="Formula Code" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price1" DataField="Price1" HeaderText="Price 1" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price2" DataField="Price2" HeaderText="Price 2" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price3" DataField="Price3" HeaderText="Price 3" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="Price4" DataField="Price4" HeaderText="Price 4" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridBoundColumn DataFormatString="0.00" UniqueName="UnitAmt1" DataField="UnitAmt1" HeaderText="Unit Amt 1" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridBoundColumn DataFormatString="0.00" UniqueName="UnitAmt2" DataField="UnitAmt2" HeaderText="Unit Amt 2" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="MinPrice" DataField="MinPrice" HeaderText="Min Price" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridNumericColumn NumericType="Currency" UniqueName="MaxPrice" DataField="MaxPrice" HeaderText="Max Price" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridDateTimeColumn UniqueName="EffectiveDate" DataField="EffectiveDate" HeaderText="Effective Date" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="94" />
                            </Columns>
                        </telerik:GridTableView>
                        <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" DataKeyNames="" Name="ProcedureDetail" Width="100%" Font-Size="11px">
                            <Columns>
                                <telerik:GridTemplateColumn UniqueName="Filler" />
                                <telerik:GridBoundColumn UniqueName="SegTypeInd" DataField="SegTypeInd" HeaderText="Seg Type" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="100" />
                                <telerik:GridBoundColumn UniqueName="ThirdPartyIndStr" DataField="ThirdPartyIndStr" HeaderText="Third Party Ind" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="140" />
                                <telerik:GridBoundColumn UniqueName="Code" DataField="Code" HeaderText="Code" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70" />
                                <telerik:GridDateTimeColumn UniqueName="EffectiveDate" DataField="EffectiveDate" HeaderText="Effective Date" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="94" />
                            </Columns>
                        </telerik:GridTableView>
                        <telerik:GridTableView AllowPaging="false" AutoGenerateColumns="false" DataKeyNames="" Name="CostCenterDetail" Width="100%" Font-Size="11px" BackColor="#fafdc9">
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="Technical Description" UniqueName="TechnicalDesc" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="#fafdc9" HeaderStyle-Width="250" >
                                    <ItemTemplate>
                                        <div style="padding-right: 16px;">
                                            <asp:Label ID="TechnicalDescLabel" runat="server" Text='<%# Eval("TechnicalDesc")%>' />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Allowable Cost Centers" UniqueName="AllowableCostCenters" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" ItemStyle-BackColor="#fafdc9">
                                    <ItemTemplate>
                                        <div style="padding-right: 16px;">
                                            <asp:Label ID="AllowableCostCentersLabel" runat="server" Text='<%# Eval("CostCenters")%>' />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <ClientSettings>
                    <Scrolling UseStaticHeaders="true" AllowScroll="true" SaveScrollPosition="True" ScrollHeight="100" />
                    <Selecting AllowRowSelect="False" />
                </ClientSettings>
            </telerik:RadGrid>




8 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 11 Aug 2014, 06:42 AM
Hi Richard,

Please try setting GridLines="Both" property for the GridTableView to have Grid exports with borders.

ASPX:
<telerik:GridTableView GridLines="Both". .>

Thanks,
Princy
0
Richard
Top achievements
Rank 1
answered on 11 Aug 2014, 12:32 PM
Thanks Princy. For some reason, the Master grid and first detail grid exported with borders without setting the GridLines property (as in my original attachment). I added the GridLines="Both" to the 2nd and 3rd detail tables and it does indeed add the borders. However, the borders appear thicker than the rest of the grid (please see new attachment). Is there a way I can modify these in the code-behind? I tried adding the following, but it has no effect:

foreach (GridDataItem item in CDMGrid.Items)
{
     if (item.OwnerTableView.Name == "ProcedureDetail")
     {
           GridTableView detailTableView = item.OwnerTableView as GridTableView;
           detailTableView.BorderWidth = Unit.Pixel(1);
     }
}
0
Daniel
Telerik team
answered on 14 Aug 2014, 11:46 AM
Hello Richard,

Applying border styles to setup with multiple tables per level is not supported at this point. This is why your initial settings are not working. I asked our developers if there is a way to sidestep this limitation somehow. Will keep you posted.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Daniel
Telerik team
answered on 27 Aug 2014, 02:11 PM
Hello Richard,

Done! Starting from the next official release the border styles will apply for multiple tables per hierarchy level scenario. I hope this helps.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Richard
Top achievements
Rank 1
answered on 28 Aug 2014, 08:39 PM
Hi Daniel,

Do you know when we can expect the next official release?

Many thanks,
Rich.
0
Daniel
Telerik team
answered on 29 Aug 2014, 07:28 AM
Hi Rich,

The next official release is expected around the end of October. If you'd like to test this functionality sooner, you could download the latest internal build from your account.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Richard
Top achievements
Rank 1
answered on 29 Aug 2014, 02:09 PM
Hi Daniel,

I downloaded the latest internal build (2014_2_827) but see no difference in the way borders are handled. If I remove the GridLines setting from my 3 detail tables, only the first detail table has borders (as in my original screenshot). If I apply the GridLines="Both" setting to all detail tables, the border are thicker than the rest of the grid (as in my 2nd screenshot). Can you tell me what settings to apply across the RadGrid in order to achieve a consistent border?

Thanks,
Rich.
0
Daniel
Telerik team
answered on 03 Sep 2014, 01:38 PM
Hello Richard,

I just checked that and noticed that the changes have not been included in build 827. The fix will be available for version 828 and greater. That said, the next internal build will be uploaded on Tuesday, 9th.
Please accept my apologies for any inconvenience caused.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or