Quantcast
Viewing all articles
Browse latest Browse all 5661

JSP/WebViewer - set parameter values to display in Parameter dialog as suggest

Hello, Community,

 

i'm struggling with the parameter dialog in the CrystalReportViewer.

I hope, i'm posting this question in the right place...

 

I'm developing a JSP application to display Reports. Parameter values are read from a database, when the report is opened, set to the viewer and saved to the database, when the user changes them in the viewer. This works fine.

 

But as soon as i set the parameter values programmatically to the viewer, the Parameter dialog is not showing up any more, and the report is opened immediately with these parameters. Instead, i would need to set the parameter values as suggest values, so the user can see and change them in the dialog.

 

I tried several approaches to set the values in a way to get this behavior with no success (it's more like guessing and not knowing, what i do).

Is it maybe possible to get the values from the database and save them in the report document somehow?

 

Any help would be appreciated! Thanks.

 

Here is the code  where i set the parameter values to the fields:

 

List<ParameterInfo> results = queryBean.getReportParameters(reportName);

    if (results == null || results.isEmpty()){

        return;

    }

  

   String parameterName = "";

   ParameterField paramField  = null;

   Values newValues = null;

 

   // now map the parameter values to the parameter

   for (ParameterInfo parameterBean : results){

       

      // yet another value for the same parameter?

      if (!parameterBean.getParameterName().equals(parameterName)){

          newValues = new Values();

          parameterName = parameterBean.getParameterName();

        

          // get the next parameter field

         paramField = getParameterField(parameterName, paramFields);

         if (paramField != null){

            paramField.setCurrentValues(newValues);

         }

      }

      // set the parameter value from parameterBean to the value list

      if (paramField != null){

         addParameterValue(paramField.getType().value(), parameterBean, newValues);

      }

   }

 

   // set the fields with the new values to the viewer

   crViewer.setParameterFields(paramFields);


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>