Jump to content
Changes to the Jaspersoft community edition download ×

cameron_1

Members
  • Posts

    75
  • Joined

  • Last visited

Community Answers

  1. cameron_1's post in passing main parameter to sub-datasets with JasperStudio was marked as the answer   
    Parameters are attached to the dataset, if you expand the dataset itself, you'll find a section there for parameters, just like in your main report.

    You'll need to link the parameters together though, using the connection properties where you're actually using the dataset, eg, in a chart or a table. For example, in the table, you go to the dataset tab of the properties pane, and click on the parameters button to map the parameters between your main report and your sub dataset.

     

  2. cameron_1's post in Input Control JSP Standard draw() Function was marked as the answer   
    OK. So, no response from anyone who actually has this information on hand, so I worked through it myself and came up with the following JSP template to use as a base for any custom input control JSP.
    <jsp:include page="InputControlTemplates.jsp" /><ul id="inputControlsContainer" class="list inputControls ui-sortable"></ul></script><script type="text/javascript"> ;(function (jQuery, _, controlsViewModel) { controlsViewModel.draw = function (jsonStructure) { var drawControl = function (container, jsonControl) { if (jsonControl.visible) { var control = this.findControl({id:jsonControl.id}); control.makeResizable && control.makeResizable(); container.append(control.getElem()); } }; _.each(jsonStructure, _.bind(drawControl, this, jQuery("#inputControlsContainer"))); //********************************************* //******** CUSTOM CODE GOES HERE ************ //********************************************* }; }) ( //Dependencies jQuery, _, JRS.Controls.getController().getViewModel() //take viewmodel from globalnamespace );</script>[/code]So, for anyone who comes across this in the future looking for a place to start, here's a few gotchas and points I've come across so far - 
    Your JSP doesn't have to be used just for an input control! This JSP is included in your report at all times (it's not loaded in an iframe or anything like that), so you can modify things outside of the input controls as well. jQuery is included, but the $ namespace isn't used, so you need to use the prefix "jQuery" instead of "$", just replace the $ sign in any example code you come across with "jQuery" and it should mostly work. The input controls themselves don't have ID on their DOM objects. Their containing <div>s do have ID though, those ID's are the resource ID of the input control. Don't put extra input objects in the same <div> as the in-built ones, it seems to get confused and doesn't always know where to pick up the values from when passing them to the report. If you need to add in extra input objects, put them in seperate <div>s. You need to trigger the "change" event on the input objet jaspersoft creates if you modify it programatically, if you don't trigger this event jaspersoft doesn't passs the values that have changed or been entered to the report.
  3. cameron_1's post in iReport 5.2 cannot connect to Jasper Server Professional Repository - (400) Bad Request Error was marked as the answer   
    Ok, I found the solution. You need to enable the option 'Prevent "chunked" requests'. For some reason.... Not sure why that wouldn't be enabled by default if it's needed. Or why it isn't documented anywhere.

×
×
  • Create New...