суммирование итогов разных бэндов
Здравствуйте!
Нужна помощь для решения вот такой проблемы:
в отчете есть два бэнда с данными DataBand1, DataBand2. Каждый бэнд имеет свой итог Tot_DataBand1, Tot_DataBand2 по полю типа Decimal.
Необходимо в подвале отчета вывести сумму этих итогов, но текст [Tot_DataBand1]+[Tot_DataBand2] выводит строку типа "2+3", а не значение 5.
Заранее спасибо.
Нужна помощь для решения вот такой проблемы:
в отчете есть два бэнда с данными DataBand1, DataBand2. Каждый бэнд имеет свой итог Tot_DataBand1, Tot_DataBand2 по полю типа Decimal.
Необходимо в подвале отчета вывести сумму этих итогов, но текст [Tot_DataBand1]+[Tot_DataBand2] выводит строку типа "2+3", а не значение 5.
Заранее спасибо.
Комментарии
Если выражение печатается в объекте "Текст", нужны внешние скобки:
Tot_DataBand1]+[Tot_DataBand2
См. документацию:
http://fast-report.com/documentation/UserM...expressions.htm
(Text4): error CS0019: Operator '+' cannot be applied to operators of type 'object' and 'object'.
"Неудачная загрузка. Необходимо проверить настройки и права доступа. Пожалуйста, сообщите об этом администрации."
Текст отчета имеет вот такой вид:
<?xml version="1.0" encoding="utf-8"?>
<Report ReportInfo.Created="01/18/2010 16:24:50" ReportInfo.Modified="01/20/2010 15:01:26" ReportInfo.CreatorVersion="1.0.175.0">
<scriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
namespace FastReport
{
public class ReportScript
{
}
}
</ScriptText>
<Dictionary>
<TableDataSource Name="rep_list_repaire_wrk" ReferenceName="ds_rep_ugkh.rep_list_repaire_wrk" Enabled="true">
<Column Name="TYPE_ABBR" DataType="System.String"/>
<Column Name="NAMESUBTYPE" DataType="System.String"/>
<Column Name="NAME_JOURNAL_FAULT" DataType="System.String"/>
<Column Name="MEASURE_ABR" DataType="System.String"/>
<Column Name="PLAN_VOL" DataType="System.Decimal"/>
<Column Name="PLAN_COST" DataType="System.Decimal"/>
<Column Name="PLAN_CNT_H" DataType="System.Int32"/>
<Column Name="PLAN_VOL_TMP" DataType="System.Decimal"/>
<Column Name="PLAN_COST_TMP" DataType="System.Decimal"/>
<Column Name="PLAN_CNT_H_TMP" DataType="System.Int32"/>
<Column Name="VOL_TMP" DataType="System.Decimal"/>
<Column Name="COST_TMP" DataType="System.Decimal"/>
<Column Name="CNT_H_TMP" DataType="System.Int32"/>
<Column Name="PR_VIP" DataType="System.Single"/>
</TableDataSource>
<TableDataSource Name="rep_zatr" ReferenceName="ds_rep_zatr.rep_zatr" Enabled="true">
<Column Name="NAME_ZATR" DataType="System.String"/>
<Column Name="COST_" DataType="System.Decimal"/>
</TableDataSource>
<Parameter Name="p_dtBeg" DataType="System.String"/>
<Parameter Name="p_dtEnd" DataType="System.String"/>
<Parameter Name="p_dtPerM" DataType="System.String"/>
<Parameter Name="p_dtPerY" DataType="System.String"/>
<Total Name="t_plan_vol" Expression="[rep_list_repaire_wrk.PLAN_VOL]" Evaluator="Data1"/>
<Total Name="t_plan_cost" Expression="[rep_list_repaire_wrk.PLAN_COST]" Evaluator="Data1"/>
<Total Name="t_plan_tmp_vol" Expression="[rep_list_repaire_wrk.PLAN_VOL_TMP]" Evaluator="Data1"/>
<Total Name="t_plan_tmp_cost" Expression="[rep_list_repaire_wrk.PLAN_COST_TMP]" Evaluator="Data1"/>
<Total Name="t_tmp_vol" Expression="[rep_list_repaire_wrk.VOL_TMP]" Evaluator="Data1"/>
<Total Name="t_tmp_cost" Expression="[rep_list_repaire_wrk.COST_TMP]" Evaluator="Data1"/>
<Total Name="t_zatr_cost" Expression="[rep_zatr.COST_]" Evaluator="Data1"/>
</Dictionary>
<ReportPage Name="Page1" Landscape="true" PaperWidth="297" PaperHeight="210" FirstPageSource="15" OtherPagesSource="15">
<ReportTitleBand Name="ReportTitle1" Width="1047.06" Height="75.6">
<TextObject Name="Text2" Left="136.08" Top="23.62" Width="774.9" Height="28.35" Text="Отчет по текущему ремонту за [p_dtPerM] месяцев [p_dtPerY] года" HorzAlign="Center" VertAlign="Center" Font="Arial, 16pt"/>
</ReportTitleBand>
<PageHeaderBand Name="PageHeader1" Top="79.6" Width="1047.06"/>
<DataBand Name="Data1" Top="163.2" Width="1047.06" Height="18.9" CanGrow="true" DataSource="rep_list_repaire_wrk">
<TextObject Name="Text1" Width="113.4" Height="18.9" Border.Lines="All" CanGrow="true" Text="[rep_list_repaire_wrk.TYPE_ABBR]" VertAlign="Center" Font="Arial, 8pt" Duplicates="Merge"/>
<TextObject Name="Text3" Left="113.4" Width="75.6" Height="18.9" Border.Lines="All" CanGrow="true" Text="[rep_list_repaire_wrk.NAMESUBTYPE]" VertAlign="Center" Font="Arial, 8pt" Duplicates="Merge"/>
<TextObject Name="Text5" Left="189" Width="151.2" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.NAME_JOURNAL_FAULT]" Font="Arial, 8pt"/>
<TextObject Name="Text7" Left="340.2" Width="47.25" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.MEASURE_ABR]" HorzAlign="Center" VertAlign="Center" Font="Arial, 7pt"/>
<TextObject Name="Text9" Left="387.45" Width="75.6" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PLAN_VOL]" HideValue="0" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text10" Left="463.05" Width="66.15" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PLAN_COST]" HideValue="0" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text12" Left="529.2" Width="56.7" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PLAN_CNT_H]" HideValue="0" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text14" Left="585.9" Width="66.15" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PLAN_VOL_TMP]" HideValue="0" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text16" Left="652.05" Width="56.7" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PLAN_COST_TMP]" HideValue="0" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text18" Left="708.75" Width="56.7" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PLAN_CNT_H_TMP]" HideValue="0" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text20" Left="765.45" Width="66.15" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.VOL_TMP]" HideValue="0" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text21" Left="831.6" Width="56.7" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.COST_TMP]" HideValue="0" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text22" Left="888.3" Width="66.15" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.CNT_H_TMP]" HideValue="0" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text40" Left="954.45" Width="75.6" Height="18.9" Border.Lines="All" CanGrow="true" GrowToBottom="true" Text="[rep_list_repaire_wrk.PR_VIP]" HideValue="0" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<DataHeaderBand Name="DataHeader2" Top="83.6" Width="1047.06" Height="75.6">
<TextObject Name="Text48" Left="189" Top="9.45" Width="151.2" Height="66.15" Border.Lines="Left, Top, Bottom" CanGrow="true" Text="Вид ремонтной работы" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text49" Left="387.45" Top="28.35" Width="75.6" Height="47.25" Border.Lines="Left, Top, Bottom" CanGrow="true" Text="Объем" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text50" Left="463.05" Top="28.35" Width="66.15" Height="47.25" Border.Lines="Left, Top, Bottom" CanGrow="true" Text="Сумма, тыс. грн" Format="Currency" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text51" Left="529.2" Top="28.35" Width="56.7" Height="47.25" Border.Lines="Left, Top, Bottom" CanGrow="true" Text="Кол-во домов" Format="Currency" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text52" Left="585.9" Top="28.35" Width="66.15" Height="47.25" Border.Lines="All" CanGrow="true" Text="Объем" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text53" Left="652.05" Top="28.35" Width="56.7" Height="47.25" Border.Lines="Left, Right, Top" CanGrow="true" Text="Сумма, тыс. грн" Format="Currency" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text54" Left="708.75" Top="28.35" Width="56.7" Height="47.25" Border.Lines="All" CanGrow="true" Text="Кол-во домов" Format="Currency" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text55" Left="765.45" Top="28.35" Width="66.15" Height="47.25" Border.Lines="All" CanGrow="true" Text="Объем" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text56" Left="831.6" Top="28.35" Width="56.7" Height="47.25" Border.Lines="All" CanGrow="true" Text="Сумма, тыс. грн" Format="Currency" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text57" Left="888.3" Top="28.35" Width="66.15" Height="47.25" Border.Lines="All" CanGrow="true" Text="Кол-во домов" Format="Currency" Format.UseLocale="true" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text58" Left="387.45" Top="9.45" Width="198.45" Height="18.9" Border.Lines="Left, Top, Bottom" Text="План на [p_dtPerY] год" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text59" Left="585.9" Top="9.45" Width="179.55" Height="18.9" Border.Lines="All" Text="План на [p_dtPerM] месяцев" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text60" Left="765.45" Top="9.45" Width="264.6" Height="18.9" Border.Lines="All" Text="Факт. выполн. за [p_dtPerM] месяцев" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text61" Left="340.2" Top="9.45" Width="47.25" Height="66.15" Border.Lines="Left, Top, Bottom" CanGrow="true" Text="Ед.изм." HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text62" Left="113.4" Top="9.45" Width="75.6" Height="66.15" Border.Lines="All" Text="Тип" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text63" Top="9.45" Width="113.4" Height="66.15" Border.Lines="All" Text="Конструктив" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text64" Left="954.45" Top="28.35" Width="75.6" Height="47.25" Border.Lines="All" CanGrow="true" Text="Выполнено, %" HorzAlign="Center" VertAlign="Center" Font="Arial, 8pt"/>
</DataHeaderBand>
</DataBand>
<DataBand Name="Data2" Top="218.45" Width="1047.06" Height="18.9" DataSource="rep_zatr">
<TextObject Name="Text44" Width="387.45" Height="18.9" Border.Lines="All" Text="[rep_zatr.NAME_ZATR]" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text45" Left="387.45" Width="444.15" Height="18.9" Border.Lines="All" Font="Arial, 10pt, style=Bold"/>
<TextObject Name="Text46" Left="831.6" Width="56.7" Height="18.9" Border.Lines="All" Text="[rep_zatr.COST_]" Format="Number" Format.UseLocale="false" Format.DecimalDigits="2" Format.DecimalSeparator="." Format.GroupSeparator=" " Format.NegativePattern="1" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text47" Left="888.3" Width="141.75" Height="18.9" Border.Lines="All" Font="Arial, 10pt, style=Bold"/>
<DataHeaderBand Name="DataHeader1" Top="186.1" Width="1047.06" Height="28.35">
<TextObject Name="Text43" Top="9.45" Width="217.35" Height="18.9" Text="Структура затрат на ТР" Font="Arial, 10pt, style=Bold"/>
</DataHeaderBand>
</DataBand>
<ReportSummaryBand Name="ReportSummary1" Top="241.35" Width="1047.06" Height="37.8">
<TextObject Name="Text11" Left="387.45" Top="9.45" Width="75.6" Height="18.9" Border.Lines="All" Text="[t_plan_vol]" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text13" Left="463.05" Top="9.45" Width="66.15" Height="18.9" Border.Lines="All" Text="[t_plan_cost]" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text15" Left="585.9" Top="9.45" Width="66.15" Height="18.9" Border.Lines="All" Text="[t_plan_tmp_vol]" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text17" Left="652.05" Top="9.45" Width="56.7" Height="18.9" Border.Lines="All" Text="[t_plan_tmp_cost]" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text19" Left="765.45" Top="9.45" Width="66.15" Height="18.9" Border.Lines="All" Text="[t_tmp_vol]" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
<TextObject Name="Text24" Top="9.45" Width="387.45" Height="18.9" Border.Lines="All" Text="Итого по предприятию:"/>
<TextObject Name="Text35" Left="529.2" Top="9.45" Width="56.7" Height="18.9" Border.Lines="All" HorzAlign="Right" VertAlign="Center"/>
<TextObject Name="Text41" Left="708.75" Top="9.45" Width="56.7" Height="18.9" Border.Lines="All" HorzAlign="Right" VertAlign="Center"/>
<TextObject Name="Text42" Left="888.3" Top="9.45" Width="141.75" Height="18.9" Border.Lines="All" HorzAlign="Right" VertAlign="Center"/>
<TextObject Name="s_t" Left="831.6" Top="9.45" Width="56.7" Height="18.9" Border.Lines="All" Text="t_tmp_cost] +[t_zatr_cost" HorzAlign="Right" VertAlign="Center" Font="Arial, 8pt"/>
</ReportSummaryBand>
<PageFooterBand Name="PageFooter1" Top="283.15" Width="1047.06" Height="18.9"/>
</ReportPage>
</Report>
Проект давно не менялся, поэтому работал со старыми библиотеками.
Иногда ОЧЕНЬ полезно обновлять версии FR))