导出报告时出现“数据库登录失败”错误

时间:2019-05-03 13:01:47

标签: asp.net-mvc entity-framework crystal-reports

我正在使用Entity Framework!
导出报告时出现“数据库登录失败”错误

public ActionResult PrintAction()
    {
        ReportDocument rd = new ReportDocument();
        rd.Load(Path.Combine(Server.MapPath("~/Report"), "rpt_bill.rpt"));
        rd.SetDataSource(db.APS_Inventory_BillDetails
                        .Join(db.APS_Inventory_Bill,
                        bd => bd.BillID,
                        b => b.Billid,
                        (bd, b) => new { bd, b })
                        .Join(db.APS_Inventory_Container,
                        cbd => cbd.bd.Containerid,
                        c => c.ContainerID,
                        (cbd, c) => new BillDetailModel
                        {
                            BillNo = cbd.b.BillNo,
                            Vessel = cbd.b.Vessel,
                            Voyage = cbd.b.Voyage,
                            Shipper = cbd.b.Shipper,
                            BookingNo = cbd.b.BookingNo,
                            ShipOnBoardDate = cbd.b.ShipOnBoardDate,
                            POLCode = cbd.b.POLCode,
                            PODCode = cbd.b.PODCode,
                            EstDateOfDeparture = cbd.b.EstDateOfDeparture,
                            Container = c.Code
                        }).ToList());
        Response.Buffer = false;
        Response.ClearContent();
        Response.ClearHeaders();
        try
        {
            Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            stream.Seek(0, SeekOrigin.Begin);
            return File(stream, "application/pdf", "bill_.pdf");
        }
        catch
        {
            throw;
        }


    }

一切正常,但只有出口报告出问题

我试图验证数据库并收到警告

Image Verify Database Error

我想在连接多个表时导出报告... 请帮我解决问题!谢谢

0 个答案:

没有答案