Jump to content
Changes to the Jaspersoft community edition download ×

Sakura Hana

Members
  • Posts

    38
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by Sakura Hana

  1. Hi,I would like to lean about visualize.js a bit more deeper.I just got one thing to ask for more comprehensive.Can I reuse report instance that already created?For example: visualize( { auth:{ name: "superuser", password: "superuser" } }, function(v){ var report = v.report({ resource: "old uri", container: "old container", error: function(err){ alert(err.message); } }); $("#select_dropdownList").change(function(){ report.resource = "new uri...."; report.container = "new container id"; report.run(); }); });[/code]Is it possible to do that?Thanks
  2. Dear forum!! I just got some errors after running my code under tomcat service. Please help.... Two thing you should notice is that: Use relative path, and assign it as argument to JasperCompileManager.compileReport("report/sample.jrxml"), it worked with window applicaiton.However, I would like to embed it with applet, so I can run it under tomcat service. After do this kind of thing, error message occur like this: net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: reportssample.jrxml (The system cannot find the path specified) [/code]
  3. Probably, you can follow these steps here: Use java code for define the length of display text;After create java code, you can convert it to jar file;Import to iReport Designer; andFinally use it as expression in "When Print Expression".Hope it help.
  4. Hello Everyone!! I would like to solve problem whether someone can do it. Please check the image bellow: Note: use only tools, not code. Thank you before hands!!
  5. As I googled for a period of time, I have found some solution related to my question above. My purpose here is not for reputation or anything else, but just wanna tell someone who get the same issue as I did. My solution is here: 1/ Requirement Jar Files: activation-1.1.jaraxis-1.3.jaractivation-1.1.jar axis-1.3.jarcommons-codec-1.5.jarcommons-collections-3.2.jarcommons-digester-1.7.jarcommons-discovery-0.4.jarcommons-logging-1.1.3.jarcommons-logging-1.1.3-javadoc.jarcommons-logging-1.1.3-sources.jarcommons-logging-adapters-1.1.3.jarcommons-logging-api-1.1.3.jarjasperreports-5.2.0.jarjasperserver-common-ws-5.2.0.jarjasperserver-ireport-plugin-2.0.1.jarjaxrpc.jarmail-1.4.jarsaaj.jarwsdl4j-1.5.1.jar2/ Coding: /** To change this template, choose Tools | Templates* and open the template in the editor.*/package jaspersoft.src.jasperprint;import net.sf.jasperreports.engine.JasperPrint;import com.jaspersoft.jasperserver.irplugin.JServer;import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.*;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.logging.Level;import java.util.logging.Logger;import javax.print.PrintService;import javax.print.PrintServiceLookup;import net.sf.jasperreports.engine.JRException;import net.sf.jasperreports.engine.JRExporter;import net.sf.jasperreports.engine.JRExporterParameter;import net.sf.jasperreports.engine.export.JRPrintServiceExporter;import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;/**** @author Administrator*/public class JasperPrintTest { private static JServer server = null; public JasperPrintTest(String webServiceUrl, String username, String password){ server = new JServer(); server.setUsername(username); server.setPassword(password); server.setUrl(webServiceUrl); } public List list(String uri) throws Exception{ ResourceDescriptor rd = new ResourceDescriptor(); rd.setWsType(ResourceDescriptor.TYPE_FOLDER); rd.setUriString(uri); return server.getWSClient().list(rd); } public ResourceDescriptor get(String uri) throws Exception{ return get(uri, null); } public ResourceDescriptor get(String uri, List arg) throws Exception{ ResourceDescriptor rd = new ResourceDescriptor(); rd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT); rd.setUriString(uri); return server.getWSClient().get(rd, null,arg); } public JasperPrint runReports(String reportUnit, Map params) throws Exception{ ResourceDescriptor rd = new ResourceDescriptor(); rd.setWsType(ResourceDescriptor.TYPE_REPORTUNIT); rd.setUriString(reportUnit); return server.getWSClient().runReport(rd, params); } /** * @param args the command line arguments */ public static void main(String[] args) throws Exception { // TODO code application logic here String webServiceUrl="http://localhost:8080/jasperserver-pro/services/repository"; String username= "jasperadmin"; String password = "jasperadmin"; String printer = "Foxit Reader PDF Printer"; String reporturi = "/reports/samples/AllAccounts"; //reporturi = "/reports/samples/Supreports"; JasperPrintTest object = new JasperPrintTest(webServiceUrl,username,password); JasperPrint jasperPrint = new JasperPrint(); Map parameterMap = new HashMap(); try { jasperPrint = object.runReports(reporturi, parameterMap); } catch (Exception ex) { Logger.getLogger(ClassForm.class.getName()).log(Level.SEVERE, null, ex); } PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null); PrintService printService = null; for(PrintService ps : printServices){ if(ps.getName().equals(printer)){ printService = ps; break; } } if(printService !=null) { JRExporter jrExporter = new JRPrintServiceExporter(); jrExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); jrExporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, printService); jrExporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printService.getAttributes()); jrExporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE); jrExporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE); try { jrExporter.exportReport(); } catch (JRException ex) { Logger.getLogger(ClassForm.class.getName()).log(Level.SEVERE, null, ex); } } else { System.out.println("Printer is not defined"); } }}3/Result: Note: but everything is still not dynamic because it seem cannot use with input controls (single select, multi-select, etc). If anyone can expand, please help add more.
  6. can you share your code regarding to get only one report from JasperReports Server?
  7. My purpose is to catch report from jasperserver and print it out. If I can run my own code, I will create my dependence application for printing report form jasperserver.
  8. @hozawa, actually, If I can run my own code, I will create my dependence application for printing report form jasperserver. And regarding to my code, I got these error message: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xerces/parsers/AbstractDOMParser at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.(WSClient.java:73) at com.src.report.PrintService.runReports(PrintService.java:37) at com.src.report.PrintService.main(PrintService.java:51) Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.AbstractDOMParser at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 3 more
  9. @fcerbell, I already checked in {ireport}/demo/sample directory. I notice one sample, {ireport}/demo/sample/printservice. It can be helpful, but it is print report from local file not from Jasperserver. By the way, regarding to my code, I got error message like this: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xerces/parsers/AbstractDOMParser at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.(WSClient.java:73) at com.src.report.PrintService.runReports(PrintService.java:37) at com.src.report.PrintService.main(PrintService.java:51) Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.AbstractDOMParser at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 3 more Any ideas?
  10. Hi everyone!!! I would like ask your help for some solutions. I want to know how can I print report from jasperserver repository. I spent time googling for a period of time, but still cannot get it solve. I got this source, but it does not work. Can someone fix it? package com.src.report;import java.util.HashMap;import java.util.List;import java.util.Locale;import java.util.Map;import net.sf.jasperreports.engine.JasperPrint;import net.sf.jasperreports.view.JasperViewer;import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.ResourceDescriptor;import com.jaspersoft.jasperserver.irplugin.JServer;import com.jaspersoft.jasperserver.irplugin.wsclient.WSClient;public class PrintService { private static JServer server = null; public static void ConnectionString(String webServiceUrl, String username, String password){ server = new JServer(); server.setUsername(username); server.setPassword(password); server.setUrl(webServiceUrl); } public static void runReports(String webServiceUrl, String username, String password) throws Exception{ ConnectionString(webServiceUrl, username, password); WSClient client = new WSClient(server); ResourceDescriptor resourceDescriptor = new ResourceDescriptor(); resourceDescriptor.setUriString ("/reports/samples/EmployeeAccounts"); Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("MY_PARAMETER_NAME", "myparametervalue"); JasperPrint printer = client.runReport(resourceDescriptor, parameterMap); JasperViewer.viewReport(printer, false, Locale.ENGLISH); } public static void main(String[] args) throws Exception { String webServiceUrl = "http://localhost:8080/jasperserver-pro/services/repository"; String username = "jasperadmin"; String password = "jasperadmin"; runReports(webServiceUrl, username, password); }}[/code]Any ideas? please help me.
  11. Normally, we can use input controls for filter data in report but those input controls are only working with JDBC datasource. In my case, report using Custom Datasource as the datasource. For this custom datasource, I also need to create input control for data in report as well. Any idear, please help?
  12. You said, "I created my javabean datasource and it works with both iReport and Jasper Server." Can you share some on how to use process those tasks? Thanks in advance
  13. Dear valued members!!! I got stuck with on how to filter custom datasource in JasperReports Server. Actually, I want to do it the same thing as we use query. But this time it is not query. It is custom datasource that get data from source code. How can I filter it? Any idear really apreciate.
  14. Dear all, I got some problem with php-sample. I want to add users, but there were something went wrong. Please help me!! Here is code that I used: <!DOCTYPE html><?php require_once "vendor/autoload.php"; require_once "autoload.dist.php"; require_once "client/JasperClient.php"; require_once "client/User.php";?><?php $client = new JasperJasperClient( "localhost", // Hostname 8080, // Port "jasperadmin", // Username "jasperadmin", // Password "/jasperserver-pro", // Base URL "organization_1" ); // Organization (pro only) $newUser = new JasperUser("BI_User", // username "superSTRENGTHpassw0rd", // password "clever@email.com", // email "Business Intelligence User", // description "organization_1", // parent organization "true" // enabled ); $role = new JasperRole("ROLE_USER", NULL, "false"); $newUser->addRole($role); try { $client->putUsers($newUser); } catch (Exception $e) { printf("Could not add new user: %s", $e->getMessage()); } ?>[/code] And here is the error message: Could not add new user: Unexpected HTTP code returned: 400 Body of response: Apache Tomcat/6.0.26 - Error report HTTP Status 400 - type Status reportmessage description The request sent by the client was syntactically incorrect ().Apache Tomcat/6.0.26[/code]
  15. I solved my own problems. Here is the solution: 1. Go to {js_pro-path}webappsjasperserver-proWEB-INF 2. Find the file name: applicationContext-multiTenancy.xml 3. In the bean tag that has id="tenantDefaultUsers" and class="java.util.ArrayList", after erase something it look like this: <bean id="tenantDefaultUsers" class="java.util.ArrayList"> <constructor-arg> <list></list> </constructor-arg> </bean> 4. Restart Tomcat Server. Enjoy it.
  16. Problem:"Dear everyone!! I got some problems with JasperReport Server. I need to create many organizations. Thus I don't need to get jasperadmin and joeuser come with those organizations. I also don't want to disable one by one. The question is how can I disable jasperadmin and joeuser after create organization? Please help me!! I got stuck and need to hurry solve. Any solutions, I really appreciated.", my own problems. Solution:To solve this problem, please follow the instruction as below: -> Go to {js_pro-path}webappsjasperserver-proWEB-INF -> Find the file name: applicationContext-multiTenancy.xml -> In the bean tag that has id="tenantDefaultUsers" and class="java.util.ArrayList", after erase something it look like this: <bean id="tenantDefaultUsers" class="java.util.ArrayList"> <constructor-arg> <list></list> </constructor-arg> </bean> -> Restart Tomcat Server. Let's try!!! Snapshot:-> Orginal File content: -> After edit: -> Result:
  17. Dear everyone!! I got some problems with JasperReport Server. I need to create many organizations. Thus I don't need to get jasperadmin and joeuser come with those organizations. I also don't want to disable one by one. The question is how can I disable jasperadmin and joeuser after create organization? Please help me!! I got stuck and need to hurry solve. Any solutions, I really appreciated.
  18. Just a question!! Why it looks exactly the same as bar chart? I mean it should display block by block in on bar.
  19. Here is the solution how to display and accepting date format in Input Control on the server. To do this: 1. please go to jasperserver_config.properties. Location: {js-path}apache-tomcatwebappsjasperserver-proWEB-INFbundles 2. Edit format as you want. This is the example show you where you should change. Case 1: Case 2:
  20. Dear everyone!!! I am new to Jaspersoft. I was trying create bean datasource in iReport, but I get message like this: This is my java code: package com.source.myclass;public class barchart { private String Name; private double Number; public barchart(){}; public void setName(String n){this.Name=n;} public void setNumber(double n){this.Number=n;} public String getName(){return this.Name;} public double getNumber(){return this.Number;}}package com.source.main;import java.util.Collection;import java.util.HashSet;import java.util.Vector;import org.rosuda.JRI.REXP;import org.rosuda.JRI.Rengine;import com.source.myclass.barchart;public class RJAVA4 { public RJAVA4(){}; public static Collection<barchart> getBarchartData() throws Exception{ Vector<barchart> bars = new Vector<barchart>(); try{ Rengine engine = new Rengine(new String[]{"--no-save"}, false, null); REXP NameR = engine.eval("substring('ABCDEFGHIJ',1:10,1:10)"); REXP NumberR = engine.eval("rnorm(10)+100"); engine.end(); String[] STRING_NAME = NameR.asStringArray(); double[] NUMBER = NumberR.asDoubleArray(); barchart bar = null; for(int i=0;i<10;i++){ bar = new barchart(); bar.setName(STRING_NAME[i]); bar.setNumber(NUMBER[i]); bars.add(bar); } } catch(Exception e){ e.printStackTrace(); } return bars; } public static void main(String[] args) throws Exception { Collection<barchart> myCollection = new HashSet<barchart>(); myCollection = getBarchartData(); for(barchart element: myCollection){ System.out.println(element.getName() + "|||"+element.getNumber()); } }}[/code]Any helps? really appreciate.
  21. Can you give me some clues related to JasperPrintManager as you mention above. Something like sample code.
  22. Try this code: PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();printRequestAttributeSet.add(new Copies(1));[/code]
  23. I think if you use this code it may work. JasperPrintManager.printReport(jasperPrint,true);[/code]
×
×
  • Create New...