Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to link up VB6 with Crystal Report Pro?

Status
Not open for further replies.

jcemanic

Programmer
Apr 24, 2001
19
SG
Good day!

one more question is tat how do i pass parameters from VB into Crystal Report itself??

if for example i have to pass two parameters, this_fromdate and this_todate from VB to Crystal Report and ask CR to generate the records between this two dates, wat code must i type in VB and do i have to indicate anything in CR??

thanks for the time!
 
What version of CR?
Which integration method (See the FAQ on what to include in your question if you don't know)? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
i am using CR Pro tat is the reporting program tat comes together with the original package of VB6...
it is also known as Crystal Reports for Visual Basic
with Product No. 4.6.1.0
CRW 32 4.6.1.116
i am using MS Access as my backend Database...
i use ODBC as my connection between VB and CR...

i add in the Crystal Active X control into VB and add in this codes to launch my report
CrystalReport1.ReportFilename = "c:\SalesReport.rpt"
CrystalReport1.PrintReport

the problem now is the passing of parameters which i have indicate in my first question....

thanks for the time!!
 
CrystalReport1.ParameterFields(0) = "Parameter Name;Default Value;True" Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
i try your method but there is an error msg

Run Time Error '438':
Object doesn't support this property or method

wat should i do??
 
Hi,
I'm a programmer using VB6, recently I developed a project which using Crystal for reporting purposes, but when I made the instalation package and installed it in the client PC, the crystal part didn't work. I used crystal as an activex document and added it to the project. Because of this problem I'm unable to continue with my project. doe
s any one know how to solve this problem?
 
jcemanic,

I wasn't thinking. CR 4.6 doesn't have parameter fields. What you should do is pass an entire selection formula in the format of:

{field} in Date(2001,1,1) to Date (2001,1,31)

I will have to look up the synatx of the command. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Here is the command you need. Remember that the values that you pass have to get to CR in the format I have shown here:

rptMyReport.ReplaceSelectionFormula ("{field} in Date(2001,1,1) to Date (2001,1,31)") Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Good day to all!!
to kenhamady...
this ReplaceSelectionFormula tat u have shown me only allow passing of one parameter....

how about if i need a range of dates between two paramaters (for e.g. displaying the period between parameter "start_date" and "end_date") ?

the format of the dates required are actually in the format of "DD-MMM-YYYY"
could your formula worked in this format??




 
The formula that I showed you has both a low value and a high value, which is what you need. It does not pass "parameters" but passes one formula that contains a Boolean expression.

As far as your date, the format isn't an issue unless this is a character field instead of a date. Can you write a selection formula that works in the report designer to give a date range? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
good day!!
i dun really get wat u mean previously...
i need to pass start_date and end_date as two parameters from VB into Crystal Report to get the reports between these two dates and then display them in CR...
but in the formula i can only assign one {field} and wat is it suppose to contain?
A parameter or my date field in my query?

since over at VB i must to apply this formula then do i have to apply further formula or codes over at CR or MS Access (my backend db) to get them to respond to VB's call?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top