how can i call the Crystal report(8.5) from vb 6.0 
Author Message
 how can i call the Crystal report(8.5) from vb 6.0

Hi all:

could you please help me on this.

I have created one report using Crystal Report 8.5
with stored proc(some arguments) with sql server 7.0.
it is working well.
I   need to call the report from Vb 6.0.
Can you guys help me how do i need to proceed .
Appreciate your immediate response.

THanks.
Chandra



Mon, 01 Aug 2005 02:29:30 GMT  
 how can i call the Crystal report(8.5) from vb 6.0
insert a crystal report control to your project

ask the user for the parameters values

have a command buton cmd_execute_report an in its click event code something
like this

With menu.cry_reporte
    .Reset
    .ReportFileName = reportes & _
                      nombre_reporte & _
                      ".rpt"
parametros:
    .StoredProcParam(0) = dbc_representantes.Columns(0).Value
    .StoredProcParam(1) = dbc_inicio.Columns(0).Value
    .StoredProcParam(2) = dbc_final.Columns(0).Value

proceso:
    .WindowShowGroupTree = True
    .WindowTitle = nombre_reporte
    .WindowState = crptMaximized
    .Action = 1

End With

Regards



Quote:
> Hi all:

> could you please help me on this.

> I have created one report using crystal report 8.5
> with stored proc(some arguments) with sql server 7.0.
> it is working well.
> I   need to call the report from Vb 6.0.
> Can you guys help me how do i need to proceed .
> Appreciate your immediate response.

> THanks.
> Chandra



Mon, 01 Aug 2005 04:19:49 GMT  
 how can i call the Crystal report(8.5) from vb 6.0
morales:

Thank you very much for your immediate response.

i could not find the crystal report control in the
components(usually  it shoud be).
help me is there any way to find out.

so i tried in this way,then i stucked in the middle.
===========================
Dim repApp              As CRAXDRT.Application
Dim cryReport           As CRAXDRT.Report
Set repApp = New CRAXDRT.Application
Set cryReport = repApp.OpenReport(ReportName, 1)

i added crviewer to the form, then

CRViewer1.ReportSource = cryReport
CRViewer1.ViewReport

with this it is displaying the report if is not required
any parameters, user id  and pwd.

i need to pass the parameters to call the report.

How can i give the database in fromation, parameters and
all the stuff.

Appricicate if you let me know whether i am in right track
or not.

Regards....

=====================

Quote:
>-----Original Message-----
>insert a crystal report control to your project

>ask the user for the parameters values

>have a command buton cmd_execute_report an in its click

event code something
Quote:
>like this

>With menu.cry_reporte
>    .Reset
>    .ReportFileName = reportes & _
>                      nombre_reporte & _
>                      ".rpt"
>parametros:
>    .StoredProcParam(0) = dbc_representantes.Columns
(0).Value
>    .StoredProcParam(1) = dbc_inicio.Columns(0).Value
>    .StoredProcParam(2) = dbc_final.Columns(0).Value

>proceso:
>    .WindowShowGroupTree = True
>    .WindowTitle = nombre_reporte
>    .WindowState = crptMaximized
>    .Action = 1

>End With

>Regards



>> Hi all:

>> could you please help me on this.

>> I have created one report using crystal report 8.5
>> with stored proc(some arguments) with sql server 7.0.
>> it is working well.
>> I   need to call the report from Vb 6.0.
>> Can you guys help me how do i need to proceed .
>> Appreciate your immediate response.

>> THanks.
>> Chandra

>.



Mon, 01 Aug 2005 04:52:42 GMT  
 how can i call the Crystal report(8.5) from vb 6.0
To add password I used this code found on Internet
        varReport.Database.Tables(1).Location = "C:\myDB.mdb"
        varApp.LogOnServer "p2bdao.dll", "", "C:\myDB.mdb", "", "myPwd"
Pay attention that "p2bdao.dll" is string and contains the name of DLL.
Never saw such things before. It's for Access DB. For others I think should
be used something else

For Parameters I used this:
Dim varParams As CRAXDRT.ParameterFieldDefinitions
Dim varParam As CRAXDRT.ParameterFieldDefinition

'After I open report (not displayed, just opened) I pass parameters this
way:
    Set varParams = varReport.ParameterFields
    Set varParam = varParams.Item(1)
    varParam.SetCurrentValue strReportHeader   'strReportHeader is string,
so in the next statement I say that it's crStringField

    varParams.Add varParam, crStringField
    varReport.EnableParameterPrompting = False

HTH
vasya


morales:

Thank you very much for your immediate response.

i could not find the crystal report control in the
components(usually  it shoud be).
help me is there any way to find out.

so i tried in this way,then i stucked in the middle.
===========================
Dim repApp              As CRAXDRT.Application
Dim cryReport           As CRAXDRT.Report
Set repApp = New CRAXDRT.Application
Set cryReport = repApp.OpenReport(ReportName, 1)

i added crviewer to the form, then

CRViewer1.ReportSource = cryReport
CRViewer1.ViewReport

with this it is displaying the report if is not required
any parameters, user id  and pwd.

i need to pass the parameters to call the report.

How can i give the database in fromation, parameters and
all the stuff.

Appricicate if you let me know whether i am in right track
or not.

Regards....

=====================

Quote:
>-----Original Message-----
>insert a crystal report control to your project

>ask the user for the parameters values

>have a command buton cmd_execute_report an in its click

event code something
Quote:
>like this

>With menu.cry_reporte
>    .Reset
>    .ReportFileName = reportes & _
>                      nombre_reporte & _
>                      ".rpt"
>parametros:
>    .StoredProcParam(0) = dbc_representantes.Columns
(0).Value
>    .StoredProcParam(1) = dbc_inicio.Columns(0).Value
>    .StoredProcParam(2) = dbc_final.Columns(0).Value

>proceso:
>    .WindowShowGroupTree = True
>    .WindowTitle = nombre_reporte
>    .WindowState = crptMaximized
>    .Action = 1

>End With

>Regards



>> Hi all:

>> could you please help me on this.

>> I have created one report using crystal report 8.5
>> with stored proc(some arguments) with sql server 7.0.
>> it is working well.
>> I   need to call the report from Vb 6.0.
>> Can you guys help me how do i need to proceed .
>> Appreciate your immediate response.

>> THanks.
>> Chandra

>.



Mon, 01 Aug 2005 09:39:18 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. RightFax 6.0 and Crystal 8.5 and VB 6.0 Font size

2. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

3. vb .net crystal reports not compatible with Crystal Reports 8.5

4. Books for Crystal Reports 8.5 and Visual Basic 6.0

5. Problem using Crystal Report 8.5 to export PDF in Visual Basic 6.0

6. Formulas, Crystal 8.5, and VB 6.0

7. VB 6.0 and Crystal 8.5 / 20535

8. Crystal Report 8.5 and VB .net

9. Crystal Reports 8.5 Grouping Definition in VB.

10. VB Crashes when inserting a Crystal 8.5 Report Designer

11. Running Crystal 8.5 Reports on Crystal 9 RAS

12. Crystal Report 8.5 and VB 6

 

 
Powered by phpBB® Forum Software