
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
>.