Highlighted
Absent Member.
Absent Member.
882 views

[archive] Crystal I did my homework

[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
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Crystal I did my homework

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
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Crystal I did my homework

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.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.