مرجع تخصصی برنامه نویسان

انجمن تخصصی برنامه نویسان فارسی زبان

کاربر سایت

nedaes

عضویت از 1401/03/17

ساخت گزارش مستر دیتیل با استفاده از business object

  • سه شنبه 17 خرداد 1401
  • 16:50
تشکر میکنم

من در استیمول سافت یک گزارش با استفاده از  business object ها ساختم اما اطلاعات دیتیل نمایش داده نمیشود. 

view model  ها به صورت زیر هستند:

using System.Collections.Generic;

namespace KimiaBaseProject.Core.ViewModels.Professors
{
    public class ProfessorsWithProvidedCoursesForReportVm
    {
        public string ProfFName { get; set; }
        public string ProfLName { get; set; }
        public string ProfNCode { get; set; }       

        public List<ProfProvidedCourses> ProfProvidedCourses;
    }
}

و 

namespace KimiaBaseProject.Core.ViewModels.Professors
{
    public class ProfProvidedCourses
    {
        public string CourseName { get; set; }
        public string Day { get; set; }
        public string StartHourr { get; set; }
        public string EndHour { get; set; }
    }
}

کد نوشته شده در ویژوال استودیو به صورت زیر است:

 public ActionResult Report()
    {
        return View();
    }
    public ActionResult LoadReportSnapshot()
    {

        //Make data ready
        var data = _queryRepository.GetListAsIQueryable();
        var mappeddata = data.ProjectTo<ProfessorsWithProvidedCoursesForReportVm>(_mapper.ConfigurationProvider).ToList();

        //Load report and register data in it
        int busobjLevel = 1;
        StiReport report = new StiReport();
        report.Load("./wwwroot/Reports/ReportStimul.mrt");
        report.RegBusinessObject("ProfInfo_Parent", mappeddata);
        report.Dictionary.SynchronizeBusinessObjects(busobjLevel);
        return StiNetCoreViewer.GetReportResult(this, report);

    }

    public ActionResult PrintReport()
    {
        return StiNetCoreViewer.PrintReportResult(this);
    }

    public ActionResult ExportReport()
    {
        return StiNetCoreViewer.ExportReportResult(this);
    }

 

فایل Report.cshtml به صورت زیر است:

@using Stimulsoft.Report.Mvc 
@model ProvidedCourseReportVm

@Html.StiNetCoreViewer((new StiNetCoreViewerOptions(){
     Actions = {
         GetReport="LoadReportSnapshot",
         ViewerEvent="ViewEvent",
         ExportReport="ExportReport",
         PrintReport="PrintReport"
     }
 }))

 

و فایل ReportStimulmrt  به صورت زیر است:

وقتی ران میکنم فقط اطلاعات مستر نمایش داده میشه(دیتابند1 رو هم به عنوان مستردیتابند2 تعیین کردم ولی باز هم جواب نداد.

پاسخ های این پرسش

تعداد پاسخ ها : 0 پاسخ
در حال حاضر هیچ پاسخی ارسال نشده است
کاربرانی که از این پست تشکر کرده اند شیراز سوشال

اگر نیاز به یک مشاور در زمینه طراحی سایت ، برنامه نویسی و بازاریابی الکترونیکی دارید

با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)