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!

Previewing a report via a VB 6 application

Status
Not open for further replies.

Yothepapy

Programmer
Feb 1, 2001
3
BE
Hello, here is my problem

We have an application created with VB6 which launch several CR8 reports (main + subs) based on stored procedures in sqlserver 6.5
We are previewing the report several times whith differents parameters (2 or 3 differents persons for instance)
The main report refresh (so we see 2 differents person infos) BUT not the subs (they always keep the data of the first call).
We don't save data with the reports !!!
here are the code of VB
************************************************************
Private Sub PrintEvaluation(DestinationType As Integer)

With CRptSosaTrg
.StoredProcParam(0) = ""
.StoredProcParam(1) = ""
.ParameterFields(0) = ""
.ParameterFields(1) = ""
.ParameterFields(2) = ""
.ParameterFields(3) = ""
.ParameterFields(4) = ""
.ReportFileName = gsReportPath & "I-FMN-501_evaluation " & sLanguage & ".rpt"
'.ReportFileName = App.Path & "\reports\I-FMN-501_evaluation " & sLanguage & ".rpt"
.StoredProcParam(0) = sArmyNumber
.StoredProcParam(1) = sPromotion
Select Case sPhaseKey
Case cPHASE_EPB
.ParameterFields(0) = "p_ep;" & cPHASE_EP1_5Sqn & ";true"
.ParameterFields(1) = "p_instruc;" & cPHASE_InstVol_EPB_5Sqn & ";true"
.ParameterFields(2) = "p_language;" & sLanguage & ";true"
Case cPHASE_EPAIT
.ParameterFields(0) = "p_ep;" & cPHASE_EP2_7Sqn & ";true"
.ParameterFields(1) = "p_instruc;" & cPHASE_InstVol_EPAIT_7Sqn & ";true"
.ParameterFields(2) = "p_language;" & sLanguage & ";true"
Case cPHASE_IOT
.ParameterFields(0) = "p_ep;" & cPHASE_EP3_11Sqn & ";true"
.ParameterFields(1) = "p_instruc;" & cPHASE_InstVol_IOT_11Sqn & ";true"
.ParameterFields(2) = "p_language;" & sLanguage & ";true"
Case Else
MsgBox "The selected phase is not available, please choose another one" & Chr$(10) & "or contact your system administrator", vbExclamation
Exit Sub
End Select
.Destination = DestinationType
'.Destination = crptToWindow
.DiscardSavedData = False
.ProgressDialog = False
.Action = 1
.StoredProcParam(0) = ""
.StoredProcParam(1) = ""
.ParameterFields(0) = ""
.ParameterFields(1) = ""
.ParameterFields(2) = ""
.ParameterFields(3) = ""
End With

End Sub
***********************************************************
We simply given the parameters to the reports which is linked with the database.

Do you have an answer ???

Thanks for all
 
Yothepapy: You need to ensure that your code includes a section to select each subreport in turn and then assign the new parameter values to this as well as to the main report David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top