Solved

How to call crystal report  from VB?

Posted on 2001-07-31
9
185 Views
Last Modified: 2010-05-02
I am doing an VB application where I need to create reports . I have designed a report & formed needed sql to pass to that report. But I don't know how to pass them off. Can anybody help me on that?
0
Comment
Question by:revathi
[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
  • 6
  • 2
9 Comments
 
LVL 11

Expert Comment

by:Otana
ID: 6337164
You need to place the Crystal Reports Control on your VB Form. Set the report property to your report, maybe some other properties. Set the action property to 1 to execute the report.

CR1.action=1
0
 

Author Comment

by:revathi
ID: 6337718
I need to use sql for reporting i.e., runtime assignment of either recordset / query as such will be helpful. Any other suggestion is appreciated.
thanks

0
 

Expert Comment

by:pepe2000
ID: 6337806
There is a property crReport.SQLQuery <SQL text here>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:revathi
ID: 6337824
Can you send me an sample code to illustrate this property usage. I tried but not able to get
thanks
0
 

Accepted Solution

by:
pepe2000 earned 100 total points
ID: 6338312
   CReport1.PrintFileName = ""
    CReport1.ReportFileName = ""
    CReport1.ReportSource = crptDataControl
    CReport1.Destination = CrptToWindow
    Data1.RecordSource = "SELECT..."
    Data1.Refresh
    CReport1.Action = 1

This example works if you can use data control
i dont know what do you want to do with the SQL text, do you have the same output for every sql that you want to send or it can change?

if it can change this example works
 
0
 

Author Comment

by:revathi
ID: 6353039
Thank you expters!.I found that RDC is helpful for assigning active data sources. I graded to average since only part of the code was helpful to me

0
 

Author Comment

by:revathi
ID: 6353041
Thank you expters!.I found that RDC is helpful for assigning active data sources. I graded to average since only part of the code was helpful to me

0
 

Author Comment

by:revathi
ID: 6353047
Thank you expters!.I found that RDC is helpful for assigning active data sources. I graded to average since only part of the code was helpful to me

0
 

Author Comment

by:revathi
ID: 6353080
Thank you expters!.I found that RDC is helpful for assigning active data sources. I graded to average since only part of the code was helpful to me

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 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