Solved

Passing parameters to Crytal Report from VB

Posted on 2000-03-17
2
204 Views
Last Modified: 2010-05-02
I am using the crytal reports control that comes with VB6. I am trying to print a report which requires a parameter. I am using the following code:

CrystalReport1.ReportFileName = "C:\one.rpt"
CrystalReport1.PrintReport

This pops up a window to enter the parameter value. After I do that, my screen flickers and I don't see any output. I don't want to use any SQL code. I just want to call the RPT file which I am doing right now.

Musleh
0
Comment
Question by:mfarid1
[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
2 Comments
 

Accepted Solution

by:
kthacker earned 50 total points
ID: 2630047
This is an example to run a report that has one parameter and attaches to a SQL Server database

With CrystalReport1
        .ReportFileName = "MyReport.rpt"
        .Destination = crptToPrinter  'or crptToWindow to display on screen
        .Connect = "DSN = ;UID = UserName;PWD = UserPassword;DSQ = "
        .ParameterFields(0) = "ParameterName;ParameterValue;TRUE"
        .Action = 1
End With

0
 
LVL 4

Expert Comment

by:wileecoy
ID: 2630361
I haven't tested what you described in your question, but when that has happened to me in the past I believe that meant that the parameters weren't matched by my data.

I'll try and find an app that I wrote w/ a parameter and let you know.  I, however, passed my parameters through VB and not the dialog box w/ Crystal.

It sounds like you are doing all the right things programmatically and the parameter call to the data might have a problem.

Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

696 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