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

arianhojat

Members
  • Posts

    27
  • 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 arianhojat

  1. Trying to figure out how to customize JasperServer. Right now I have an Ireports user create a Jasper Report. So he'll tell me stuff like the report depends on parameter of for example: EmpIoyee ID, (Integer) His Managers, Array of Ints (Array of Ints) His Salary (Float)... I created a php-based app that you setup whatever you want to send over the data and their datatypes to java to run the report. like a html dropdown populated from a mysql server filled with employees, another ajax field which pops up his managers to send over for that employee, and maybe a hidden salary field which got populated based on first field. i just send this over to a jsp page which runs the report based on those parameters and the output type the user wants. Kinda messy but it works... But basically I have to do alot of work setting up each report. I'd like to get it so all this customization can be done in jasperserver. Last year i didnt find the examples to for example make a custom dynamic drop-down like the one filled with employees from a mysql db on our network.
  2. bump anyone? sidenote: these messageboards are SO frustrating for such a widely used product and noobs. my doGet in my servlet at the end has this but doesnt work: JRViewer jrv = new JRViewer(jasperPrint); JFrame aFrame = new JFrame("Report Viewer"); aFrame.getContentPane().add(jrv); jrv.setVisible(true); aFrame.getContentPane().add(jrv); aFrame.getContentPane().setPreferredSize(new Dimension(670, 800)); aFrame.getContentPane().setVisible(true); is it possible to get jasperreport in a servlet?
  3. Someone had a similar question but someone redirected him to do it in an applet. I send custom url parameters to be put into a HashMap to send to the jasper report. in a servlet would i just redirect to /servlets/JRServlet?urlParam1=xxx&urlParam2=xxx&urlParam3[key1]=xxx Also any code to setup a JRViewer in a servlet is appreciated, hopefully as easy as supplying jasperPrint object to some sort of JRViewerExporter? object like how PDF and HTML reports are made. Post edited by: arianhojat, at: 2007/10/26 18:00
  4. I ended up just saying to myself i could all the param stuff I want easily in php. and send params of html form to java which will output the report. If this is alright, i can send you general code to do this later. It basically is a very ghetto version of JasperServer but serves my needs if you know how to make javascript validation rules, php validation rules, and make things like date popups and dynamic select drop downs.
  5. Right now i only have experience with ireports, but if you set a paramter as a ireport prompt, do these all show up in jasperserver also? I saw some of the examples in JasperServer where all the inputs are in 1 popup and thought maybe they are all related to parameters, or are these defined separatedly in jasperServer.
  6. I would like a drop down select box be used, but unsure what examples I can find in jasperreports-project. Basically i want to have all countries in a drop down; countries chosen from my database. I assume this can also apply to checkboxes too, like a bunch of checkboxes in ireports to choose multiple countries; (again countries chosen from same database table). Once user submits the parameter data then u can use those values in report query... WHERE $X{IN, 'countries', javaVectorParameter } Kinda shaky on trying to get this to work. Post edited by: arianhojat, at: 2007/10/11 13:59
  7. got a calculation to work: new Float( $V{SumInvAmt}.floatValue()/( $V{SumInvAmt}.floatValue()-$V{SumWriteUp}.floatValue() ) )
  8. At the bottom of a report group i calculate many sums of amounts. and right after those sum fields, i want to do a calculation based on those variables. I tried setting up a variable that does a calculation based on those sum variables. Variable Class Type: java.lang.Float Calculation Type: None( since doing my own custom calculation?) Reset Type: Group Reset Group: nameOfGroup Variable Expression: new Float( $V{SumInvAmt}/( $V{SumInvAmt}-$V{SumWriteUp} ) ) Default Value: new Float(0)
  9. Sorry accidentally hit post new topic vs reply.... , i am guessing ireport user manual chapter 16. drag and drop the crosstab in ireport: dataset/subdataset would be the report query with userID as parameter, the row group it will ask for is i think project ID or project Name, column group is date, and choose Year or Month. and should make the dates ('dynamic' columns) along top. Post edited by: arianhojat, at: 2007/10/03 21:03
  10. I was wondering if there was a way to preview the query ireports runs. like maybe somehow make it print to the log? I have a query that should show some results but it doesnt so not sure why. Maybe parameters arent being correctly prepared.
  11. Trying something like below: HAVING Clients.Fname LIKE '%$P{FirstName}%' i assume since $P{FirstName} in prepared statement make it something like '%'Joe'%' anyway to get passed this other than passing the %% in the parameter?
  12. i have 4 variables that if they are set like so in Query via parameters: HAVING (Clients.Fname=$P{FirstName}) AND (Clients.Lname=$P{LastName}) AND (WIP.Wipdate Between $P{StartDate} And $P{EndDate}) but would like it to be smart and only build certain parts of query if parameter is set to something other than null. so if $P{FirstName} and $P{LastName} are set then the HAVING Clause will only have... HAVING (Clients.Fname=$P{FirstName}) AND (Clients.Lname=$P{LastName}) if just $P{StartDate} and $P{EndDate} then HAVING (WIP.Wipdate Between $P{StartDate} And $P{EndDate}) if none, then no HAVING clause at all. Any good ways to approach this?
  13. maybe submit a simple test for jasper peeps to see: like 'Create' statements for simple tables, then create a simple report with subreport doing basically same thing you want to try. and post it here. If their product is failing you, they should know bugs.
  14. i think i will set a param in main jrxml file for each subreport. The params default value will be for example sub1.jasper or the full absolute filepath, both would work (prefer relative in case move the file somewhere). If run from iReports this default is the value it will use. my tomcat app can supply in parameters to the report a absolute filepath which is based on relative location. So like the report files are all under tomcat/webapps/jasper/reports. Ireport user has access and can open a report from reports. The tomcat app, which is in /jasper, can find the file like so: parameters.put( "sub1", application.getRealPath("/reports/sub1.jasper") ); Hence both can find file appropriately theoretically (didnt try yet, just writing down idea :) ). Not sure why the boards are so dead here for vastly used product. Frustrating.
  15. Ive seen in message boards a couple times that someone will say in your java apps to pass the subreport location in a parameter with parameters.put( 'sub1', application.getPath('/reports/myreport.jasper')) so the full path to the subrepotr file is passeed as a paremter to get the subreport name and therefore found, or somehow just in the jrxml use the path relatively so both find it?. But i am unsure how to get it to work so if user is viewing NOT from my java app but from Ireports. Hence 1st method wont work. I need to make it work with both.
  16. Did you end up figuring this out? I have similar issue with paths to subreports not being found unless i do absolute url path, but this seems not good for long term. I saw you can get servercontext/full path to item and pass as parameter to main jrxml file, but then the users who use just ireports instead of web app i think might have a problem as they are looking at jrxml files and not java app which would feed necessary subreport urls.
  17. update: i learned that all references including subreports/images/fonts should be referenced relative to their location within the classpath, so they can work no matter how deployed... Now what this means i am unsure, since the 'classpath' to me is system dependant, and my jasper reports could move from different boxes, iod rather just it be smart and do relative to current dir report is in ;). thinking about it more, Basically: Want it so subreport references will work relatively if using ireports or tomcat web app. Post edited by: arianhojat, at: 2007/09/24 20:39
  18. Im a newbie but maybe didnt reference the parameter of the subreport in the main jrxml file? <parameter name="ProductsSubreport" class="net.sf.jasperreports.engine.JasperReport"> </parameter> btw, im curious. where did you get function hasSubreports()? Thats nifty, simple xml parsing or part of API i didnt see in javadoc?
  19. hmmm it seems like i have to use whole path. for example, this works: <subreportExpression class="java.lang.String"><![CDATA["C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/webapp/reports/sub1.jasper"]]></subreportExpression> hmmm should i change all my references to full file paths? or pass in a parameter to use in the report like so: parameters.put("sub1FilePath", application.getRealPath("/reports/sub1.jasper")); but then ireports wont know what to do. So basically could I setup something like this in jrxml file: if(isset($P{sub1FilePath})) <subreportExpression class="java.lang.String"><![CDATA["$P{sub1FilePath}"]]></subreportExpression> else <subreportExpression class="java.lang.String"><![CDATA["sub1.jasper"]]></subreportExpression> Post edited by: arianhojat, at: 2007/09/24 17:27
  20. Hello all, I am getting an error when trying to display my reports online (oddly going through ireports to see the whole report seems to be no problem though): net.sf.jasperreports.engine.JRException: Could not load object from location : sub1.jasper If I take my subreports out of the main jrxml file, the main report shows up on my jsp page. I was wondering if maybe I was doing something wrong in the way i reference the file? Here is a subreport reference in main jrxml file: <subreport isUsingCache="true"> <reportElement x="23" y="32" width="504" height="31" key="subreport-1" isRemoveLineWhenBlank="true"/> <subreportParameter name="empnumber"> <subreportParameterExpression><![CDATA[$F{empnumber}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression class="java.lang.String"><![CDATA["sub1.jasper"]]></subreportExpression> </subreport> Post edited by: arianhojat, at: 2007/09/24 16:37
  21. anyway to compile dependant subreports by just supplying main jrxml file? i was thinking this is automatic, based on main jrxml you supply to jasperDesign? but i guess not as it compiled main one, but is asking for the others, and i dont see their .jasper files.
  22. look for in source forge downloads related to jasperreports project... jasperreports-2.0.1-project.zip... It includes a demo/samples/webapp folder to help people get started on embedding a jrxml file. But JasperServer seems to store the jrxml file in its repository... where this is, i dunno, i assume database. I think it 'should' be easy as everywhere i look up JasperServer it proclaims it allows 'can easily be embedded into any Java or non-Java application'. I have found this to be very difficult to google info on web on how to do this specifically with JS (although embedding a standard .jrxml/.jasper file seems to be easy based on that example). i have bought a few documents but related to jasper reports, and not jasper server. If you want, you may want to check out JasperServer Ultimate Guide, as my company didnt buy that one.
  23. close but no cigar, when goto http://apacheServer/curlLogin.php, doesnt login, , shows me the login screen at that url and when enter username/password there, says 'The requested URL /j_acegi_security_check was not found on this server.' Script so far below: $url = 'http://ourIntranetServer:8080/jasperserver/flow.html?_flowId=viewReportFlow&curlnk=2&_eventId_selectReport=&reportUnit=%2Freports%2Fsamples%2FEmployees&currentPage='; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// Follow any Location headers curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// dont echo output $cookie = "jasperCookie.txt"; curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie); $postfields = array(); $postfields['j_username'] = urlencode('jasperadmin'); $postfields['j_password'] = urlencode('thepassword'); $postfields['btnsubmit'] = urlencode('Login'); $postfields['userLocale'] = urlencode('en_US'); $postfields['userTimezone'] = urlencode('GMT-05%3A00'); curl_setopt($ch, CURLOPT_POST, 1);// Alert cURL to the fact that we're doing a POST, and pass the associative array for POSTing. curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $output = curl_exec($ch); curl_close($ch); print $output;
  24. k I figured one aspect: how to get to a report with just url (have to enter username and password be4hand though) and do parameters in url. here is a url: http://OurIntranetServer:8080/jasperserver/flow.html?_flowId=viewReportFlow&curlnk=2&_eventId_selectReport=&reportUnit=%2Freports%2Fsamples%2FEmployees&currentPage=&putAnyExtraParamsHere= _flowId=viewReportFlow : means view the report curlnk=2 : means highlight the 2nd link in menu which is 'View' _eventId_selectReport= : i dont think is needed if just viewing report. not sure what it does. as reportUnit param gets u to the correct report. reportUnit=/path/to/report : can figure out by going to repository decorate=no : i just mention this cause sometimes in my POST headers it supplies this argument, but if u supply it via logging in, it makes menu and other things disapear so you just have the report, But in SaleByMonth report, it seems to need some extra javascript (for calendar popup in the Options popup for example) that isnt supplied when extra stuff is gone. So I dont include this option currently. At the end of the url, i put a var called putAnyExtraParamsHere presenting any options/params to pass in. You can figure out by going looking at POST headers for example with LiveHttpHeaders in Firefox when posting parameter filter search in JasperServer and add those parameters to url. If anyone knows how to make this work without user entering username and password be4hand? I am going to try cURL POST with username/password params in a POST in a php script simply to see if this can work. Will keep updated. Post edited by: arianhojat, at: 2007/09/20 15:57 Post edited by: arianhojat, at: 2007/09/20 16:09
  25. I was going to embed a report in an iframe, but wasnt sure what url to go straight to a report once you log in, and also how to pass in parameters through the url. Something kinda like: url="/jasperserver/reports/SalesbyMonth?TextInput=999&ListInput=3&DateInput=&QueryInput=&_eventId=setInputValues&decorate=no" Also any help on how I can pass in a username/password automatically so JS doesn't need to ask user to log into JS in the iframe?
×
×
  • Create New...