|
-
Nov 14th, 2000, 11:40 AM
#1
Thread Starter
Hyperactive Member
Hi again!
I want to find out how to pass parameters to Crystal Reports from a SQL database through VB 6. I am doing reports for my app and I need to know where to begin.
Sample code would be great if you have it. Thanks in advance for your help.
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
-
Nov 14th, 2000, 01:14 PM
#2
Fanatic Member
Hi,
In your project components activate the crystal report control.
Put the CR control on a form and change the properties.
[code]
CrystalReport1.ReportFileName = "yourreport"
CrystalReport1.Action = 1
I always create a tempory print table for my reports
by using a sql statement.
That's all.
Cheers
Bye
-
Nov 14th, 2000, 01:45 PM
#3
Lively Member
crystal reports
FrmMain.CrystalReport1.Reset
FrmMain.CrystalReport1.Connect = "dsn=;uid=;pwd=" FrmMain.CrystalReport1.Destination = 0
FrmMain.CrystalReport1.WindowState = 2 'Window Maximize
FrmMain.CrystalReport1.DiscardSavedData = True
FrmMain.CrystalReport1.ReportFileName ="c:\ss\rrr.rpt"
FrmMain.CrystalReport1.Formulas(i) = formula name="gfgfgfgf"
FrmMain.CrystalReport1.Action = 1
hope i helped
[Edited by shachar on 11-14-2000 at 01:49 PM]
-
Nov 14th, 2000, 02:49 PM
#4
Thread Starter
Hyperactive Member
Ok, but...
Thanks for the input. I may be a little confused, but how do you pass parameters/fields? I'm sorry but I've never used crystal reports before and I am trying to understand what happens? Also, can you suggest a good book on this topic? Or on VB6 and Crystal Reports?
Thanks again.
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
-
Nov 14th, 2000, 03:32 PM
#5
Fanatic Member
Re: Ok, but...
ok
In the first place I'm using a separate Crystal Report
program instead the one supplied by VB.
What to do in a few steps.
Open Crystal Report and choose new.
From the report gallery you can choose custom report
with data file.
Choose the database file and you receive a report
screen where to put data and text.
Insert fields from the table into the Details section.
There is also a possibility to insert text fields for
titles, formula fields, total fields and so on...
After finishing just look with preview to check the layout.
There is a great online help in the report generator.
Good Luck
Ray
-
Nov 15th, 2000, 02:15 AM
#6
Lively Member
i cannot remember what is the way of using parameters but if you are building your report on a store procedure you will have under crystal reports something like command... or param.... i dont realy remember but if you still have the problem reply and i will try my best to help you
-
Nov 27th, 2000, 01:18 PM
#7
Thread Starter
Hyperactive Member
Need more help...
Hi again!
I need to know what command line(s) I need to add in VB in order to pass one parameter (i.e. ID number) from VB6 to a Crystal Report. The version I have is 6.0. I have already set up the report in Crystal and it is opening in the application, but it is giving me all the records. Basically, I just want Crystal to print the data that is on the form where the user is viewing the data. Any ideas/suggestions? I hope this isn't confusing. Thank you in advance.
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
-
Nov 28th, 2000, 01:59 AM
#8
New Member
I think you would like to know about this..
with Crystal1
.ReportFileName = App.Path & "\RCDLossDaily.rpt"
.Destination = crptToWindow
.ParameterFields(0) = "PName1;" & Value & ";TRUE"
.ParameterFields(1) = "PName2;" & strStop & ";TRUE"
.Action = 1
End with
Set True = CR will not prompt to enter parameter
-
Nov 28th, 2000, 03:17 PM
#9
Thread Starter
Hyperactive Member
Thanks!
Marex, Shachar, & Superdorm,
Thank you for all your help. I was able to solve my problem.
Thank you to infinity!
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|