简单账表设置套打设置不了
金蝶云社区-王艳_4
王艳_4
0人赞赏了该文章 1,483次浏览 未经作者许可,禁止转载编辑于2016年06月16日 11:21:13

我写了一个简单账表,在软件中正常显示,但是设置套打模板,设置不了,询问总部,说是没有数据源
下面是我所写的简单账表 的代码,我想问一下,该如何设置数据源,才能设置套打模板
[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report;
using System.Data;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Orm.DataEntity;

namespace SJ.K3.FIN.AR.REPORT
{
public class CostDetailReport:SysReportBaseService
{
private Int32 month;
private Int32 year;

public override void Initialize()
{
base.ReportProperty.IdentityFieldName = "FID";
this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;

base.ReportProperty.ReportName = new LocaleValue("基于实际成本的门店利润报表", this.Context.UserLocale.LCID);
base.ReportProperty.IsUIDesignerColumns = false;//列头是否BOSIDE设置
base.ReportProperty.SimpleAllCols = false;//是否锁定帐表表格列
}

public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
base.BuilderReportSqlAndTempTable(filter, tableName);
DynamicObject customFil = filter.FilterParameter.CustomFilter;
year = Convert.ToInt32 (customFil["F_SJ_YEAR"].ToString());
month = Convert.ToInt32 (customFil["F_SJ_Period"].ToString());
this.ShowTable(tableName);
}

public override ReportTitles GetReportTitles(IRptParams filter)
{

ReportTitles titles = new ReportTitles();
titles.AddTitle("F_SJ_YEAR", year.ToString());
titles.AddTitle("F_SJ_Period", month.ToString());
titles.AddTitle("F_SJ_TableName", "基于实际成本的总利润表");
return titles;
}
//


//设置汇总列信息
//

//
//
public override List GetSummaryColumnInfo(IRptParams filter)
{
List summarys = new List();

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthCost", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearCost", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthBusinessTaxesadditional", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearBusinessTaxesadditional", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthManage", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearManage", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthadministrate", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearadministrate", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthFinancialCost", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearFinancialCost", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthCapitalExpenses", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearCapitalExpenses", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthElseIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearElseIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthInvestmentReturn", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearInvestmentReturn", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthFEE", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearFEE", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthOperatingIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearOperatingIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthNonoperatingIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearNonoperatingIncome", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthNonoperatingExpenses", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearNonoperatingExpenses", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthTotalProfits", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearTotalProfits", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthTaxs", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearTaxs", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisMonthNetProfit", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));
summarys.Add(new Kingdee.BOS.Core.Report.SummaryField("FThisYearNetProfit", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM));

return summarys;
}
//


//设置单据头
//

//
//
public override ReportHeader GetReportHeaders(IRptParams filter)
{
ReportHeader RH = new ReportHeader();
RH.AddChild("FCustomeName", new LocaleValue("门店名称", this.Context.UserLocale.LCID));
ListHeader Income = RH.AddChild();
Income.Caption = new LocaleValue("营业收入", this.Context.UserLocale.LCID);
Income.AddChild("FThisMonthIncome", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
Income.AddChild("FThisYearIncome", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader Cost = RH.AddChild();
Cost.Caption = new LocaleValue("营业成本", this.Context.UserLocale.LCID);
Cost.AddChild("FThisMonthCost", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
Cost.AddChild("FThisYearCost", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader Taxesadditional = RH.AddChild();
Taxesadditional.Caption = new LocaleValue("行业税金及附加", this.Context.UserLocale.LCID);
Taxesadditional.AddChild("FThisMonthBusinessTaxesadditional", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
Taxesadditional.AddChild("FThisYearBusinessTaxesadditional", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader administrate = RH.AddChild();
administrate.Caption = new LocaleValue("经营费用", this.Context.UserLocale.LCID);
administrate.AddChild("FThisMonthadministrate", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
administrate.AddChild("FThisYearadministrate", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader Manage = RH.AddChild();
Manage.Caption = new LocaleValue("管理费用", this.Context.UserLocale.LCID);
Manage.AddChild("FThisMonthManage", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
Manage.AddChild("FThisYearManage", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader FIN = RH.AddChild();
FIN.Caption = new LocaleValue("财务费用", this.Context.UserLocale.LCID);
FIN.AddChild("FThisMonthFinancialCost", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
FIN.AddChild("FThisYearFinancialCost", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader Capital = RH.AddChild();
Capital.Caption = new LocaleValue("资产减值损失", this.Context.UserLocale.LCID);
Capital.AddChild("FThisMonthCapitalExpenses", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
Capital.AddChild("FThisYearCapitalExpenses", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader ElseIncome = RH.AddChild();
ElseIncome.Caption = new LocaleValue("其他业务收入", this.Context.UserLocale.LCID);
ElseIncome.AddChild("FThisMonthElseIncome", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
ElseIncome.AddChild("FThisYearElseIncome", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader InvestmentReturn = RH.AddChild();
InvestmentReturn.Caption = new LocaleValue("投资收益", this.Context.UserLocale.LCID);
InvestmentReturn.AddChild("FThisMonthInvestmentReturn", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
InvestmentReturn.AddChild("FThisYearInvestmentReturn", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader FEE = RH.AddChild();
FEE.Caption = new LocaleValue("其中,对联营企业和合营企业的投资收益", this.Context.UserLocale.LCID);
FEE.AddChild("FThisMonthFEE", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
FEE.AddChild("FThisYearFEE", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader OperatingIncome = RH.AddChild();
OperatingIncome.Caption = new LocaleValue("营业利润", this.Context.UserLocale.LCID);
OperatingIncome.AddChild("FThisMonthOperatingIncome", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
OperatingIncome.AddChild("FThisYearOperatingIncome", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader NonoperatingIncome = RH.AddChild();
NonoperatingIncome.Caption = new LocaleValue("营业外收入", this.Context.UserLocale.LCID);
NonoperatingIncome.AddChild("FThisMonthNonoperatingIncome", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
NonoperatingIncome.AddChild("FThisYearNonoperatingIncome", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader NonoperatingExpenses = RH.AddChild();
NonoperatingExpenses.Caption = new LocaleValue("营业外支出", this.Context.UserLocale.LCID);
NonoperatingExpenses.AddChild("FThisMonthNonoperatingExpenses", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
NonoperatingExpenses.AddChild("FThisYearNonoperatingExpenses", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader TotalProfits = RH.AddChild();
TotalProfits.Caption = new LocaleValue("利润总额", this.Context.UserLocale.LCID);
TotalProfits.AddChild("FThisMonthTotalProfits", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
TotalProfits.AddChild("FThisYearTotalProfits", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader Taxs = RH.AddChild();
Taxs.Caption = new LocaleValue("所得税", this.Context.UserLocale.LCID);
Taxs.AddChild("FThisMonthTaxs", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
Taxs.AddChild("FThisYearTaxs", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

ListHeader NetProfit = RH.AddChild();
NetProfit.Caption = new LocaleValue("净利润", this.Context.UserLocale.LCID);
NetProfit.AddChild("FThisMonthNetProfit", new LocaleValue("本期金额", this.Context.UserLocale.LCID));
NetProfit.AddChild("FThisYearNetProfit", new LocaleValue("本年金额", this.Context.UserLocale.LCID));

return RH;

}
[/code]

您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!

请选择打赏金币数 *

10金币20金币30金币40金币50金币60金币
可用金币: 0