0 Replies - 882 Views - Last Post: 24 June 2013 - 11:29 AMRate Topic:

Crystal Reports 8.5 Static Letter Template

Posted 24 June 2013 - 11:29 AM

Unfortunately, there are still some of us stuck in VB6 and Crystal 8.5...Anyway here's the problem:

I have an application that runs against some flat files for data, so there is no database at runtime or design time. We use Crystal Reports to provide all of our printing / reporting capabilities, using the SetTablePrivateData function to bind a recordset to the report at run time. For the most part, this works pretty well.

I've been asked to create a static letter template (no actual data, just fixed text values). Again, this was not a problem -- just create a report with no data source and a bunch of Text fields. However, at run time, if I attempt to generate this letter AFTER a report with data has been run, I get a runtime error: 20000 "no error".

The code being used to generate reports that contain data looks like this:

If the letter code is run first (before a report with data), it works perfectly -- the first time only. If it's run after a report with data, I get the error 20000.

What I've tried:
I've tried calling the SetTablePrivateData method of the Crystal Reports OCX and passing in "Nothing" for the recordset.
I've tried passing in a recordset that has been created (i.e., it's an object, not Nothing) but not populated.

What I'm after
I'm thinking that there should be some way to "clear" whatever is being set behind the scenes by the SetTablePrivateData method -- because apparently, the "Reset" method isn't doing it. If anyone knows how to do what I need, I'd love to hear about it!

Thanks,
C.

This post has been edited by andrewsw: 24 June 2013 - 11:57 AM
Reason for edit:: Please use CODE tags