Jump to content
We've recently updated our Privacy Statement, available here ×

Get input control or parameter when creating Derived Table in Domain


mana135

Recommended Posts

When trying to create a Domain through JasperServer, I'm attempting to create a Derived Table that will need to be filtered by at least one parameter that will need to be passed in. I can do this in Japsersoft Studio by creating a parameter that can be referenced in the SQL query used to generate a report, but it is unclear how I would achieve when creating a Domain. When I published the report to the server, the attribute I defined in the report was created as an Input Control. I see that you can create Input Controls in the server, but it's unclear how I would access any provided input in the derived table SQL. Simply put, I'm trying to created a Derived Table like,

SELECT s.sitename, c.customername FROM Sites s INNER JOIN Customers c on c.customerid = s.customerid WHERE s.customerid = {some_passed_in_parameter}[/code]

I see that you can access User and Server level attributes that you can define, but this would be something I would simply pass in from an outside application through Visualize.js. It's unclear if these attributes you can define are dynamic, meaning their values are set when an Ad-Hoc view is queried.

Lastly, before anyone says "just create what you need in a report inside the Studio", unfortunately I've had very little success creating the crosstabs and charts I want. I've had a lot more success generating these in an Ad-Hoc View, but I don't want to have to duplicate this for every site and customer in our database. One of the tables I'm using is billions of rows long so filtering anything after the SQL is executed is not going to be an option.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You cannot parameterize derived tables directly in JRS 6.3.0 or prior.   In some future version they hope to have the ability to reference parameters in derived tables.

Have you considered creating Ad Hoc Views from topics that are domain based?   Using Studio, you create a new jrxml report with queries against your domain, and these queries within Studio can be parameterized (via typical jrxml parameters).   And of course you define the fields.   Then publish this report to the JRS topics folder, then create your Ad Hoc View from this topic.   

 

 

 

 

Link to comment
Share on other sites

Sounds like you are already familiar with passing attributes into a domain, but if not, and you had a way of setting attributes dynamically you could pass them into a derived table:

http://community.jaspersoft.com/wiki/using-attributes-domains-derived-table

Attributes can be set via REST api... so theoretically some third party app could post new values into a user's profile dynamically.

 

 

Link to comment
Share on other sites

ghudson_1 Thank you for your help! I was finally able to figure out a proper patten here. When I created my report to upload earlier I did not populate any fields beforehand. Once I figured out how to do that, I was able to properly create an Ad Hoc view using the Topic and now can finally use VisualizeJS to embed a report using any type of parameter that I want. I will probably also use User attributes as well since the end-users of our application will be of a variety of types. Thanks again!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...