Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB.Net vs VB with Crystal Reports 11 Viewer
Message
General information
Forum:
ASP.NET
Category:
Reporting
Miscellaneous
Thread ID:
01027081
Message ID:
01028163
Views:
15
Hi again Viv,

I'm not understanding this completely. I made this work in Visual FoxPro without all of these problems, but I'm somewhat of a VB novice and a complete VB.NET novice.

The reports are already designed and running stand-alone in Crystal Reports. All I am trying to do is make a Run Report button on a form run a report that is already running on its own. The company I wrote the reports for had Crystal Reports built into their existing canned software package that they had purchased, but the canned software did not meet their needs so they asked me to develop new Crystal Reports for them, which I did, but I could not hook them into the existing canned software because it was Crystal Reports version 7.1.1 and I created mine in Crystal Reports 11.

I have all the VB.NET forms working, except the button that says "Run Report". I even have a Calendar form where they choose the report start and end date, just like I did in Visual FoxPro application I wrote.

I don't want the end-user to design anything, just run the report and preview on their screen using the CR Viewer so they can check it out before they print it.

I added the Crystal Viewer ActiveX object to the form. I added code to the Run Report button, but I still don't know how to define my report in the Dim statement. I keep getting the error "Type Crystal Report1 is not defined." I guess I don't know how to define it. I looked up the error message and have looked at tons of examples I found on the Internet, but I just don't get how to get rid of this error. I also right-clicked on the Application Name in the Solutions Explorer window and added my specific report by name to the project.

In Visual FoxPro I made it so they could choose a report name from a pull-down and I would simply run it when they pressed Run Report and they could preview it first. That's all I want to do, but I just don't get it yet.

I can read the VB code samples and understand them, except for that part about Dim crReport As CrystalReport1. My report is not always going to be CrystalReport1, it is whatever report they choose from the pull-down menu of reports to choose from.

I'm going to work on this today all day and hopefully figure this out. I don't think I even need the Crystal Template added to the project because I have the Viewer object on my form and also have the report in the project alongside the forms and I have Crystal engine, shared, print control references set up in the project window alongside the forms and report itself. But like I said, one report is not what I want. I need to have multiple reports accessible at runtime and only want to run the one report they choose one report at a time.

It can't be this difficult. I'm not understanding something. I think I only need about 6 lines of code to do this. I will add the date range parameter portion of code after I get a simple Crystal Report to run using one table. I have the code in the Run Report button as follows:
crViewer.ReportSource = "c:\crystal_test.rpt"
        crReport.Load()
        crViewer.ViewReport()
        'crViewer.Refresh()
        'crViewer.Visible = True
I keep changing the code during testing so the commented code may or may not be needed. This is probably not exactly right either. I'll keep working on it. I appreciate your help. I'm surprised my fellow VFP online buddies are not jumping in and helping me out. I helped many Universal Thread people from all over the world to get Visual FoxPro to run Crystal Reports from a front-end application report menu because I had it working so well.

Thanks again. Sorry to keep questioning you, but as I said, you are my hero at this point in time.
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Previous
Reply
Map
View

Click here to load this message in the networking platform