如何使用ASP.Net MVC中的过滤数据表在Crystal报表中传递参数?

问题描述

我想在Crystal报表中传递参数。但它仅显示数据表头。 像这样:

enter image description here

这是我的ActionResult导出

Layer (type)                 Output Shape              Param #   
=================================================================
conv1d_6 (Conv1D)            (None,96,32)            15392     
_________________________________________________________________
max_pooling1d_6 (MaxPooling1 (None,48,32)            0         
_________________________________________________________________
dropout_11 (Dropout)         (None,32)            0         
_________________________________________________________________
flatten_6 (Flatten)          (None,1536)              0         
_________________________________________________________________
dense_11 (Dense)             (None,256)               393472    
_________________________________________________________________
dropout_12 (Dropout)         (None,256)               0         
_________________________________________________________________
dense_12 (Dense)             (None,8)                 2056      
=================================================================
Total params: 410,920
Trainable params: 410,920
Non-trainable params: 0
_________________________________________________________________

这是我的按钮onclick脚本。

public ActionResult Export(DateTime? min,DateTime? max)
{
    ReportDocument rd = new ReportDocument();
    rd.Load(Path.Combine(Server.MapPath("~/Reports/CrystalReportDeductions.rpt")));
    rd.SetDataSource(db.Deductions
    .Select(d => new
    {
        Id = d.Id,EmployeeId = d.Employees.FirstName + " " + d.Employees.MiddleName + " " + d.Employees.LastName,Date = DbFunctions.TruncateTime(d.Date).Value,ShiftName = d.ShiftName,DeductDate = DbFunctions.TruncateTime(d.DeductDate).Value,DeductionFactor = d.DeductionFactor,Amount = d.Amount,}).Where(d => d.DeductDate <= min ||
             d.DeductDate >= max).ToList());
    Response.Buffer = false;
    Response.ClearContent();
    Response.ClearHeaders();
    Stream stream = rd.ExportToStream
        (CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
    stream.Seek(0,SeekOrigin.Begin);
    return File(stream,"application/pdf","Deductions.pdf");
}

我不知道我的代码有什么问题。我已经尝试过Ajax,而没有成功功能或viewbag。但没有任何效果。请帮我。任何帮助将不胜感激。非常感谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...