Rutuja Jadhav

Rutuja Jadhav

  • NA
  • 30
  • 1.1k

devexpress grid gives exception for export to excel

Mar 13 2023 9:40 AM
<ContentCollection>
        <dx:PopupControlContentControl runat="server">
            <div class="row">
                <div class="col-lg-23 col-md-12 col-sm-12 col-xs-12">
                    <div class="btn-group btn-custom-groups btn-custom-groups-one btn-mg-b-10" style="float: left;">
                        <dx:ASPxButton ID="dx_btn_xls_export_pup" runat="server" Text="XLS" OnClick="dx_btn_xls_export_pup_Click" Font-Size="9px">
                            <Image IconID="export_exporttoxls_16x16">
                            </Image>
                        </dx:ASPxButton>
                        <dx:ASPxButton ID="dx_btn_xlsx_export_pup" runat="server" Text="XLSX" OnClick="dx_btn_xlsx_export_pup_Click" Font-Size="9px">
                            <Image IconID="export_exporttoxlsx_16x16">
                            </Image>
                        </dx:ASPxButton>
                    </div>
                </div>
            </div>

            <div class="row" style="padding-bottom: 5px;">
            </div>

            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="sparkline13-list" style="padding: 0px;">
                        <div class="table-responsive" style="max-height: 700px; overflow: auto; width: 1300px;">
                            <dx:ASPxGridView ID="ASPxGridView1" runat="server" Theme="BlackGlass"
                                OnCustomCallback="ASPxGridView1_CustomCallback" ClientInstanceName="GridView"
                                AutoGenerateColumns="False" Width="100%" OnHtmlDataCellPrepared="dx_detail_HtmlDataCellPrepared">
                                <Settings ShowFilterRow="True" ShowFilterRowMenu="True" ShowGroupPanel="True" ShowTitlePanel="true" />
                                <SettingsPager Position="TopAndBottom" PageSize="10">
                                    <PageSizeItemSettings Items="5, 10, 20, 50, 100, 500, 1000, 2000, 4000, 8000, 10000" Visible="True">
                                    </PageSizeItemSettings>
                                </SettingsPager>
                                <Settings ShowGroupPanel="True" />
                                <SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
                                <SettingsSearchPanel Visible="True" />

                                <Styles>
                                    <TitlePanel HorizontalAlign="Left">
                                    </TitlePanel>
                                </Styles>
                                <Templates>
                                    <TitlePanel>
                                        <span style="text-align: left;"><%# "Records:" %> <%# Container.Grid.VisibleRowCount %></span>
                                    </TitlePanel>
                                </Templates>

                                <Columns>
                                    <dx:GridViewDataTextColumn ReadOnly="True" VisibleIndex="0" Caption="S.N." FieldName="" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblRowNumber" Text='<%# Container.ItemIndex + 1 %>' runat="server" />
                                        </DataItemTemplate>
                                        <HeaderStyle Wrap="True" HorizontalAlign="Left" />
                                        <CellStyle HorizontalAlign="Left" Wrap="True" BackColor="WhiteSmoke" />
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="EXPIRY_STATUS" Caption="Exp.Status" Width="100" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_ID" Caption="Policy Id." Width="70" Visible="True" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="RENEW_ID" Caption="Renew Id" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_NO" Caption="Policy NO." Width="200" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="ORGANIZATION_ID" Caption="Org.ID" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="ORGANIZATION_DIVISION" Caption="Organization (Div.)" Width="200" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="DIVISION_ID" Caption="Division id" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="DIVISION" Caption="Division" Width="150" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="ORGANIZATION" Caption="Organization" Width="200" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_TYPE_ID" Caption="Policy Type Id" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_TYPE" Caption="Policy Type" Width="200" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="COVERAGE_TYPE_ID" Caption="Coverage Type Id" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="COVERAGE_TYPE" Caption="Coverage Type" Width="200" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_VENDOR_ID" Caption="Policy Vendor Id" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_VENDOR" Caption="Policy Vendor" Width="300" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_VENDOR_ID" Caption="Fire Ext.Del.ID" Width="100" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_VENDOR_NAME" Caption="Fire Ext.Dealer" Width="200" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_VENDOR_ADDRESS" Caption="Fire Ext.Dealer Addr." Width="200" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="True"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="POLICY_VENDOR_CONTACT_NO" Caption="Fire Ext.Dealer Contact" Width="200" Visible="false" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="VALID_FROM_DATE" Width="150" Caption="Valid From Date" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                        <PropertiesTextEdit DisplayFormatString="dd/MM/yyyy" />
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="VALID_TO_DATE" Width="150" Caption="Valid To Date" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                        <PropertiesTextEdit DisplayFormatString="dd/MM/yyyy" />
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="PREMIUM_AMOUNT" Caption="Premium Amount" Width="150" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="SUM_ASSURED_AMOUNT" Caption="Sum Assured Amount" Width="150" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="REMARK" Caption="Remark" Width="300" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="DESCRIPTION" Caption="Description" Width="300" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>

                                    <dx:GridViewDataTextColumn FieldName="BLOCK_STATUS" Caption="Status" Width="100" Visible="true" HeaderStyle-HorizontalAlign="Left" CellStyle-HorizontalAlign="Left">
                                        <CellStyle Wrap="False"></CellStyle>
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                                <Styles>
                                    <GroupRow Font-Bold="True" ForeColor="Red" HorizontalAlign="Left">
                                    </GroupRow>
                                </Styles>
                                <Settings ShowFooter="true" />
                                <ClientSideEvents EndCallback="function(s, e) {
                                if( s.cpShowDrillDownWindow )                            
                                    DrillDownWindow.ShowAtPos ( PivotGrid.GetMainElement().clientLeft + 100, 
                                    PivotGrid.GetMainElement().clientTop + 20 );
                                }" />
                                <SettingsLoadingPanel Mode="ShowOnStatusBar" />
                            </dx:ASPxGridView>
                        </div>
                    </div>
                </div>
            </div>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>

 


Answers (1)