财产' ReportSource'是'ReadOnly'

时间:2015-02-22 08:01:30

标签: mysql vb.net crystal-reports report readonly

我目前正在VB.net上发布报告,但我发现了这个错误:

    Property 'ReportSource' is 'ReadOnly'.

这是我的代码:

   Imports CrystalDecisions.CrystalReports.Engine

导入CrystalDecisions.Shared

Public Class MRTable

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
    Dim cryRpt As New ReportDocument

    cryRpt.Load("D:\Orly\workspace\HMIS\01.26.15\HoMISv2.0\CRMedicalRecords.rpt")

    Dim crParameterFieldDefinitions As ParameterFieldDefinitions
    Dim crParameterFieldDefinition As ParameterFieldDefinition
    Dim crParameterValues As New ParameterValues
    Dim crParameterDiscreteValue As New ParameterDiscreteValue

    crParameterDiscreteValue.Value = Nurse.SelectedPatient
    crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
    crParameterFieldDefinition = crParameterFieldDefinitions.Item("PCode")
    crParameterValues = crParameterFieldDefinition.CurrentValues

    crParameterValues.Clear()
    crParameterValues.Add(crParameterDiscreteValue)
    crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

    CRMedicalRecords.ReportSource = cryRpt
End Sub

结束班

我希望你能帮助我。

1 个答案:

答案 0 :(得分:0)

请在Crystal Reports或Visual Studio中打开报告,然后在下面进行检查 文件>报告选项 选项Read-Only被关闭。

正如您在添加参数时所做的那样,这可能会阻止您编辑报表。