<telerik:RadPageView ID="RadPageView2" runat="server"> <br /> <div> <asp:HiddenField ID="HiddenField1" Value="50125" runat="server" /> <telerik:RadGrid ID="RadGridClaimPayments" runat="server" AutoGenerateColumns="false" Skin="Office2007" Width="98%" EnableViewState="true" AutoGenerateHierarchy="false" OnDetailTableDataBind="RadGridClaimPayments_DetailTableDataBind" DataKeyNames="CheckNo"> <clientsettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true" > <Scrolling AllowScroll="false" ScrollHeight="300px" UseStaticHeaders="false" /> <Selecting AllowRowSelect="true"/> <ClientEvents OnRowSelected="RadGridClaimPayments_RowSelected" /> </clientsettings> <mastertableview datakeynames="CheckNo" Name="CheckInfo" EnableViewState="true" ClientDataKeyNames="CheckNo" > <Columns> <telerik:GridBoundColumn DataField="TranYear" HeaderText="TranYear" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="TranYear" Visible="false"/> <telerik:GridBoundColumn DataField="crdate" HeaderText="Check Date" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="crdate" DataFormatString="{0:MM/dd/yyyy}" /> <telerik:GridBoundColumn DataField="CheckNo" HeaderText="Check No" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="CheckNo" /> <telerik:GridBoundColumn DataField="amount" HeaderText="Check Amount" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="amount" DataFormatString="{0:C}" /> <telerik:GridBoundColumn DataField="Status" HeaderText="Status" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="Status" Visible="false" /> <telerik:GridBoundColumn DataField="payment" HeaderText="Check Description" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="payment" /> <telerik:GridBoundColumn DataField="claimno" HeaderText="Claim No." ItemStyle-HorizontalAlign="Center" ReadOnly="True" SortExpression="claimno" Visible="false" /> <telerik:GridBoundColumn DataField="lossdate" HeaderText="Loss Date" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="lossdate" DataFormatString="{0:MM/dd/yyyy}" Visible="false" /> <telerik:GridBoundColumn DataField="reporteddate" HeaderText="Report Date" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="reporteddate" DataFormatString="{0:MM/dd/yyyy}" Visible="false" /> <telerik:GridBoundColumn DataField="Adjuster" HeaderText="Adjuster" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="Adjuster" Visible="false" /> <telerik:GridBoundColumn DataField="OutstandingRes" HeaderText="Outstanding Res" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="OutstandingRes" DataFormatString="{0:C}" Visible="false" /> </Columns> <GroupByExpressions> <telerik:GridGroupByExpression> <GroupByFields> <telerik:GridGroupByField FieldName="TranYear" HeaderText="Year" /> </GroupByFields> <SelectFields> <telerik:GridGroupByField FieldName="TranYear" HeaderText="Year" /> </SelectFields> </telerik:GridGroupByExpression> </GroupByExpressions> <detailtables > <telerik:GridTableView runat="server" Name="CheckDetails" HierarchyLoadMode="ServerOnDemand" > <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="CheckNo" MasterKeyField="CheckNo" /> </ParentTableRelation> <Columns> <telerik:GridBoundColumn DataField="CheckNo" HeaderText="Check No" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="CheckNo" Visible="false"/> <telerik:GridBoundColumn DataField="checkgroup" HeaderText="Check Type" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="checkgroup"/> <telerik:GridBoundColumn DataField="lossdate" HeaderText="Loss Date" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="lossdate" DataFormatString="{0:MM/dd/yyyy}" /> <telerik:GridBoundColumn DataField="insuredprimary" HeaderText="Insured" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="Insured" /> <telerik:GridBoundColumn DataField="claimant" HeaderText="Claimant" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="claimant" /> <telerik:GridBoundColumn DataField="companyname1" HeaderText="Insolvent Company" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="companyname1" /> <telerik:GridBoundColumn DataField="claimno" HeaderText="Claimno" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="claimno" /> <telerik:GridBoundColumn DataField="policyno" HeaderText="Policy Number" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="policyno" /> <telerik:GridBoundColumn DataField="issuedt" HeaderText="Date Issued" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="issuedate" DataFormatString="{0:MM/dd/yyyy}" Visible="false"/> <telerik:GridBoundColumn DataField="payeeidno" HeaderText="IRS NO" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="IRSNO" /> <telerik:GridBoundColumn DataField="checkamount" HeaderText="Amount" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="amount" DataFormatString="{0:C}" /> <telerik:GridBoundColumn DataField="amounttext" HeaderText="Comments" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="amounttext" /> <telerik:GridBoundColumn DataField="mailtoname1" HeaderText="Address" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="mailtoname1" /> <telerik:GridBoundColumn DataField="mailtoname2" HeaderText="Address1" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="mailtoname2" /> <telerik:GridBoundColumn DataField="mailtoaddr1" HeaderText="Address3" ItemStyle-HorizontalAlign="Left" ReadOnly="True" SortExpression="mailtoaddr1" /> </Columns> </telerik:GridTableView> </detailtables> </mastertableview> </telerik:RadGrid> <telerik:RadWindow ID="CheckImageRadWin" runat="server" Title="Check Image Window" Width="900" Height="536" VisibleOnPageLoad="false" Behaviors ="Minimize, Move, Resize, Maximize,Close" OffsetElementID="RadGridClaimPayments" Left="140" Top="50" EnableShadow="true" > <ContentTemplate> <div style="text-align: center; border-bottom-width: 8px;"> Check No: <asp:Label ID="lblcheckno" Runat="server" Visible="true"></asp:Label> <asp:Datalist ID="dlCheckImageInfo" runat="server" ShowHeader="true" Font-Size="Small" BorderColor="black" CellPadding="3" GridLines="Both" DataSourceID="SqlDataSource1"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td colspan="2" rowspan="6"> </td> <td> INSURED </td> <td> CLAIM NUMBER </td> </tr> <tr> <td> <%# DataBinder.Eval(Container.DataItem, "insuredprimary")%> </td> <td> <%# DataBinder.Eval(Container.DataItem, "claimno")%> </td> </tr> <tr> <td> CLAIMANT </td> <td> POLICY NUMBER </td> </tr> <tr> <td> <%# DataBinder.Eval(Container.DataItem, "claimant")%> </td> <td> <%# DataBinder.Eval(Container.DataItem, "policyno")%> </td> </tr> <tr> <td> INSOLVENT COMPANY </td> <td> DATE ISSUED </td> </tr> <tr> <td> <%# DataBinder.Eval(Container.DataItem, "companyname1")%> </td> <td> <%# DataBinder.Eval(Container.DataItem, "issuedate")%> </td> </tr> <tr> <td> CHECK TYPE </td> <td> DATE OF LOSS </td> <td> IN PAYMENT OF </td> <td> IRS NO </td> </tr> <tr> <td> <%# DataBinder.Eval(Container.DataItem, "checkgroup")%> </td> <td> <%# DataBinder.Eval(Container.DataItem, "lossdate")%> </td> <td> </td> <td> <%# DataBinder.Eval(Container.DataItem, "payeeidno")%> </td> </tr> <tr> <td colspan="3" rowspan="2"> <%# DataBinder.Eval(Container.DataItem, "amounttext")%> </td> <td> AMOUNT </td> </tr> <tr> <td> <%# DataBinder.Eval(Container.DataItem, "amount")%> </td> </tr> </table> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Datalist> </div> <asp:ObjectDataSource DataSourceMode="DataReader" ID="SqlDataSource1" runat="server" SelectCommand = "spu_payment_checkprint_cfp_web" SelectCommandType = "StoredProcedure" ConnectionString ="<%$ ConnectionStrings:SiteSqlServer" %>"> <SelectParameters> <asp:ControlParameter Name="CheckNo" ControlID="RadGridClaimPayments" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:ObjectDataSource> </ContentTemplate> </telerik:RadWindow> </div> </telerik:RadPageView><%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ResourceChart.aspx.cs" Inherits="ResourceChart" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="rad" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<rad:RadChart ID ="RadChart1" runat="server" Height="750px" Width ="1700px" UseSession ="false" >
<Series>
<rad:ChartSeries Type ="Gantt" DataYColumn="EndDate" DataYColumn2="StartDate" DataXColumn ="ResourceId" DefaultLabelValue = "#Y" >
<Appearance>
<LabelAppearance Visible="false" />
</Appearance>
</rad:ChartSeries>
</Series>
<PlotArea>
<YAxis>
<AxisLabel>
<Appearance RotationAngle="360">
</Appearance>
</AxisLabel>
</YAxis>
</PlotArea>
<ChartTitle>
<Appearance Dimensions-Margins="1%, 1%, 1%, 1%" Position-AlignedPosition="Top">
</Appearance>
<TextBlock Text="ADS Resource Chart">
</TextBlock>
</ChartTitle>
<Legend Appearance-ItemAppearance-Visible ="false" >
<Items>
</Items>
<TextBlock></TextBlock>
</Legend>
</rad:RadChart>
</asp:Content>
---------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NOVADS_Tracker;
using Telerik.Charting;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Collections;
using DHAdmin;
public partial class ResourceChart : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = ResourceList.ResourceChart_Data();
this.RadChart1.DataSource = ds;
this.RadChart1.PlotArea.YAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
this.RadChart1.PlotArea.YAxis.Appearance.CustomFormat = "dd MMMM";
this.RadChart1.PlotArea.YAxis.IsZeroBased = false;
this.RadChart1.SeriesOrientation = Telerik.Charting.ChartSeriesOrientation.Horizontal;
//this.RadChart1.PlotArea.XAxis.MaxItemsCount = 1;
this.RadChart1.PlotArea.XAxis.AutoScale = false;
RadChart1.PlotArea.Appearance.Dimensions.Margins.Top = 100;
RadChart1.PrePaint += new EventHandler<EventArgs>(RadChart2_PrePaint);
this.RadChart1.DataBind();
this.RadChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Right;
for (int i = 0; i < RadChart1.Series[0].Items.Count; i++)
{
LabelItem lbi = new LabelItem();
RadChart1.Legend.Items.Add(lbi);
string mileName = ds.Tables[0].Rows[i]["MilestoneName"].ToString();
string colorHex = ds.Tables[0].Rows[i]["ColorCode"].ToString();
RadChart1.Legend.Items[i].TextBlock.Text = mileName;
RadChart1.Legend.Items[i].Marker.Appearance.FillStyle.MainColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
RadChart1.Legend.Items[i].Marker.Appearance.FillStyle.SecondColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
}
for (var i = 0; i < RadChart1.Series[0].Items.Count; i++)
{
string colorHex = ds.Tables[0].Rows[i]["ColorCode"].ToString();
RadChart1.Series[0].Items[i].Appearance.FillStyle.MainColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
RadChart1.Series[0].Items[i].Appearance.FillStyle.SecondColor = System.Drawing.ColorTranslator.FromHtml(colorHex);
}
//for (int i = 0; i < RadChart1.Series[0].Items.Count;i++)
//{
// RadChart1.PlotArea.XAxis[i].TextBlock.Text = ds.Tables[0].Rows[i]["ResourceName"].ToString();
//}
//this.RadChart1.PlotArea.XAxis.AutoScale = false;
//List<string> lLabel = new List<string>();
//foreach (DataRow dr in ds.Tables[0].Rows)
//{
// if (!lLabel.Contains(dr["ResourceName"].ToString()))
// lLabel.Add(dr["ResourceName"].ToString());
//}
//RadChart1.PlotArea.XAxis.MaxItemsCount = 0;
//RadChart1.PlotArea.XAxis.AddRange(1, lLabel.Count, 1);
//for (int i = 0; i < lLabel.Count; i++)
//{
// RadChart1.PlotArea.XAxis[i].TextBlock.Text = lLabel[i];
//}
}
void RadChart2_PrePaint(object sender, EventArgs e)
{
//Double maxVal = RadChart1.PlotArea.XAxis.MaxValue;
foreach (var item in RadChart1.PlotArea.XAxis.Items)
{
float x = item.Appearance.Position.X;
float y = item.Appearance.Position.Y;
item.Appearance.Position.Auto = false;
item.Appearance.Position.Y = y;
item.Appearance.Position.X = x + 620;
//item.Appearance.Position.X = x + (float)(maxVal);
}
}
}
List<string> lLabel = new List<string>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (!lLabel.Contains(dr["ResourceName"].ToString()))
lLabel.Add(dr["ResourceName"].ToString());
}
RadChart1.PlotArea.XAxis.MaxItemsCount = 0;
RadChart1.PlotArea.XAxis.AddRange(1, lLabel.Count, 1);
for (int i = 0; i < lLabel.Count; i++)
{
RadChart1.PlotArea.XAxis[i].TextBlock.Text = lLabel[i];
}

WHERE act_Location_ID = @loc_Location_ID