首页 > 解决方案 > Visual Studio 在使用 Crystal 报表时抛出 System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x800A5023'

问题描述

我认为这是新错误因为我在 Google 中找不到 System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x800A5023' key word

我的代码

   Public Sub tampilkantiket()
    AxCrystalReport1.SelectionFormula = "totex{{pemesanan.id_pemesanan}}='" & txtidpemesanan.Text & "'"
    AxCrystalReport1.ReportFileName = "Tiket.rpt"
    AxCrystalReport1.WindowState = Crystal.WindowStateConstants.crptMaximized
    AxCrystalReport1.RetrieveDataFiles()
    AxCrystalReport1.Action = 1
   End Sub

标签: vb.netcrystal-reportsvisual-studio-2019

解决方案


您可以尝试以下两种可行的解决方案。

  1. 检查您要引用的表/字段。的内容
    AxCrystalReport1.SelectionFormula可能有误。您需要确保它们是正确的。
  2. 检查用于在应用程序中生成报告的版本和控件。如果您可以避免 ActiveXs 进入 .net 控件,则应由对应于该版本或更高版本的控件生成由高于 8 的水晶版本创建的报告。

推荐阅读