1

I currently am getting the error:

Invalid TLV Record

When running the following block of code:

Private Sub PrinttoFile_Click()
    Dim crApp As CRAXDRT.Application
    Dim crRep As CRAXDRT.Report
    Set crApp = New CRAXDRT.Application
    Set crRep = crApp.OpenReport("C:\Documents and Settings\Administrator\Desktop\DansTest\Report3.rpt")
    '...code to set report parameters, login information etc...

    ExportReportToPDF crRep, "C:\Testing\ReportTest.pdf", "Beds Held"


End Sub

It errors on Set crRep = line. I've made sure that all my .dlls for CR9 are registered. The report was built using CR9 Reports and saved as such. CRAXDRT is the CR9 runtime activeX control. Any ideas?

Also, this is not a deployment issue. I am working on the same machine as the coding. This error is happening while debugging the original code, not while running an executable.

Daniel Camburn
  • 85
  • 1
  • 3
  • 10
  • It's not exactly a duplicate but you may want to check out [Invalid TLV record when executing crystal reports in c#](http://stackoverflow.com/questions/11149413/invalid-tlv-record-when-executing-crystal-reports-in-c-sharp) – C-Pound Guru Aug 07 '13 at 17:13
  • Yeah, I looked over this one and that's why I mentioned all my DLLs are registered and the Common Files key is there. Also looked over that second link there with no avail. – Daniel Camburn Aug 07 '13 at 17:31
  • Just for laughs, have you tried moving the report to a non-user folder like c:\Testing? – C-Pound Guru Aug 07 '13 at 18:43
  • I found the answer, my CRAXDRT.dll was in the system32 folder and not with the rest of the DLLs in the CrystalDecisions/bin/2.0 etc folder. Copied it to there, changed the reference and it fixed the error. Thanks for the attempt though C-Pound. – Daniel Camburn Aug 07 '13 at 19:58
  • If you can, answer your own question. See http://stackoverflow.com/help/self-answer. You may have to wait a little before doing so, but it will be useful to others who run into the same issue. – C-Pound Guru Aug 07 '13 at 20:36
  • Yeah, I had to wait 4 more hours to answer, but will answer now :) – Daniel Camburn Aug 08 '13 at 17:45

1 Answers1

2

The answer to this problem turned out to be that my CRAXDRT.dll file for CR9 was in the Windows System32 folder. Even though the reference in VB 6.0 was pointing to the correct .dll, something about it was wrong.

I fixed the error by copying the .dll into the folder with the rest of the CR9 files, C:\Program Files\Common Files\CrystalDecisions\2.0\bin and redirected the reference here and it solve the error.

So in short, make sure your dll file is in the correct folder with the rest of the dll files.

Daniel Camburn
  • 85
  • 1
  • 3
  • 10