Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CRViewer (8.5) and VB.NET 2003 - navigation/export buttons don't work

Posted on 2004-07-30
5
Medium Priority
?
2,704 Views
Last Modified: 2008-01-09
I've been successfully using Crystal Reports 8.5 Developer and the CRViewer control with VB6 for 2 years now.  I recently began to make the transition to VB.NET.  

I realize that VB.NET handles COM objects differently than VB6, and expected that there might be some differences in how I would need to implement the CRViewer in .NET.  

Here is an exerpt of my code (does not include variable declarations or irrelevant code):

    rs.Open(strSQL, cnn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly)

    CRReport = CRApp.OpenReport(strReportPath, 1)
    CRReport.DiscardSavedData()
    CRReport.Database.SetDataSource(rs, 3, 1)
    CRReport.ReadRecords() 'Report displays no data if I leave this line out

    frm.CRViewer.ReportSource = CRReport
    frm.CRViewer.ViewReport()
    frm.Show()
    rs.Close()
    rs = Nothing

I've come across two major obstacles so far:

1)  If I ommit the line 'CRReport.ReadRecords()', the report displays no data.  If I add this line, however, the report displays data, but I can only view the first page.  The viewer shows "1 of 1+" but the navigation buttons do nothing.  How can I get the navigation buttons working so I can view the entire report?

2)  I have all the necessary export dll's installed (I've verified this with Crystal Documentation).  However, clicking on the export button does not bring up the "Choose Export Format" dialog.  I eventually gave up on this (temporarily) and tried messing with the CRViewer events manually.  The navigation button events still did nothing.  But interestingly enough, the export button will pop up with a msgbox when i put a message box in the export button event.

Coming from VB6 where I had none of these problems, I've grown very frustrated with the changes VB.NET has introduced to what seemed like a straight-forward process.  I'd appreciate any help you can give.  

Thanks in Advance,
Mike
0
Comment
Question by:MikeC03
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 11679563
This may be an incompatability between CR8.5 and VB.Net.

The CR.Net versions are based on the CR9 version.  There is a change in report file format.

mlmcc
0
 
LVL 42

Accepted Solution

by:
frodoman earned 1600 total points
ID: 11682447
Mike,

There was a known issue with Visual Studio 2003 (you didn't say which version you're using) if any of the fields in the detail section overlap from page 1 to 2 then page 2 won't display.  This was fixed by a service pack though so make sure you've applied if you're on VS2003: http://support.businessobjects.com/fix/hot/si75/default.asp#Crystal%20Reports%20Service%20Packs

I had a a similar sounding problem when page footers were suppressed the viewer didn't page forward properly.  Solution to that issue was to un-suppress page footer and shrink height to nothing.  I don't know if that was patched or not as it hasn't come up since that one time.

Is this a vb.net application for Windows or Web?  I saw no indication that this is a web application but your problem sounds like a common .net issue when the Crystal code isn't placed into your page's "IsPostBack" handler...  If it is a web app I can give you more info about that...

For problem #2, the only issue I know of again relates to web applications.  If that's you then check this link: http://support.businessobjects.com/library/kbase/articles/c2011964.asp

frodoman




0
 
LVL 13

Expert Comment

by:EwaldL
ID: 11684039
could it be your code is placed in the page_load instead of the page_init? make sure it's in teh page_init. this article explains why
http://support.businessobjects.com/library/kbase/articles/c2013576.asp

if you are having trouble using crystal in .net, then try using one of the sample applications first. check the following sections on http://support.businessobjects.com/fix/samplescr.asp?ref=default.asp_selectlist
Listing of Crystal Reports for VS .NET sample applications in VB.NET
Listing of Crystal Reports for VS .NET sample applications in C++
Listing of Crystal Reports for VS .NET sample applications in C#
0
 
LVL 1

Author Comment

by:MikeC03
ID: 11693766
Tthe service pack did help with the problem.  I also found that creating my own buttons and calling the various events directly (show next page, export, etc) worked fine as well.  Thank you all for your input.

Mike
0
 
LVL 42

Expert Comment

by:frodoman
ID: 11694169
Glad I could help - frodoman
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question