ReturnData逻辑返回数据 [英] ReturnData Logic return data

查看:71
本文介绍了ReturnData逻辑返回数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我目前有一个ReportDataSource,可以从存储过程中获取所需的信息,以报表形式显示它.返回格式是将填充内容的表.由于这是基于学校和班级的,这意味着对于每所学校,将返回一个表格以及该学校提供的班级列表.
我目前正在获取数据,但是我的代码正在为每个班级而不是每个学校生成一个表格.因此,如果我有5个班级,我的代码将返回5个表,每个表都具有相同的学校名称,但带有不同的班级名称-我希望它是相反的方式.这是我当前的代码:

Hello,
I currently have a ReportDataSource which i get the information i need from my stored procedure to display it in a reporting form. The return format is a table that will be filled in with content. Since this is based on Schools and Classes which means for each school a table will be returned with the list of classes offered in that school.
I am currently getting the data but my code is generating a table for each Class and not for each School. so if i have 5 classes my code returns 5 tables each with the same school name but different class name with in - i want it to be the other way around. Here is my current code:

public ReportDataSource GetSchools(DateTime? beginDate, DateTime? endDate, int schoolId)
        {
            var report = _schoolSummaryRepository.GetSchoolSummaryClass(beginDate, endDate, schoolId);
            return new ReportDataSource("SchoolReport", report);
        }



我尝试使用foreach循环,但结果是我得到没有学校或班级名称的空表.



I tried using a foreach loop but the result is i get empty tables without school or class names

推荐答案

使用此代码段很难回答您的问题.您需要详细说明!.但是我建议您使用
It is difficult to answer your question with this code snippet. You need to elaborate more!. But what I will suggest you to use Debugging technique[^] efficiently.


这篇关于ReturnData逻辑返回数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆