archivestas Posted April 28, 2023 Share Posted April 28, 2023 JasperReports server 8.0.0Jaspersoft studio 6.20.0Connected the jQuery v3.5.0 libraries and https://github.com/vitmalina/w2ui/tree/w2ui-1.5.Created cvc.Completed the compilation build.jsIt works in Jaspersoft studio.I export it to the server, but it doesn't work here, the plug-in library w2ui is not added.The problem is adding the wrapper:wrap: { start: "(function(root){nnvar define = root.define;nn", end: "nn}(typeof __visualize__ != 'undefined' ? __visualize__ : (typeof __jrio__ != 'undefined' ? __jrio__ : window)));" }, If add this wrapper, it will not work in Jaspersoft studio and JasperReports Server.If the wrapper is not added, it will only work in Jaspersoft studio. build.js:({ baseUrl: '', optimize: 'none', paths: { 'jquery': 'jquery350min', 'w2': 'w2ui-1.5.min', 'custom': 'custom' }, optimizeCss: 'standard.keepLines', keepAmdefine: true, wrap: { start: "(function(root){nnvar define = root.define;nn", end: "nn}(typeof __visualize__ != 'undefined' ? __visualize__ : (typeof __jrio__ != 'undefined' ? __jrio__ : window)));" }, name: "custom", out: "custommin.js"})my module:define('custom', ['jquery', 'w2'], function($) { var counter = 1; return function (instanceData) { const series = instanceData.series[0]; const records = addRecid(series); const columns = createColumns(series); creatediv(instanceData, instanceData.id, 'main'); function creatediv(instanceData, elemntId, name) { const newDiv = document.createElement("div"); newDiv.id = name; newDiv.style = "width: 100%; height: 100%;"; window.document.getElementById(elemntId).appendChild(newDiv); } function createColumns(records) { const columns = []; for (var key in records[0]) { if (records[0].hasOwnProperty(key)) { columns.push({ field: key, text: key, size: '33%', sortable: true, searchable: true }); } } return columns; } function addRecid(records) { const newrecords = []; for (var i = 0; i < records.length; i++) { const record = records; record.recid = counter++; newrecords.push(record); } return newrecords; } $(function () { $('#main').w2grid({ name: 'grid', show: { toolbar: true, toolbarDelete: true }, columns: columns, records: records }); }); }}); Link to comment Share on other sites More sharing options...
Mehak Rajkumar Posted May 2, 2023 Share Posted May 2, 2023 Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times. Link to comment Share on other sites More sharing options...
Jivan Phadtare Posted May 3, 2023 Share Posted May 3, 2023 Hello,Please try to use latest studio 8.x.x version and give try adding wrapper and check if it works in Jaspersoft studio.Without wrapper added - What error you see in jasperserver.log file on JasperReports Server.Looking at error log might help us to narrow down this. Link to comment Share on other sites More sharing options...
archivestas Posted May 4, 2023 Author Share Posted May 4, 2023 There are no server-side errors in the log file. Errors only when trying to use the functions of the connected libraries. I am applying 2 projects with different libraries. Errors manifest for w2ui. There are no errors for Grid, but it does not work properly.Tested on versions of jaspersoft studio 6.20.0, 6.20.1, 6.20.3.Tested on jasperreports server versions 8.0.0, 8.1.1. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now