borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Design crystal report at runtime)Next Topic (can not display report 2 tables with condition) New Topic New Poll Post Reply
AndreaVB Forum : Reporting tools : Crystal 9.2 and Stored Procedures problem Solved Topic
Poster Message
Marcelo
Level: Scholar

Registered: 16-09-2005
Posts: 39

icon Crystal 9.2 and Stored Procedures problem

Hi, before making my question, I'm working with:
VB6
Crystal Reports 9.2.2.693
SQL Server
I need to connect via OLEDB

Ok, I have setup my report all from within the report. The database, the stored procedure, and the fields I'm going to display.

My question is: How can I do to display the report by passing the parameters through VB6?

I already have added Crystal Reports 9 ActiveX Designer RunTime Library and Crystal Reports Viewer 9 to References as well as Crystal Report Viewer 9 to Components.

Hope you can help me figure this out.

Marcelo.

01-02-2006 at 08:18 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Crystal 9.2 and Stored Procedures problem

Rport has ParameterFieldDefinitions collection, so you need to set value for every ParameterFieldDefinition in this collection using SetCurrentValue method.

____________________________
If you find the answer helpful, please mark this topic as solved.

01-02-2006 at 08:36 PM
View Profile Send Email to User Show All Posts | Quote Reply
Marcelo
Level: Scholar

Registered: 16-09-2005
Posts: 39
icon Re: Crystal 9.2 and Stored Procedures problem

Could you please explain to me with some code? I couldn't find any which works with these parameters I described above.

Thanks in advance, Marcelo.

01-02-2006 at 09:04 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Crystal 9.2 and Stored Procedures problem

In this section you have many examples how to display report from VB. I believe there is a sticky one that desrcibes in detail.
AS for the parameters, the code should look somethingl ike this

dim prm as ParameterFieldDefinition

    for each prm in rpt.ParameterFieldDefinitions
        select case prm.name
            case "@par1"
                prm.setcurrentvalue somevalue1
            case "@par2"
                prm.setcurrentvalue somevalue2
            case "@par3"
                prm.setcurrentvalue somevalue3
        end select
    next


____________________________
If you find the answer helpful, please mark this topic as solved.

01-02-2006 at 09:36 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Reporting tools : Crystal 9.2 and Stored Procedures problem Solved Topic
Previous Topic (Design crystal report at runtime)Next Topic (can not display report 2 tables with condition) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder