Skip to main content

[Migrated content. Thread originally posted on 31 March 2003]

I find this vb demo to have a parameters i need some help to translate to cobol...

So far i did that


77 hx-crreport handle of Report.
77 hx-crapp handle of Application.
77 hx-PARAMDEFS handle of ParameterFieldDefinitions.
77 hx-PARAMDEF handle of ParameterFieldDefinition.
77 hx-viewer handle of CRViewer9.
77 ws-fileid pic x(256)
value
"C:\\LCM\\CRYSTAL\\CLIENT.rpt".

create @Application of @CRAXDRT handle is hx-crapp.
modify hx-crapp @OpenReport (ws-fileid)
returning hx-crreport.

ACCEPT OMITTED.
MODIFY hx-crreport @DISPLAYPROGRESSDIALOG(1).

Here is the bugs i don't now what i have to put a modify or inquire
inquire hx-crreport @ParameterFields::hx-Paramdefs.

MODIFY hx-crreport @PrintOut(0).


destroy hx-crreport.
destroy hx-crapp.



Public Sub myreports()
Const RptFile = "\\Crystal\\MyReport.rpt"
dim crApp as new CRAXDRT.Application
Dim crRepp As CRAXDRT.Report
Dim crParamDefs As CRAXDRT.ParameterFieldDefinitions
Dim crParamDef As CRAXDRT.ParameterFieldDefinition
Dim crDBTab As CRAXDRT.DatabaseTable

' Open report file
Set crRepp = crApp.OpenReport(App.Path & RptFile)
' Set location of database based on WhatCompany
crRepp.Database.LogOnServer "p2ssql.dll", "Server Name", "DB Name", "User ID", "Password"
' Set table location to appropriate company server
For Each crDBTab In crRepp.Database.Tables
crDBTab.SetLogOnInfo "Server Name", "DB Name", "User ID", "Password"
Next
crRepp.DisplayProgressDialog = True
' Fill report parameters
Set crParamDefs = crRepp.ParameterFields
For Each crParamDef In crParamDefs
Select Case crParamDef.ParameterFieldName
Case "Parameter1"
crParamDef.SetCurrentValue ("Parameter 1 Value")
Case "@STARTDATE"
crParamDef.SetCurrentValue DateValue("01/01/1980")
Case "@ENDDATE"
crParamDef.SetCurrentValue DateValue("12/31/1980")
End Select
Next
DoEvents
crRepp.EnableParameterPrompting = False
' Display it for the user to print or export
crViewer1.ReportSource = crRepp
crViewer1.ViewReport
End Sub

[Migrated content. Thread originally posted on 31 March 2003]

I find this vb demo to have a parameters i need some help to translate to cobol...

So far i did that


77 hx-crreport handle of Report.
77 hx-crapp handle of Application.
77 hx-PARAMDEFS handle of ParameterFieldDefinitions.
77 hx-PARAMDEF handle of ParameterFieldDefinition.
77 hx-viewer handle of CRViewer9.
77 ws-fileid pic x(256)
value
"C:\\LCM\\CRYSTAL\\CLIENT.rpt".

create @Application of @CRAXDRT handle is hx-crapp.
modify hx-crapp @OpenReport (ws-fileid)
returning hx-crreport.

ACCEPT OMITTED.
MODIFY hx-crreport @DISPLAYPROGRESSDIALOG(1).

Here is the bugs i don't now what i have to put a modify or inquire
inquire hx-crreport @ParameterFields::hx-Paramdefs.

MODIFY hx-crreport @PrintOut(0).


destroy hx-crreport.
destroy hx-crapp.



Public Sub myreports()
Const RptFile = "\\Crystal\\MyReport.rpt"
dim crApp as new CRAXDRT.Application
Dim crRepp As CRAXDRT.Report
Dim crParamDefs As CRAXDRT.ParameterFieldDefinitions
Dim crParamDef As CRAXDRT.ParameterFieldDefinition
Dim crDBTab As CRAXDRT.DatabaseTable

' Open report file
Set crRepp = crApp.OpenReport(App.Path & RptFile)
' Set location of database based on WhatCompany
crRepp.Database.LogOnServer "p2ssql.dll", "Server Name", "DB Name", "User ID", "Password"
' Set table location to appropriate company server
For Each crDBTab In crRepp.Database.Tables
crDBTab.SetLogOnInfo "Server Name", "DB Name", "User ID", "Password"
Next
crRepp.DisplayProgressDialog = True
' Fill report parameters
Set crParamDefs = crRepp.ParameterFields
For Each crParamDef In crParamDefs
Select Case crParamDef.ParameterFieldName
Case "Parameter1"
crParamDef.SetCurrentValue ("Parameter 1 Value")
Case "@STARTDATE"
crParamDef.SetCurrentValue DateValue("01/01/1980")
Case "@ENDDATE"
crParamDef.SetCurrentValue DateValue("12/31/1980")
End Select
Next
DoEvents
crRepp.EnableParameterPrompting = False
' Display it for the user to print or export
crViewer1.ReportSource = crRepp
crViewer1.ViewReport
End Sub
Good work!

I suppose this should do the trick:

77 ws-index pic 9(4).
77 ws-count pic 9(4).
77 ws-name pic x(64).
..
Inquire hx-crreport ParameterFields IN hx-paramdefs.
Inquire hx-paramdefs Count IN ws-count.
perform varying ws-index from 1 by 1 until ws-index > 1
inquire hx-paramdefs Item(ws-index) in hx-paramdef
inquire hx-paramdef ParameterFieldName IN ws-name
Evaluate TRUE
WHEN ws-name = "Parameter1"
modify hx-paramdef SetCurrentValue("Parameter 1 Value")
WHEN ws-name = "@STARTDATE"
modify hx-paramdef SetCurrentValue("01/01/1980")
WHEN ws-name = "@ENDDATE"
modify hx-paramdef SetCurrentValue("12/31/1980")
end-evaluate
end-perform

[Migrated content. Thread originally posted on 31 March 2003]

I find this vb demo to have a parameters i need some help to translate to cobol...

So far i did that


77 hx-crreport handle of Report.
77 hx-crapp handle of Application.
77 hx-PARAMDEFS handle of ParameterFieldDefinitions.
77 hx-PARAMDEF handle of ParameterFieldDefinition.
77 hx-viewer handle of CRViewer9.
77 ws-fileid pic x(256)
value
"C:\\LCM\\CRYSTAL\\CLIENT.rpt".

create @Application of @CRAXDRT handle is hx-crapp.
modify hx-crapp @OpenReport (ws-fileid)
returning hx-crreport.

ACCEPT OMITTED.
MODIFY hx-crreport @DISPLAYPROGRESSDIALOG(1).

Here is the bugs i don't now what i have to put a modify or inquire
inquire hx-crreport @ParameterFields::hx-Paramdefs.

MODIFY hx-crreport @PrintOut(0).


destroy hx-crreport.
destroy hx-crapp.



Public Sub myreports()
Const RptFile = "\\Crystal\\MyReport.rpt"
dim crApp as new CRAXDRT.Application
Dim crRepp As CRAXDRT.Report
Dim crParamDefs As CRAXDRT.ParameterFieldDefinitions
Dim crParamDef As CRAXDRT.ParameterFieldDefinition
Dim crDBTab As CRAXDRT.DatabaseTable

' Open report file
Set crRepp = crApp.OpenReport(App.Path & RptFile)
' Set location of database based on WhatCompany
crRepp.Database.LogOnServer "p2ssql.dll", "Server Name", "DB Name", "User ID", "Password"
' Set table location to appropriate company server
For Each crDBTab In crRepp.Database.Tables
crDBTab.SetLogOnInfo "Server Name", "DB Name", "User ID", "Password"
Next
crRepp.DisplayProgressDialog = True
' Fill report parameters
Set crParamDefs = crRepp.ParameterFields
For Each crParamDef In crParamDefs
Select Case crParamDef.ParameterFieldName
Case "Parameter1"
crParamDef.SetCurrentValue ("Parameter 1 Value")
Case "@STARTDATE"
crParamDef.SetCurrentValue DateValue("01/01/1980")
Case "@ENDDATE"
crParamDef.SetCurrentValue DateValue("12/31/1980")
End Select
Next
DoEvents
crRepp.EnableParameterPrompting = False
' Display it for the user to print or export
crViewer1.ReportSource = crRepp
crViewer1.ViewReport
End Sub
I am trying to use a multiply cie.
The name of the file for the customer is 01ARCLI.001 for cie 1 and 02ARCLI.001 for the cie 2

IN the odbc i name CIE-01 for my data of 01ARCLI.001 and
CIE-02 for my data of 02ARCLI.001

And i want the same report just to change the database so far i try without success

Inquire hx-crreport Database IN hx-database.
Inquire hx-DATABASE Tables in hx-databases.
inquire hx-DATABASES Item(1) in WS-NAME.
Inquire hx-database Parent IN ws-name.
Inquire hx-database DictionaryLocation IN ws-name.

I am searching the name of database that his used for the report.
and the way to change it.