Home
Integration How To Supply Custom Parameters
Most integrations require some form of user input to alter runtime processing of a query.

This short document explains and demonstrates a popular example. This example shows you how to create a unix jsp page or aspx page that accepts user input for nextanalytics to modify the nextanalytics runtime processing.

After this step is complete, you, the customer, can choose from a variety of open source techniques to display or store the results (this is the subject of a different entry).

User Interface

Let’s start by specifying a page that shows in a browser that has the following form. This will allow us to gather the user preferences of how they want a comparison made and which type of calculation to make.

Image

When they click the Submit button, the user’s choices is supplied to the next browser page.

The next snippet is code that’s embedded in the second browser page. It extracts the user’s preferences and modifies the query on the fly and submits it. First, it uses traditional java code to get the values:

Image

Then it incorporates it into a three line nextanalytics script:

Image

These three lines are submitted to the nextanalytics engine one at at time and nextanalytics processes each one in turn. The first line loads the data, the second line performs a FilterByValue command, and the third line assigns a self-explanatory title to the finished result for the end-user to see what they chose.

Supply Custom Parameters to a SQL Command Before Execution

Many people might have wanted to submit a SQL command instead of loading a CSV formatted file (as shown above. Here is the code snippet again, this time adding the data as a SQL Command:

Image

Like the first example, it extracts some values that were entered by the user.

But then it differs. It uses some of the user supplied values to define a SQL command "on-the-fly".  What we mean by that it is that it supplies a user id and password and a value to use in a where clause.

Being able to modify query results is a very common requirement in many integrations.

Displaying the results

nextanalytics offers several ways for the programmer to show the results to the end user. Explaining the different choices are out of the scope of this document. But, to give you something to think about, here is a list of things you might want to do:

  • Save the results to an XML file, with or without a XSL file. This one is our favorite because it lets you pretty well do anything you want.
  • Save the results to a CSV file or custom XML suitable to an application you already interface with or own.
  • Save the results to HTML table, Charting or Dashboard packages, or load it into controls such as aspx or one of the popular commercial packages.
  • Save the results to a database table, thus allowing BI and Microsoft Office tools to read it.
  • Write your part as a Web Service, and supply the results to a Web Service caller perhaps as CSV or XML strings.
  • These can all done by using the Free Open Source that we provide as well as submissions to our forums.

If you search your download, you’ll find plenty of code to do this that you can modify.

We also recommend you search our web site, particularly the forums (search the words shown above).   You will find various explanations and examples on how to do all of the foregoing.

 
< Prev   Next >