{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

Prompt Syntax

With a prompt you can pass a value to a parameter field of your report. This can be done by adding it to the URL or by setting the prompt value directly to the Engine object when you're using the API of i-net Clear Reports. For each type of a parameter field there can be a certain syntax you should use.

  column type description example
boolean possible values are true or false. true
binary binary prompts can currently not be set via URL ="../../../../for-details-about-setting-a-binary-prompt-please-check-the-API-documentation"  
currency simply pass a string containing the number you want to pass 27.23
date a date is passed using the date(<year>, <month>, <date>) function Date(2005, 10, 12)
datetime a datetime is passed using the datetime(<year>, <month>, <date>, <hour>, <minute>, <second>) function DateTime(2005, 10, 12, 14, 35, 0)
number simply pass a string containing the number you want to pass 1.234
string simply pass the string you want hello world
time a time is passed using the time(<hour>, <minute>, <second>) function Time(14, 35, 0)

When you want to set the prompts via URL then you should also note that it is recommended to URL encode your prompt values. In the table below you will find some examples for encoding of characters.

character encoded character
Dollar "$" %24
Ampersand "&" %26
Plus "+" %2B
Comma "," %2C
Forward slash/Virgule "/" %2F
Colon ":" %3A
Semi-colon ";" %3B
Equals "=" %3D
Question mark "?" %3F
"At" symbol "@" %40

An example for an encoded value for the prompt value "Date(2005,10,12)" could then be "Date%282005%2C10%2C12%29".

When setting the prompt values via the API using com.inet.report.Engine.setPrompt(java.lang.String, int), com.inet.report.Engine.setPrompt(java.lang.String, java.lang.String) or com.inet.report.Engine.setPrompts(java.util.Vector) you should not URL encode the prompt values.

Setting a value for a binary prompt with the API of i-net Clear Reports

In contrast to setting a prompt value via URL setting them via the API allows you to set binary prompts also. Therefore you can not use the methods of the class Engine. You need to set the value to the underlaying parameter field directly. So you will have to get the parameter field from the Engine and then set the value to this field.

Example:

Engine e;
byte[] data;
...
//we assume that the prompt field with index zero is the binary one
PromptField myField=e.getFields().getPromptField(0);
 
//please note that the value for a binary field has to be a byte[] always
myField.setPromptValue(data);
i-net Clear Reports
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help - Prompt Syntax