示例#1
0
        /// <summary>
        /// 返回报表列表(按指定规范)
        /// </summary>
        /// <param name="reportId">主reportId</param>
        /// <param name="checkRole">是否验证用户权限</param>
        /// <param name="moduleId">模块页ID</param>
        /// <returns></returns>
        public IList <ChildReportModel> GetChildListFromTbReport(long reportId, long moduleId, bool checkRole)
        {
            var tbList = GetTbReportList(reportId, moduleId, checkRole);

            if (tbList != null && tbList.Count > 0)
            {
                var childList = new List <ChildReportModel>();
                //循环表格表格,取出其配置信息
                foreach (var ent in tbList)
                {
                    ChildReportModel child = new ChildReportModel();

                    child.ChildReportId   = ent.Id;
                    child.IsOpen          = ent.IsOpen;
                    child.ChildReportType = ent.ReportType;
                    child.ApplicationType = ent.ApplicationType;

                    child.ChildReportJson = JSON.DecodeToStr(ent);

                    childList.Add(child);
                }
                return(childList);
            }
            return(null);
        }
示例#2
0
        /// <summary>
        /// 保存一个表格报表(其他类报表也需要提供类似方法:参数部分相同)
        /// </summary>
        /// <param name="childrReport"></param>
        /// <param name="reportId"></param>
        /// <param name="code"></param>
        public void SaveTbReport(ChildReportModel childrReport, long reportId, string code)
        {
            if (childrReport.ChildReportJson != null && childrReport.ChildReportJson.Length > 0)
            {
                var tbReport = JSON.EncodeToEntity <TbReportModel>(childrReport.ChildReportJson);
                if (tbReport != null)
                {
                    #region 基础信息修改,得到tbReportId
                    TbReport tb = AutoMapper.Mapper.Map <TbReport>(tbReport);
                    tb.ReportId        = reportId;
                    tb.ApplicationType = childrReport.ApplicationType;
                    tb.ReportType      = childrReport.ChildReportType;
                    tb.IsOpen          = childrReport.IsOpen;
                    tb.Id = childrReport.ChildReportId;
                    var tbReportId = _tbReportRepository.InsertOrUpdateAndGetId(tb);//修改表格报表并获得ID
                    #endregion

                    tbReport.ReportType      = childrReport.ChildReportType;
                    tbReport.ApplicationType = childrReport.ApplicationType;

                    SaveRpFieldList(tbReport, reportId, tbReportId);       //保存列信息

                    SaveRpEventList(tbReport, reportId, tbReportId, code); //保存事件信息

                    SaveRpTopList(tbReport, tbReportId);                   //保存多表头信息

                    SaveRpFilterList(tbReport, tbReportId);                //保存筛选条件信息
                }
            }
        }
示例#3
0
        /// <summary>
        /// 保存一个rdlc报表
        /// </summary>
        /// <param name="childrReport"></param>
        /// <param name="reportId"></param>
        /// <param name="code"></param>
        public void SaveRdlcReport(ChildReportModel childrReport, long reportId, string code)
        {
            if (childrReport.ChildReportJson != null && childrReport.ChildReportJson.Length > 0)
            {
                var rdlcReport = JSON.EncodeToEntity <RdlcReportModel>(childrReport.ChildReportJson);
                if (rdlcReport != null)
                {
                    #region 基础信息修改,得到rdlcReportId
                    RdlcReport rdlc = AutoMapper.Mapper.Map <RdlcReport>(rdlcReport);
                    rdlc.ReportId        = reportId;
                    rdlc.ApplicationType = childrReport.ApplicationType;
                    rdlc.IsOpen          = childrReport.IsOpen;
                    rdlc.Id = childrReport.ChildReportId;
                    var rdlcReportId = _rdlcReportRepository.InsertOrUpdateAndGetId(rdlc); //修改rdlc报表并获得ID
                    #endregion
                    SaveRdlcInEventList(rdlcReport, reportId, rdlcReportId, code);         //保存内置事件

                    SaveRpFilterList(rdlcReport, rdlcReportId);                            //保存筛选条件信息
                }
            }
        }
示例#4
0
        /// <summary>
        /// 保存一个chart报表
        /// </summary>
        /// <param name="childrReport"></param>
        /// <param name="reportId"></param>
        /// <param name="code"></param>
        public void SaveChartReport(ChildReportModel childrReport, long reportId, string code)
        {
            if (childrReport.ChildReportJson != null && childrReport.ChildReportJson.Length > 0)
            {
                var chartReport = JSON.EncodeToEntity <ChartReportModel>(childrReport.ChildReportJson);
                if (chartReport != null)
                {
                    #region 基础信息修改,得到chartReportId
                    ChartReport chart = AutoMapper.Mapper.Map <ChartReport>(chartReport);
                    chart.ReportId        = reportId;
                    chart.ApplicationType = childrReport.ApplicationType;
                    chart.IsOpen          = childrReport.IsOpen;
                    chart.Id      = childrReport.ChildReportId;
                    chart.MakeWay = 1;                                                        //自定义

                    var chartReportId = _chartReportRepository.InsertOrUpdateAndGetId(chart); //修改chart报表并获得ID
                    #endregion
                    SaveChartInEventList(chartReport, reportId, chartReportId, code);         //保存内置事件

                    SaveRpFilterList(chartReport, chartReportId);                             //保存筛选条件信息
                }
            }
        }