Trying to prompt for user input
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
Trying to prompt for user input
I want to prompt a user for the value of a specific field. The manual has confused me a bit, it says to add a ? but I am not exactly sure where that goes. Can someone help with this? No detail is too small, thanks!
=> RE: Trying to prompt for user input
If you are using a pre-Version 9 then prompting requires that you run your report via runtime., To activate prompting at runtime, you first in the Designer create a calculated field in your report using the expression:__RIPARAM("fieldname")____where fieldname would be a name of your choosing.____Then you would create a runtime control file and create a character field (if you are using a table) whose name is your chosen fieldname. If you are using a text control file then you would add a line to your file that starts with:__fieldname=____So if you want to prompt for a field called COMPANY, you would create a calculated field in the report whose expression is RIPARAM("COMPANY")__and in your control file you would enter, for a text file the line:__COMPANY=?Please enter a company__or for a control table the contents of the character field COMPANY would be:__?Please enter a company____Then when the report is run using runtime, a dialog box will appear with the prompt Please enter a company.__Whatever you enter within the text box will become the contents of the calc field in the report.____In Version 9, the new ParameteRR field type will allow you to prompt both in the Designer and within runtime without requiring any special runtime coding. All is done within the parameteRR field definition.____Kathleen__R&R Support
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: Trying to prompt for user input
Thanks Kathleen, I am using 8.1 right now. I read something about the control file but I had never used that before. Thanks for the clarification. I am trying to set up my report to prompt for the value of a field which will yield 1 record from my master table, to be used as part of my filter expression. I assume that the prompt occurs before the report is run so that it allows me to do that in a filter? ____Ideally I would have my app read the master table (Access table) and give the user a drop down list of choices so they don^t have to type one in, but unfortunately I don^t have the ability to read that file in order to then pass the selected result to R&R.____Thanks,
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: Trying to prompt for user input
Kathleen, after going through the manual again, I have a new question: can I use a runtime control file if I am using the viewer .dll instead of the viewer executable?____Thanks,
===> RE: Trying to prompt for user input
No the viewer DLL takes the place of the runtime control file.__You would use the SetUserParam function to set the RIPARAM() parameter value.____Kathleen__R&R Support
-
- Posts: 170
- Joined: Tue Oct 10, 2017 12:44 pm
====> RE: Trying to prompt for user input
I had to use getRuntimeRecord() in order for the user prompt to work. I stuck it in place of my chooseReport() function call. Seems to work fine. I originally was looking for a way to use setUserParam() with the ability to prompt the user for the field that I wanted to select interactively.