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

Ankur Gupta

Members
  • Posts

    343
  • 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 Ankur Gupta

  1. Hi, Please add some screen shot for better perception. There could be two possibilities when the subreport does not showup, 1. There is no data in the subreport and so it is not generated and hence not shown when the report runs. 2. Other possibility is that the correct path of the subreport is not set, or the Subreport expression is set wrong. Please check for the possibilities and do attach a screenshot or the supporting data which clears the problem. Thanks Ankur Gupta http://ankurthetechie.blogspot.in/
  2. Hi, As you want to integrate Jasper Reports in the a Java web application then what could be done is that use the iReport to design the reports, so you will have JRXML file of the report now as you require the value from the application via Search box or Dropdown so you can place these in the application and Java you can simply set the parameters of the report created in iReport via java program , and then again via the same program you can execute the report with aggregated paramters from the search box and drop down, now for comipling and setting the parameters in the report (JRXML file) programatically via a java program you need to make of the package net.sf.jasperreports.engine.design contained in the jar file jasperreports-x.x.x.jar (x defines the version of the jar). This Jar file could be easily find in the directory where the iReport is installed. (Location where iReport is installedireportmodulesext) A sample for the code is Class.forName("com.mysql.jdbc.Driver");[/code]Connection conn =DriverManager.getConnection("jdbc:mysql://localhost:3306/student","username","pass");[/code]ResultSet rs=conn.createStatement().executeQuery("SELECT * FROM student_details "); [/code]JRResultSetDataSource jrrsds= new JRResultSetDataSource(rs);[/code]JasperDesign jasperDesigns = JRXmlLoader.load("Path of the JRXML rport created by iReport");[/code]JasperReport jasperReports = JasperCompileManager.compileReport(jasperDesign);[/code]JasperPrint jasperPrints = JasperFillManager.fillReport(jasperReports, new HashMap(),jrrsds);[/code]JasperExportManager.exportReportToHtmlFile(jasperPrint, "Path to export as HTML") ;[/code]JasperViewer.viewReport(jasperPrint); // Could be set wherever you want to view the report[/code] Hope that above information helps. Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  3. Hi, Well ordering by is the only method by which you can retrieve exact grouping, for optimization you can use indexing and other methods whichever caters the performance , Hope that this helps. Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  4. Hi, Can we add a search box and dropdown to the template itself? I am assuming that you are using to create your reports using iReport, so there we can add parameters which could be filled via Jasper server using the UI of the filters, as far as I know we cannot add the UI components like dropdown or search box in the template. Now the task of the search box would be to display the details of the specific user that the client inserts in the search box This could be achieved by setting up the query to retrieve the records in creating the IMPUT CONTROLS in Jasper Server and there we could get the drop down or search box to find or list the different users or whichever list of people are added to be selected as filter. Hope that this helps. Thanks Ankur Gupta http://ankurthetechie.blogspot.in/
  5. Hi, In order to sucessfully group, you need to use ORDER BY with the same field by which you want to group your data in the SQL Query(or which ever query you are using) This happens beacause if you do not order the records retrieved by the query according to the grouping field it will not order the data, and when iReport group expression encounters the records coming from the query it still finds the similar kind of ordering as found in the MANAGER_NAME and not DEPT_NAME . So my advice is which ever field you want to group your data according to the records must ordered/sorted by the same field. Hope that this helps Thanks Ankur Gupta http://ankurthetechie.blogspot.in/
  6. Hi, Try using proper breaks, the break element can be found in palette. Using breaks will allow to restrict the static text in the respective pages. Hope that this helps. Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  7. What error is coming can you please put it here? Thanks, Ankur Gupta
  8. Hi, You can follow this video, created by me explaning the solution of your question Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  9. Hi, Possiibly this is not an issue of Word wrap, you need to set the spit type for the band in which you have placed the date feild, to set the prevent type follow this: Click on the band node in the Report inspector, which contains the date field.You would see the three properties there , last one is the Spit TypeFrom the drop down against the Split Type select it as PreventThis should probably solve your issue. Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  10. Hi swathi, For linking the subreport you can follow the following steps: First you need to drag and place the subreport elememt from the Palette window onto the main report.Now you can follow the wizard, create a new subreport or can link a previously created report.After the successful creation or linking of the subreport, place the subreport element correctly onto the main report.Click on the subreport element and navigate to the properties of the subreportThen in the properties pane of the subreport element, go to the last two properties called Parameters and Return Values.Now for the information , by setting the Parameters you can send the parameters from the main report to the subreport and by defining the return values you can send the variables of the subreport to the main report.Now as in your scenario you want to send the parameters from the main report to the subreport so you need to define the parameter so click on a small button next to the parameters, a pop up will come.Now in the popup you can find the two a button called ADD and other is COPY FROM MASTER, Copy from master copies all the parameters from the main report, and add allows you to define you manually.Now you need to take care that whatever name is defined by you in setting the parameter, the name should exactly match the name used in the subreport.Now you can use the parameter in the subreport, and you are done linking the subreport. Hope that this explanantion helps, I will shortly post a video on the same on youtube and put the link here for your reference. I will also put the same methodology, and put a sample for reference in a blog, link posted below. Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  11. Hi, What you can do here is that you can create another parameter which has a default value as the Ternary expression, which chooses the appropriate show value for the entered parameter value by the user. Suppose there is a parameter called $P{USER_DEFINED} which takes input from the user( in this case suppose user enters 1 or 2) There you can define another parameter called $P{USER_DEFINED_SHOW_VALUE} now this will not be used as prompt and this will contain a default expression for this case for user inputs 1 and 2 : The default expression looks like: $P{USER_DEFINED} ==1 ? "One Selected" : $P{USER_DEFINED} ==2 ? "Two Selected" :"" Now this parameter could be used in the the report to show the selected value of the parameter. Hope that this helps. Thanks, Ankur Gupta http://ankurthetechie.blogspot.in/
  12. http://i.ytimg.com/vi/tvddKCeWPBY/0.jpgHow to implement conditional query in iReport- Using Sample Database- Sample Included Sample JRXML -https://drive.google.com/file/d/0B4yFyF_EORB_UmxpYVozMzVPbHM/edit?usp=sharingThis video will explain how to implement conditional query in iReport, the query change could be toggled using the conditional parameter or user inputs.You can follow me on - Twitter Handle -- @ankur_augFacebook - https://www.facebook.com/ankur10augLinked IN - http://www.linkedin.com/pub/ankur-gupta/51/895/910 Blogt - www.ankurthetechie.blogspot.inG+ - https://plus.google.com/116451164261752827176You can view my Jasper Community Profile - http://community.jaspersoft.com/users/ankur-guptaTo learn more about navigate to-JasperSoft Dashboard- http://www.youtube.com/watch?v=jD18L_CS0dQJasperSoft Analysis - http://www.youtube.com/watch?v=aPd1C2RsBP4Jaspersoft DI - http://www.youtube.com/watch?v=Sm4w1a8xpDQSubscribe to the videos as I will be posting more videos on Jasper Reporting.From:Ankur GuptaViews:12378http://gdata.youtube.com/static/images/icn_star_full_11x11.gif http://gdata.youtube.com/static/images/icn_star_full_11x11.gif http://gdata.youtube.com/static/images/icn_star_full_11x11.gif http://gdata.youtube.com/static/images/icn_star_full_11x11.gif http://gdata.youtube.com/static/images/icn_star_full_11x11.gif19ratingsTime:08:06More inScience & Technology
  13. Hi, In order to remove space when no data is present in the subreport, you can follow this: 1. Click on the subreport element you want to remove if the values are null. 2. Go to the properties of the concerned subreport element. 3. Then locate the property called, Remove Line When Blank and check it. For setting the heights of subreports dynamically(this is by default) and at the same time checking that it does not overlaps the following elements, you need to set the property Position Type as Float. Hope that this helps. Thanks, Ankur Gupta
  14. Hi Swathi, as the pattern which I see in your data is that there is a search key and related to it is the document numbers right? So in the main repory you make a group based upon the Search key, now in the group header you can place Product,TotalQty and Uom. Now in the detail section add an subreport and pass the search key or whichever value as the key value which links the document numbers with the search key. Then in the subreport simply place the query with the search key in the where clause which will enable you to pull out respective document numbers . Then place the fields in the details section of the subreport. And finally when you run your main report you will obtain data of similar pattern. If you need further explanantion and demonstration just pass me a sample data I will make a JRXML out of that so that you can follow. You can even reach me on skype ID: mfsi_ankurg or on my mail ID : ankur.gupta.aug@gmail.com Thanks, Ankur Gupta
  15. Hi , Yes this kind of data output is possible using iReport what you can do is that, First of all you can have a main report containg the details about the rows having the search key,Product,total Qty and Uom and the values, just the first row. Then you need to create the subreport where you will print the next portion bascically the details of the Product- cables. Now you could link this subreport with the main report by passing the key value from the main report to the sub report. In a nutshell this could be achieved by simple implementation of the subreport. Hope that this helps. If you have further queries please ask. Thanks, Ankur Gupta SkypeID: mfsi_ankurg
  16. Here , Found this Jaspersoft Flash project on this link maybe it is of some help do let me know http://sourceforge.net/projects/jasperreports/files/jasperreports-flash/JasperReports%20Flash%20Viewer%203.7.0/ I will keep on searching and post here if I find anything Thanks, Ankur Gupta
  17. Hi, In netbeans we need to create the viewee using a JPA form. You can follow the process- 1. After installing plug-in in NetBeans IDE you will observe a new category in Swing Palette: JasperReport Viewer 2. In a NetBeans Form (from where Jasper Reports (jrxml or jasper) must be invoked) created in an JPA project (meaning that persistence.xml must exists) you can add JasperRunnerButton. 3. The most important property is reportURL where you must provide the path and the name of the target Jasper report. The appropriate syntax must be relative to project package-structure and must be specified using normal Java conventions such as: /japp/view/reports/Report.jasper. Even a more java-source-like syntax is accepted, like japp.view.reports.Report.jasper. 4. The target report file must be included in NetBeans project and must be send in compilation (build/classes) or distribution path. 5. Other optional properties:- reportParameters - to send parameters using a Map containing parameter name - value pairs;- runSynchronous - to disable lunching button until preview window is up;- databaseURL, databaseUser, databasePassword, databaseDriver if it is a JDBC only application (not a JPA context)- sqlText - to send as parameter for JasperReport a SQL phrase like those used to initialize JDBC Prepared Statements and where the parameters marked with ? symbol will be replaced by the Map supplied with reportParameters property, Map that will include index-value pairs this time. 6. The plug-in installs the necessary jasper libraries (jars), so there is no need to add them separately. 7. The JasperReportViewer.jar contains JasperReportHelper class that is doing the whole integration work. This class contains three runJasper methods that can be called to lunch a Jasper report using database parameters or a JDBC connection or even a JDBC PreparedStatement. Hope that this helps. Regards, Ankur Gupta
  18. In case of JasperSoft Studio you need to refer to 'Report State ' window. For more clarification you can look onto page 10 of the jaspersoft-studio-user-guide following is the link. http://community-static.jaspersoft.com/sites/default/files/docs/jaspersoft-studio-user-guide.pdf Hope that it helps. Thanks, Ankur Gupta
  19. Can you please explain what you mean by duplex mode.
  20. Hi, if you use the System.out.print in the scriptlet it will not print it in the Report anywhere, it will show up in the Report Output window, even if the report runs and says No pages to display . The Report Output can be seen by Window --> Report Output Doing this you can see the window and if you have use the following function in the scriptlet : @Override public void beforeReportInit() throws JRScriptletException { System.out.println("This is the test Of sysout"); } Then when you run the report including the scriptlet then whether or not the report produces any values, but you can see the text This is the test Of sysout in the Report Output window as soon as the report is initiated.Hope that this explanation helps. Regards, Ankur Gupta
  21. Hi, First of all let me start with your first doubt, the methods beforeDetailAvail, BeforeReportInit(), AfterReportInit() etc. are bascically the function which could be included in any scriptlet.These functions are fired when the Jasper Print object is created, and it is created when a JRXML runs. You can use the System.out.print inside any of these functions or user defined function but remember that the System.out.print prints the value in the console, so if you do use System.out.print in the scriptlet then it would definitely print the values in the REPORT OUTPUT window. For the second query if you refresh the report and you assuming that you have changes in the database, and the data passed to the scriptlet changes then the values are refreshed as well. For the override functions of the scriptlet, as I have stated above that it fires only when the JRXML runs, so refreshing the report causes this scenario to occur and hence the scriptlet value do refresh when report is refreshed. Hope this explains your doubts. I will create a video using the same sample I have included, as well as provide the java file, for your better understanding.Will place the link to video here. Thanks, Ankur Gupta
  22. Some more details would be helpful in aswering.. as what you want to achieve , etc. Thanks, Ankur Gupta
  23. Hi, What I suggest is that create a scriptlet which runs the query same as in the report but just gathers the total based upon the same grouping , now the grouping can be tackled in the scriptlet using the Product code. So in the scriptlet you would sum the sales for all the types of a particular product and returm it to the report. So this will allow you to use, the totals in th detail band and so in turn you can calculate percent over sales. If you have doubts using scriptlet you can go through http://ankurthetechie.blogspot.in/2013/12/jasperScriptletIntegration.html Let me know if some clarifications are required. Thanks, Ankur Gupta
×
×
  • Create New...