REPORT WRITER

Started by suriakumar, February 11, 2025, 12:33:52 AM

Previous topic - Next topic

suriakumar

Sir


1) How do i pass (SEND)  Global Variables and Global Functions  to  REPORT WRITER

Like *WEB\START_UP is there anyway to pass Global Variables and Global Functions in REPORT WRITER
We are using Non-Normalized (Legacy) Files.  Also we do not have Data Dictionary


2)  How do i pass the Report Parameter  (Like From Range,  To Range) etc. To REPORT WRITER.   

Once again we do not use Data Dictionary.  We are using Legacy (Non-Normalized) Data files

J.SURIAKUMAR

Jane Raymond

The input source can be any native PxPlus file with an embedded data dictionary, a PxPlus View, a Query Definition, or any other data source whose data can be accessed using a Custom Data Source Object. External databases, such as ODBC, Oracle or DB2, can also be accessed via Views or Data Dictionary defintions. So if you are not using a Data Dictionary, you could create a manual query to supply the data or a report writer Custom Data Source Object to supply the data.

The Report Writer does not have global variables and functions like *web/start_up. You pass values into the Report Writer using parameters.
If you are running a report interactively, you can use the default interactive parameter interface to enter parameter values. If the report is not interactive, you can enter the parameter values programmatically using the 'AcceptParameters() method.
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.

suriakumar

I tried to add the parameter programmatically.  It is not displaying in the parameter list

LET REPORTNAME$="C:\PXPLUS\ABCdef.pvr"

00130 LET RPT=NEW("*rpt/pvxreport"); IF RPT=0 THEN END
00131 LET RPT$=STR(RPT)
00132 IF RPT'OPEN(REPORTNAME$)=0 THEN MSGBOX "Could not open report file:"+SEP+SEP+MSG(ERR)+SEP+MSG(-1),"Initialization error","!"


00261 RPT'CLEARPARAMS()
00270 LET P=RPT'ADDPARAM()
00280 LET P'NAME$="COMPANY"
00290 LET P'DESCRIPTION$="COMPANY NAME"
00300 LET P'TYPE$="S"
00310 LET P'LENGTH=30
00320 LET P'VALUE$="ABC & CO"



I tried with above code.   After this when i looked into the definition it does not show the new parameter in the parameters list.


Method 2
========

Alternatively i saved the above code ( from 261 to 320) in a separate program and stored it in REPORT_OPTIONS--->CUSTOM_INTERFACES--->PARAMETER_INTERFACES---->PROGRAM

It is not working.

"ANY EXAMPLE/CODING  TO ADD PARAMTER PROGRAMATICALLY

SURIAKUMAR




Jane Raymond

SURIAKUMAR,
The code you show is for adding parameters dynamically at run-time when the report is being generated. They exist while the report is generated and are not being saved.
My question is this: Are the parameters required for the report always the same? That is, are you always requesting the COMPANY in this case. If so, you would define that as a parameter in the report definition using the Report Designer. See the Data > Parameter menu item.:
https://manual.pvxplus.com/PXPLUS/Report%20Writer/Designing%20a%20Report/Defining%20the%20Data/Parameters.htm

After you have defined your parameter here it will appear in the data pane of the Report Designer, where you can include it in the report, or use it in filters, etc.

At run-time when you are generating the report, if you generate it using the CALL method with the runreport program, it will automatically display an interactive panel to enter a value for the parameter. If you want to enter the value programmatically, after you open the report you can use the 'SetParameter(parmName$,value$) method to set the value, where parmName$ is the name you gave the parameter and value$ is the value to be assigned for the report.
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.