Solved

how to open crystal reports in vb?

Posted on 2000-05-09
3
161 Views
Last Modified: 2010-05-02
I've written a database program in Vb6 and one of my form contains codes that will open up crystal reports, but it failed to work. I don't know really know what should I use in the form to open up the reports as well as the codes. Thanks
0
Comment
Question by:cooljam23
3 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 2792620
Post some of the code, I can then try to work out which bit(s) aren't working and suggest a solution.
0
 

Accepted Solution

by:
syedAliF earned 75 total points
ID: 2792746

To open a report in Vb You need to open the  a.rpt file of crystal report that you have created.

To open a report in VB
you have to place a crystal report control from the tool box onto the form.

Now to test you can assign the reportfilename property by selecting the .rpt file you have designed.


This is the code:
Put a command button and write this under its click event
crystalreport1.Reportfile="C:\report1.rpt"
cystalreport1.WindowState = crptMaximized   crystalreport1.Destination = crptTowindow
crystalreport1.Action = 1
   
This code works fine if the report is designed properly.


0
 

Author Comment

by:cooljam23
ID: 2793004
Thanks, it works just fine.  I'm sure you wanna get more points. Can you please have a look at my other question I asked on the 9th. The topic is "refreshing problem with 2 child forms" I'll up the point if you could help me with it. Thanks again
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now