|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<?xml version="1.0" encoding="utf-8"?> |
|
|
|
|
<Report ScriptLanguage="CSharp" ReportInfo.Created="06/27/2023 00:02:11" ReportInfo.Modified="07/12/2024 16:33:36" ReportInfo.CreatorVersion="2022.1.0.0"> |
|
|
|
|
<Report ScriptLanguage="CSharp" ReportInfo.Created="06/27/2023 00:02:11" ReportInfo.Modified="07/15/2024 13:22:11" ReportInfo.CreatorVersion="2022.1.0.0"> |
|
|
|
|
<ScriptText>using System; |
|
|
|
|
using System.Collections; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
@ -19,45 +19,80 @@ namespace FastReport |
|
|
|
|
public class ReportScript |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
public double totalSum = 0; |
|
|
|
|
public double totalHisSum = 0; |
|
|
|
|
public double deptSum = 0; |
|
|
|
|
public double deptHisSum = 0; |
|
|
|
|
public double itemTotal = 0; |
|
|
|
|
public double itemPrice = 0; |
|
|
|
|
public double deptTotal= 0; |
|
|
|
|
public double deptPrice = 0; |
|
|
|
|
|
|
|
|
|
public string deptName = "科室"; |
|
|
|
|
public string feeItem = "项目"; |
|
|
|
|
|
|
|
|
|
private void CostCount_AfterData(object sender, EventArgs e) |
|
|
|
|
{ |
|
|
|
|
DataSourceBase rowData = Report.GetDataSource("P"); |
|
|
|
|
|
|
|
|
|
// if(deptName.Equals(rowData["DeptName"].ToString())) |
|
|
|
|
// { |
|
|
|
|
// deptSum += Convert.ToDouble(rowData["SettleFee"].ToString()); |
|
|
|
|
// deptHisSum += Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
// |
|
|
|
|
// Cell38.Text = deptSum.ToString(); |
|
|
|
|
// Cell50.Text = deptHisSum.ToString(); |
|
|
|
|
// }else{ |
|
|
|
|
// |
|
|
|
|
// if(deptName == "科室"){ |
|
|
|
|
// |
|
|
|
|
// deptSum = Convert.ToDouble(rowData["SettleFee"].ToString()); |
|
|
|
|
// deptHisSum = Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
// |
|
|
|
|
// Cell38.Text = rowData["SettleFee"].ToString(); |
|
|
|
|
// Cell50.Text = rowData["Fee"].ToString(); |
|
|
|
|
// |
|
|
|
|
// }else{ |
|
|
|
|
// |
|
|
|
|
// deptSum = Convert.ToDouble(rowData["SettleFee"].ToString()); |
|
|
|
|
// deptHisSum = Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
// |
|
|
|
|
// Cell38.Text = deptSum.ToString(); |
|
|
|
|
// Cell50.Text = deptHisSum.ToString(); |
|
|
|
|
// } |
|
|
|
|
// |
|
|
|
|
// deptName = rowData["DeptName"].ToString(); |
|
|
|
|
// } |
|
|
|
|
#region 科室 |
|
|
|
|
if(deptName.Equals(rowData["DeptName"].ToString())) |
|
|
|
|
{ |
|
|
|
|
deptTotal += Convert.ToDouble(rowData["Quantity"].ToString()); |
|
|
|
|
deptPrice += Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
|
|
|
|
|
Cell181.Text = deptTotal.ToString(); |
|
|
|
|
Cell186.Text = deptPrice.ToString(); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
if(deptName == "科室"){ |
|
|
|
|
|
|
|
|
|
deptTotal = Convert.ToDouble(rowData["Quantity"].ToString()); |
|
|
|
|
deptPrice = Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
|
|
|
|
|
Cell181.Text = deptTotal.ToString(); |
|
|
|
|
Cell186.Text = deptPrice.ToString(); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
deptTotal = Convert.ToDouble(rowData["Quantity"].ToString()); |
|
|
|
|
deptPrice = Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
|
|
|
|
|
Cell181.Text = deptTotal.ToString(); |
|
|
|
|
Cell186.Text = deptPrice.ToString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
deptName = rowData["DeptName"].ToString(); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 项目 |
|
|
|
|
|
|
|
|
|
if(feeItem.Equals(rowData["FeeItemName"].ToString())) |
|
|
|
|
{ |
|
|
|
|
itemTotal += Convert.ToDouble(rowData["Quantity"].ToString()); |
|
|
|
|
itemPrice += Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
|
|
|
|
|
Cell172.Text = itemTotal.ToString(); |
|
|
|
|
Cell177.Text = itemPrice.ToString(); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
if(feeItem == "项目"){ |
|
|
|
|
|
|
|
|
|
itemTotal = Convert.ToDouble(rowData["Quantity"].ToString()); |
|
|
|
|
itemPrice = Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
|
|
|
|
|
Cell172.Text = itemTotal.ToString(); |
|
|
|
|
Cell177.Text = itemPrice.ToString(); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
itemTotal = Convert.ToDouble(rowData["Quantity"].ToString()); |
|
|
|
|
itemPrice = Convert.ToDouble(rowData["Fee"].ToString()); |
|
|
|
|
|
|
|
|
|
Cell172.Text = itemTotal.ToString(); |
|
|
|
|
Cell177.Text = itemPrice.ToString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
feeItem = rowData["FeeItemName"].ToString(); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -83,7 +118,7 @@ namespace FastReport |
|
|
|
|
<TextObject Name="Text6" Left="500.85" Top="56.7" Width="66.15" Height="18.9" Text="统计科室:" HorzAlign="Right" VertAlign="Center" Font="微软雅黑, 9pt"/> |
|
|
|
|
<TextObject Name="Text7" Left="567" Top="56.7" Width="151.2" Height="18.9" CanBreak="false" Text="[DeptName]" AutoShrink="FontWidth" VertAlign="Center" WordWrap="false" Font="微软雅黑, 9pt"/> |
|
|
|
|
</ColumnHeaderBand> |
|
|
|
|
<GroupHeaderBand Name="GroupHeader1" Top="79.6" Width="718.2" Height="47.25" Condition="[P.DeptName]" SortOrder="None"> |
|
|
|
|
<GroupHeaderBand Name="GroupHeader1" Top="77.6" Width="718.2" Height="47.25" Condition="[P.DeptName]" SortOrder="None"> |
|
|
|
|
<TableObject Name="Table38" Top="18.9" Width="718.2" Height="28.35" Border.Lines="All"> |
|
|
|
|
<TableColumn Name="Column114" Width="359.1"/> |
|
|
|
|
<TableColumn Name="Column115" Width="359.1"/> |
|
|
|
@ -92,7 +127,7 @@ namespace FastReport |
|
|
|
|
<TableCell Name="Cell159" Font="宋体, 9pt"/> |
|
|
|
|
</TableRow> |
|
|
|
|
</TableObject> |
|
|
|
|
<GroupHeaderBand Name="GroupHeader2" Top="130.85" Width="718.2" Height="28.35" Condition="[P.FeeItemName]" SortOrder="None"> |
|
|
|
|
<GroupHeaderBand Name="GroupHeader2" Top="126.85" Width="718.2" Height="28.35" Condition="[P.FeeItemName]" SortOrder="None"> |
|
|
|
|
<TableObject Name="Table39" Width="718.2" Height="28.35" Fill.Color="Silver"> |
|
|
|
|
<TableColumn Name="Column116" Width="123.95"/> |
|
|
|
|
<TableColumn Name="Column117" Width="265.7"/> |
|
|
|
@ -115,7 +150,7 @@ namespace FastReport |
|
|
|
|
<TableCell Name="Cell168" Border.Lines="All" Text="折后金额" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 10pt, style=Bold"/> |
|
|
|
|
</TableRow> |
|
|
|
|
</TableObject> |
|
|
|
|
<DataBand Name="CostCount" Top="163.2" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true" AfterDataEvent="CostCount_AfterData" KeepTogether="true"> |
|
|
|
|
<DataBand Name="CostCount" Top="157.2" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true" AfterDataEvent="CostCount_AfterData" KeepTogether="true"> |
|
|
|
|
<TableObject Name="Table6" Width="718.2" Height="28.35"> |
|
|
|
|
<TableColumn Name="Column43" Width="123.95"/> |
|
|
|
|
<TableColumn Name="Column44" Width="265.7"/> |
|
|
|
@ -139,7 +174,7 @@ namespace FastReport |
|
|
|
|
</TableRow> |
|
|
|
|
</TableObject> |
|
|
|
|
</DataBand> |
|
|
|
|
<GroupFooterBand Name="GroupFooter2" Top="195.55" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true"> |
|
|
|
|
<GroupFooterBand Name="GroupFooter2" Top="187.55" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true"> |
|
|
|
|
<TableObject Name="Table40" Width="718.2" Height="28.35"> |
|
|
|
|
<TableColumn Name="Column125" Width="123.95"/> |
|
|
|
|
<TableColumn Name="Column126" Width="265.7"/> |
|
|
|
@ -156,7 +191,7 @@ namespace FastReport |
|
|
|
|
<TableCell Name="Cell171" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt"/> |
|
|
|
|
<TableCell Name="Cell172" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt" ColSpan="2"/> |
|
|
|
|
<TableCell Name="Cell173" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt"/> |
|
|
|
|
<TableCell Name="Cell174" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt" ColSpan="3"/> |
|
|
|
|
<TableCell Name="Cell174" Border.Lines="All" Fill.Color="InactiveBorder" Text="[P.Price]" VertAlign="Center" Font="微软雅黑, 10pt" ColSpan="3"/> |
|
|
|
|
<TableCell Name="Cell175" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt"/> |
|
|
|
|
<TableCell Name="Cell176" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt"/> |
|
|
|
|
<TableCell Name="Cell177" Border.Lines="All" Fill.Color="InactiveBorder" VertAlign="Center" Font="微软雅黑, 10pt"/> |
|
|
|
@ -164,7 +199,7 @@ namespace FastReport |
|
|
|
|
</TableObject> |
|
|
|
|
</GroupFooterBand> |
|
|
|
|
</GroupHeaderBand> |
|
|
|
|
<GroupFooterBand Name="GroupFooter1" Top="227.9" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true" KeepWithData="true"> |
|
|
|
|
<GroupFooterBand Name="GroupFooter1" Top="217.9" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true" KeepWithData="true"> |
|
|
|
|
<TableObject Name="Table41" Width="718.2" Height="28.35"> |
|
|
|
|
<TableColumn Name="Column134" Width="123.95"/> |
|
|
|
|
<TableColumn Name="Column135" Width="265.7"/> |
|
|
|
@ -188,7 +223,7 @@ namespace FastReport |
|
|
|
|
</TableRow> |
|
|
|
|
</TableObject> |
|
|
|
|
</GroupFooterBand> |
|
|
|
|
<DataFooterBand Name="DataFooter1" Top="260.25" Width="718.2" Height="28.35"> |
|
|
|
|
<DataFooterBand Name="DataFooter1" Top="248.25" Width="718.2" Height="28.35"> |
|
|
|
|
<TableObject Name="Table42" Width="718.2" Height="28.35"> |
|
|
|
|
<TableColumn Name="Column143" Width="123.95"/> |
|
|
|
|
<TableColumn Name="Column144" Width="265.7"/> |
|
|
|
@ -213,7 +248,7 @@ namespace FastReport |
|
|
|
|
</TableObject> |
|
|
|
|
</DataFooterBand> |
|
|
|
|
</GroupHeaderBand> |
|
|
|
|
<PageFooterBand Name="PageFooter1" Printable="false" Top="292.6" Width="718.2" Height="37.8"> |
|
|
|
|
<PageFooterBand Name="PageFooter1" Printable="false" Top="278.6" Width="718.2" Height="37.8"> |
|
|
|
|
<TextObject Name="Text8" Width="718.2" Height="37.8" Text="第[Page#]页,共[TotalPages#]页" HorzAlign="Center" Font="微软雅黑, 10pt"/> |
|
|
|
|
</PageFooterBand> |
|
|
|
|
</ReportPage> |
|
|
|
|