2013-02-12 5 views
2

Crystal Reports를 사용하여 VB.net에서 이미지를 표시하고 싶습니다.하지만 응용 프로그램을 실행할 때 참조를 추가했지만 보고서를로드하기 전에 다음 예외가 발생합니다. 내 프로젝트에 crdb_adoplus.dll의.크리스탈 보고서에 이미지 표시

예외 : 'crdb_adoplus, 버전 = 9.1.3300.0, Culture = neutral, PublicKeyToken = 692fbea5521e1304'또는 해당 종속성 중 하나를로드 할 수 없습니다. 강력한 이름 유효성 검사에 실패했습니다. (HRESULT에서 예외 : 0x8013141A) : 정말 사전에 제안을 주셔서 감사합니다

Private Sub Frm_Reporting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
     CrystalReportViewer1.ReportSource = Nothing 
     Dim rptbarcode As RptPacking 
     rptbarcode = New RptPacking 
     Dim xrep As DataSet1 
     xrep = New DataSet1 
     Dim row As DataRow 
     Dim MyImg As Image = Nothing 
     Try 
      btnEncode(MyImg, BarcodeText) 
      row = xrep.Tables("DataTable1").NewRow 
      Dim ms As New MemoryStream() 

      MyImg.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) 

      Dim ii As Byte() 

      ii = ms.ToArray() 

      xrep.Tables("DataTable1").Rows.Add(ii) 

      rptbarcode.Load("GSMProduction.RptPacking.rpt") 
      rptbarcode.SetDataSource(xrep.Tables("DataTable1")) 
      CrystalReportViewer1.ReportSource = rptbarcode 

     Catch ex As Exception 
      MessageBox.Show(ex.Message) 
     End Try 
    End Sub 


    Private Sub btnEncode(ByRef pic As Image, ByVal txtData As String) 
     Dim W As Integer = 160 
     Dim H As Integer = 110 
     Dim b As BarcodeLib.Barcode 
     Dim type As BarcodeLib.TYPE = BarcodeLib.TYPE.UNSPECIFIED 
     type = BarcodeLib.TYPE.CODE128 
     b = New BarcodeLib.Barcode() 
     Try 
      If type <> BarcodeLib.TYPE.UNSPECIFIED Then 
       b.IncludeLabel = True 

       '===== Encoding performed here ===== 
       pic = b.Encode(type, txtData, W, H) 
       'CType(Frm, frm_submitentery).pic_img.Image = pic.Image 
       '=================================== 


      End If 

     Catch ex As Exception 
      'try 
      MessageBox.Show(ex.Message) 
      'catch 
     End Try 

    End Sub 

여기

그리고 내 코드입니다.

+0

b.Encode의 반환 형식은 무엇입니까? – AbZy

+0

이미지입니다. 'Private Sub btnEncode (ByRef pic As Image, ByVal txtData as String)'메서드의 서명에서 찾을 수 있습니다. –

답변

0

당신이 VS2010에서 닷넷 4를 실행하는 경우, 당신은 당신의 .config 파일에 다음 (구성 섹션)을 추가해야 할 수도 있습니다

<startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 
</startup> 
관련 문제