<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EsposizioneCertificati.aspx.cs" Inherits="OlympiaIntranet.EsposizioneCertificati" %>

<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.XtraCharts.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style>
        /*.center {
            margin: auto;
            width: 50%;
            padding: 6px 5px;
        }*/

        html {
            width: 100%;
            height: 100%;
        }

        body {
            display: flex;
            /*justify-content: center;
            align-items: center;*/
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table>
                <tr>
                    <td>
                        <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Portafoglio" Theme="DevEx">
                        </dx:ASPxLabel>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtPortafoglio" runat="server" Theme="DevEx" Width="170px" CssClass="height">
                        </dx:ASPxTextBox>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxButton ID="btnCaricaDati" runat="server" Theme="DevEx" OnClick="btnCaricaDati_Click" CssClass="height">
                            <Image IconID="arrows_next_16x16">
                            </Image>
                        </dx:ASPxButton>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxButton ID="btnEsportaExcel" runat="server" Theme="DevEx" CssClass="height" OnClick="btnEsportaExcel_Click">
                            <Image IconID="export_exporttoxlsx_16x16">
                            </Image>
                        </dx:ASPxButton>
                    </td>
                    <td>
                        <dx:ASPxPanel ID="ASPxPanel3" runat="server" Width="10px"></dx:ASPxPanel>
                    </td>
                    <td>
                        <dx:ASPxButton ID="btnEsportaPdf" runat="server" Theme="DevEx" CssClass="height" OnClick="btnEsportaPdf_Click">
                            <Image IconID="export_exporttopdf_16x16">
                            </Image>
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <table>
                <tr>
                    <td>
                        <dx:ASPxGridView ID="gvEsposizioneCertificati" runat="server" Theme="DevEx" DataSourceID="SqlDSEsposizioneCertificati" ClientInstanceName="clientEsposizioneCertificati" OnCustomErrorText="gvEsposizioneCertificati_CustomErrorText" Width="400px" Style="margin-right: 2px" AutoGenerateColumns="False">
                            <SettingsAdaptivity>
                                <AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
                            </SettingsAdaptivity>
                            <SettingsPager PageSize="30" Mode="ShowAllRecords" Visible="False">
                                <PageSizeItemSettings ShowAllItem="True">
                                </PageSizeItemSettings>
                            </SettingsPager>
                            <Settings ShowFilterRow="True" VerticalScrollableHeight="523" VerticalScrollBarMode="Visible" /> <%--messo a 523 per arrivare a 600px (523px grafico + 77px height header)--%>
                            <SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
                            <EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
                            <Columns>
                                <dx:GridViewCommandColumn ShowClearFilterButton="True" Visible="False" VisibleIndex="0">
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn FieldName="ISIN" ReadOnly="True" VisibleIndex="1">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="Descrizione" ReadOnly="True" VisibleIndex="2">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewBandColumn Caption="Olympia" Name="Olympia" VisibleIndex="5">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <Columns>
                                        <dx:GridViewDataTextColumn Caption="CTV" FieldName="CTV_OLY" ReadOnly="True" VisibleIndex="0">
                                            <PropertiesTextEdit DisplayFormatString="N2">
                                            </PropertiesTextEdit>
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn Caption="Esposizione" FieldName="Esp_OLY" ReadOnly="True" VisibleIndex="1">
                                            <PropertiesTextEdit DisplayFormatString="P2">
                                            </PropertiesTextEdit>
                                        </dx:GridViewDataTextColumn>
                                    </Columns>
                                </dx:GridViewBandColumn>
                            </Columns>
                        </dx:ASPxGridView>
                    </td>
                    <td>
                        <dx:WebChartControl ID="chart" runat="server" CrosshairEnabled="True" Height="600px" Width="800px" DataSourceID="SqlDSEsposizioneCertificatiTOP10">
                            <BorderOptions Visibility="False" />
                            <Legend Name="Default Legend" AlignmentHorizontal="Left" AlignmentVertical="BottomOutside" Direction="LeftToRight" Visibility="False"></Legend>
                            <SeriesSerializable>
                                <dx:Series ArgumentDataMember="Descrizione" LabelsVisibility="True" LegendName="Default Legend" LegendTextPattern="{A}" Name="Series 1" ValueDataMembersSerializable="Esp_OLY">
                                    <ViewSerializable>
                                        <dx:PieSeriesView>
                                        </dx:PieSeriesView>
                                    </ViewSerializable>
                                    <LabelSerializable>
                                        <dx:PieSeriesLabel Position="Outside" ColumnIndent="20" TextColor="Black" BackColor="Transparent" Font="Tahoma, 8pt, style=Bold" TextPattern="{A} {V:0.00%}">
                                            <Border Visibility="False"></Border>
                                        </dx:PieSeriesLabel>
                                    </LabelSerializable>
                                </dx:Series>
                            </SeriesSerializable>
                            <SeriesTemplate ArgumentDataMember="Descrizione" ValueDataMembersSerializable="Esp_OLY">
                            </SeriesTemplate>
                        </dx:WebChartControl>
                    </td>
                </tr>
            </table>
        </div>
        <asp:SqlDataSource ID="SqlDSEsposizioneCertificati" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_EsposizioneCertificati" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_rap" SessionField="cod_rap" />
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDSEsposizioneCertificatiTOP10" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_EsposizioneCertificatiTOP10" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="cod_rap" SessionField="cod_rap" />
                <asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvEsposizioneCertificati">
        </dx:ASPxGridViewExporter>
    </form>
</body>
</html>

