Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is best method to integrate CR8 with 50+ reports into VB 6?

Status
Not open for further replies.

groundclutter

Programmer
Apr 26, 2000
40
US
I am writing a module in VB6 for a bigger project to access approximately 50 reports that will be converted over to CR8 from CR3.<br><br>I have created a form with a listbox that is going to reference a table with all of the report titles in it.&nbsp;&nbsp;As the user selects a report, I would like to pull up the CR Viewer.&nbsp;&nbsp;I am not sure if this is possible because I keep having multiple errors, etc. but believe it should be.&nbsp;&nbsp;One big question is that in the examples that I have seen the report that is seen in the viewer is always defined as
 
'Create a new CrystalReport per report.<br>Dim Report1 As New CrystalReport1<br>Dim Report2 As New CrystalReport2<br><br><br>Private Sub Form_Load()<br> Screen.MousePointer = vbHourglass<br><br> 'This is the automatically generated code where you will replace Report into Report* which you want to be the default report.<br> CRViewer1.ReportSource = Report2<br> CRViewer1.ViewReport<br><br> Screen.MousePointer = vbDefault<br>End Sub<br><br>In your listBox<br><br>Private Sub Whatever()&nbsp;&nbsp;&nbsp;<br> Screen.MousePointer = vbHourglass<br>&nbsp;&nbsp;&nbsp;&nbsp;<br> 'Defini le rapport a afficher<br> CRViewer1.ReportSource = Report1<br> CRViewer1.ViewReport<br><br> Screen.MousePointer = vbDefault<br>End Sub<br><br>It works fine for me !<br><br>Now for you I don't know if you have to put : &quot;Dim Report2 As New CrystalReport2&quot; 50 times for your 50 reports are if you can do it dynamically !<br><br>Hope it helps !
 
I have a very similar concern.&nbsp;&nbsp;I would very much like the functionality of the CR Viewer, but as far as I know, it can only display reports that are created in, or imported to, the RDC.&nbsp;&nbsp;With 40 or 50 reports, doesn't that make for a huge executable (or at least a large distribution package)?&nbsp;&nbsp;Or can you keep all the report resource files on the network, seperate from the distribution?&nbsp;&nbsp;I also wonder if that would slow the VB IDE down at all, having so many reports incorporated.&nbsp;&nbsp;Using the RDC, if a report needs to be tweaked, you need to recompile the application, right?&nbsp;&nbsp;I really wish the Viewer could load stand alone reports (if you know of a way to do this, please let me know).
 
That code is very similar to what I've been doing and it works fine before saving the designer component.&nbsp;&nbsp;But, after saving the designer component while in the VB ide, I can never get it to work again without getting the message &quot;Server not yet opened.&quot;&nbsp;&nbsp;... any ideas as to why this is happening?<br><br>Thanks again!
 
Hi,<br><br>&quot;Server not yet opened&quot; is normally that your connection to database is not working !<br>Check your DSN ODBC. (I supose you're using an ODBC source ?)<br>
 
I was using the OLE DB provider for SQL Server and trying to avoid using the ODBC layer.&nbsp;&nbsp;This connection is still not working and I don't know what the problem is...
 
Regarding using the Viewer with stand-alone reports:<br><br>I create my reports using the .ttx files.&nbsp;&nbsp;This is basically a text file that provides Crystal Reports with the fieldname, datetype, size and sample code.&nbsp;&nbsp;CR then uses these fieldnames to design the report.&nbsp;&nbsp;The reports are saved with the .rpt extension.&nbsp;&nbsp;When I want to display the report, I use VB to get a recordset that I then pass to the report.&nbsp;&nbsp;If I want to change the report, then I change the report only.&nbsp;&nbsp;VB is not affected at all.<br><br>For the &quot;Server not yet opened&quot; problem:&nbsp;&nbsp;I was getting a similar error message and it took me 3 days of digging, talking to Seagate, and driving my co-workers crazy before my husband &quot;helped me to see the light&quot; for my case.<br><br>The reports had multiple subreports and would run great on my PC.&nbsp;&nbsp;When the user tried to run them on their PCs, they would get the &quot;Server not yet opened&quot; error message.&nbsp;&nbsp;Finally, we realized that the main difference between my PC and their PCs was that I had the .ttx files and they didn't(nor should they need them).&nbsp;&nbsp;I copied the .ttx files to one of the user PCs and they were then able to run the reports.&nbsp;&nbsp;While talking to Seagate tech support, I stumbled on the real problem.&nbsp;&nbsp;I had set my VB code, that if no records came back for a subreport, then not to attempt to pass the recordset (of zero records) to the subreport.&nbsp;&nbsp;That meant that the subreport was not receiving any structure and so couldn't run.&nbsp;&nbsp;The reason it was working on my PC was because when it couldn't find structure from the recordset, it would look for and find it from the original .ttx file.&nbsp;&nbsp;The users didn't have the .ttx files, so no structure was available.&nbsp;&nbsp;Seagate didn't know that their reports would do this.<br><br>To fix this, I passed the 0 records recordset to the subreport.&nbsp;&nbsp;Even though no records were passed, the structure was.&nbsp;&nbsp;After that, the reports would run on any PC.<br><br>This may not be exactly like the problem you are having, but maybe it will give you an idea of where to look.<br><br>Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top