Report builder & passing parameter

arfina

New Member
i'm using report builder to create a report. And the question is :
How to add/display passing parameter from file .p to report builder.
Thanks for any help
:confused:
 

vdennis

Member
FYI, Report Builder is not supported in OE10. You will still be able to run reports, just not make any changes.

Other than that you can pass parameters and filters within the .p
Check out the "Progress Report Builder User's Guide for very detalled information, and the Progress Report Builder Deployment Guid. These are included with the electronic documents that come with Progress.


To pass the information you need 1 of two .p's
PRINTRB and PRINTRB2.

Sample I used code follows:
/*
Report Builder Template for Data Input
Running Report Engine from an application - PRINTRB INTERFACE.
Displaying a report as saved by Report Builder.
*/

RUN aderb\_printrb2(
"Win Reports\SUB FILE NAME\REPORT FILE.prl", /* RB-REPORT-LIBRARY */
"", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"", /* RB-INCLUDE-RECORDS */
"", /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
0, /* RB-NUMBER-COPIES - Zero */
0, /* RB-BEGIN-PAGE - zero */
0, /* RB-END-PAGE - zero */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
"", /* RB-OTHER-PARAMETERS */
""). /* RB-Statue-Out-File */

These values can be hard coded in the .p, or as I ended up doing allowing the end user to make changers.
-Dennis-
 

arfina

New Member
Thanks for reply vddenis

now i have new problem :

I want to be able to display a value where the value is inputed
from screen (.p)

but i dont have any idea.

Any help or suggesstions write this would be gratefully received.

Thanks.
 

vdennis

Member
I am not sure of what you want, but I think this is it. You want to pass a parameter from the .p to ReportBuilder and then have that value displayed on the report? If so there is a function in the calculated values that will allow you to do this. It is RUNTIME-PARAMETER.

Create a new calculated field, call it ATest
Under functions select RUNTIME-PARAMETER
For the value you could use. RUNTIME_PARAMETER("ATest")

Place Atest on the Report Header . (It really can go anywhere you wish to display it.)

Now the code would read: (Note Other Parameters)
RUN aderb\_printrb2(
"Win Reports\SUB FILE NAME\REPORT FILE.prl", /* RB-REPORT-LIBRARY */
"", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"", /* RB-INCLUDE-RECORDS */
"", /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
0, /* RB-NUMBER-COPIES - Zero */
0, /* RB-BEGIN-PAGE - zero */
0, /* RB-END-PAGE - zero */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
ATest, /* RB-OTHER-PARAMETERS */
""). /* RB-Statue-Out-File */

ATest from .p is passed to report builder. If you did not have a value for RB-OTHER-PARAMETERS, the report will prompt you for a value.
And you can have more then one RunTime-Parameter. But passing values via RB-OTHER-PARAMETERS is very tricky as a CRLF is required between the parameters. So your ATest would be a single string containing something like ATest = Avalue + CRLF + BValue, with 2 RunTimes in the report; Avalue and BValue.

You should be able to go on line and get more detailed information of the KB with examples.

I would suggest looking into Crystal Reports Developer XI for several reasons.
1. If you have full access to the db, it offers much more.
2. As of OpenEdge, ReportBuilder no longer comes with it. You can still use the runtime, but you will not be able to create or edit any reports.
3. If you are an inhouse operation, CRXI Developer gives you unlimited run time lic's.
4. The OCX for CRXI will allow you to view a report/print a report with better performance that RB.
5. The Crystal Syntax for formulas looks like Progress, or you can use a Basic Syntax that looks like VB.

You can download a free trial version of Crystal Reports at the BusinessObjects website. You would want the developers version. It does require you setting up an ODBC connection.

-Dennis-
 

arfina

New Member
hi dennnis,

i tried that but it doesn't work as expected.
if i write like this, i get an error.


def var sNum as char format "x(6)" label "Number".
".
{lib/rpt-opt.i
&const1="skip(1)"
&opt10=sNum &type17=ch &at17="colon 33"
&const18="skip(1)"
}

procedure do-process:
def input parameter p-text as char.
do on error undo, return:
run validate-destination.
end.

runtime_parameter("sAPPNum").
run aderb\_printrb2(
"C:\syteline\SL60\mods\arfina\rpt-appv.prl",
"appv",
"-db nin00",
"O",

"",
"D",
"",
"",
"",
0,
0,
0,
no,
"Number test",
yes,
yes,
no,
"",
"sNum",
).
end procedure.


could you tell me how to define runtime_parameter, or how use that by detail example. Thanks.
 

Chris Kelleher

Administrator
Staff member
Here's a followup message I am posting for Dennis which was emailed to me:

What error are you getting?

Also, PRNTRB2 requires 20 parameters, PRINTRB only 19, so you may need to change that part. Also, you may not need to re-connect to the db if that information is stored in the Report itself. It is useful when you have to run a report on a 'copy' db on a different server, as in a dummy database.

The Runtime-Parameter is set within the report, not in the code. You would have to be able to start ReportBuilder and edit the report to do this. The enclosed MSWord.doc is a screen shot of what that should look like. If you cannot edit the report, you are out of luck here.

The enclosed file is a PDF of the Progress Report Builder Deployment Guide. It is on your electronic documentation disk. In as much as you are running RB, I am assuming you are running a legal version and should have this somewhere in your system anyway. This is the latest from PSDN. If you are not a member, join. I have found it very valuable.

If you are planning to upgrade to OE10, remember that while you can still run RB you will not be able to change or edit any of the reports. To get around this problem we are setting up a PC to hold the report library files under version 9.1d9 until all of our reports have been converted to Crystal Reports. And if you are planning to upgrade, dump RB and switch to Crystal Reports XI now. There is support from progress for the interface and some very good examples. Also, depending where you are, Business Objects/Crystal Reports have a very large user group base. You can find out more about that at www.businessobjects.com .

A very important note:

There is an option "NO-WAIT-STATE" that could cause real trouble. This option, when set to YES, tells RB to run in the background. This will allow you to move on in your program. The problem is when you have a report that has as a filter. "PrintRecord = yes".

Then after the report is run in your program you say:


Code:
FOR EACH RECORD WHERER PrintRecord = yes.
		ASSIGN PrintRecord = NO.
END.

What will happen if the report is running in the background is that Progress will 'run ahead' of the report thus dropping records you wish to see. EVEN IF YOU DID A SCREEN SHOT FIRST. So normally I have that set to NO.

Where are you located?

Dennis Voegler
System Manager

2820 Dorr Avenue Suite 230
Fairfax, Virginia 22031
703.204.9000
703.204.1557 (Fax)
 

Attachments

  • Runtiime Parameater.doc
    103 KB · Views: 47
  • Report Builder Deployment.pdf
    815.3 KB · Views: 53
Top