Solved

Passing parameters to Crytal Report from VB

Posted on 2000-03-17
2
201 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
2 Comments
 

Accepted Solution

by:
kthacker earned 50 total points
Comment Utility
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
Comment Utility
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

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

6 Experts available now in Live!

Get 1:1 Help Now