RR Version 9 -- Pass In Parameters Using OCX without prompt
-
- Posts: 6
- Joined: Tue Oct 10, 2017 12:44 pm
RR Version 9 -- Pass In Parameters Using OCX without prompt
I am developing a Visual Basic application and want to pass in a parameter to an R & R report, .RRW file, using the OCX control embedded on the form. I don^t want to prompt the user nor do I want to create a parameter table. I have tried creating a calculated field as well as setting the ParametersString value = "variable_name = value" but I cannot get the report to receive the parameter and run the report. Can someone please give me a hand.
=> RE: RR Version 9 -- Pass In Parameters Using OCX without prompt
What do you need this parameter to do in the report?____Typically you would create a calculated field in the report with the expression RIPARAM("myparam")____and then in the control explicitly set____RRReport1.ParametersString = "myparam=What I want"____so that in the report the calculated field will automatically have the value "What I want" when the report is executed.____Kathleen__R&R Support______
-
- Posts: 6
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: RR Version 9 -- Pass In Parameters Using OCX without prompt
I need this parameter to select one record for the report. For example, I don^t want all employees, just the employee record I am looking at. Ex. EmployeeID = 101, In the report, I created a query to retrieve the employee record where the employeeID = variable..____When I create the calculated field, can I name it anything and set the expression = RIPARAM("empID") thereby setting ParametersString = "EmployeeID = empID" ?____Am I missing anything else?
===> RE: RR Version 9 -- Pass In Parameters Using OCX without prompt
>I need this parameter to select __>one record for the report. __>For example, I don^t want __>all employees, just the employee __>record I am looking at. __> Ex. EmployeeID = 101, __>In the report, I created __>a query to retrieve the __>employee record where the employeeID __>= variable.. __>__>When I create the calculated field, __>can I name it anything __>and set the expression = __>RIPARAM("empID") thereby setting ParametersString = __>"EmployeeID = empID" ? __>__>Am I missing anything else? ____If the calc expression is RIPARAM("empID") you can name this calc anything you want. Then ParametersString uses EmpID=101.____Then in the report^s filter you would add a condition where the employee id field from the database is equal to the riparam() calc field.____Kathleen__R&R Support__
-
- Posts: 6
- Joined: Tue Oct 10, 2017 12:44 pm
====> RE: RR Version 9 -- Pass In Parameters Using OCX without prompt
Still does not work. The lasterror message says "undefined job control variable: empId"____These are the steps I have taken...____1. create a calculated field:__ a: calculated field name = "employeeid"__ b: expression = RIPARAM("empId")____2. Under Database .. Query, I created a query where I set the employee_id = employeeid____... everything checks so far____3. Using the OCX, I set ParametersString = "empId = 101"__4. run the report using RunReport (2) .. ____The empId of 101 is not being passed into the report so therefore nothing prints.____What am I doing wrong???____
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
=====> RE: RR Version 9 -- Pass In Parameters Using OCX without prompt
In my code, I usually step through the debugger and see exactly what is being passed to R&R in various function calls. I use the .dll and call the C functions, which take a character expression which is easy to trace in the debugger. I don^t know how the OCX and VB work but I imagine something similiar is possible. Is it possible your ID number is a character in one place and numeric somewhere else?____Fred
-
- Posts: 6
- Joined: Tue Oct 10, 2017 12:44 pm
======> RE: RR Version 9 -- Pass In Parameters Using OCX without prompt
The param is character and so is the field type. I double checked it. Does the calculated field need to be placed on the report?? If so, I placed it there and...____Still does not work. The lasterror message says "undefined job control variable: empId"__These are the steps I have taken...____1. create a calculated field:__a: calculated field name = "employeeid"__b: expression = RIPARAM("empId")____2. Under Database .. Query, I created a query where I set the employee_id = employeeid____... everything checks so far____3. Using the OCX, I set ParametersString = "empId = 101"__4. run the report using RunReport (2) .. ____The empId of 101 is not being passed into the report so therefore nothing prints.____What am I doing wrong??? Did I leave anything out??____