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

shrije

Members
  • Posts

    112
  • 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 shrije

  1. What is the exception you get ? I am using the same configuration as you like JR3.0.0 and IR3.0.0 but my excel reports are fine.
  2. Try ti run this query outside of jasper reports using any sql editor like TOAD or SQL developer. Use the same values. Problem may with the query itself with the specified parameter.
  3. Yes Horizontal report is the best example. Your report will have two columns defined. Did you run the Horizontal report ?
  4. yes and even for standalone i might need it. Do u know a way to do it.
  5. Try the split allowed option (uncheck) for the band that is splitting and add page breaks wherever required.
  6. Subreports resize accordingly. You dont have to worry. Good that the JRBeanCollectionDataSource worked. i believe u missed the package name.
  7. You need to use subreport for this to work.
  8. I have a report which horizontal in nature. I have tried the horizontal report sample. But the sample needs to know the finite no of columns to be displayed. My report needs columns based on the no of records i have in the column. So the no of collumns is not fixed. It is not a crosstab report. One way to do is to increase the column count for the report using jasper report API and resize the page width accordingly based on the no of columns required.
  9. Put it as java.util.List. Also change the subreport properties as i described earlier.
  10. Please look at the 'horizontal' sample in the demo folder of the source code of jasper reports. It is exactly what you need.
  11. Once you fill the jasper report, you get the jrprint object. Use the jrprint object to rearrange the ui elements as you wish.
  12. You might have to change the implementation slightly. You dont have to populate sub report as arryList based on EmpCode. All the data will be populated right before you generate the report. So you have to organise your data in the following form. Class EmpDetail { String EmpCode List ProjectDetailsClass } So your first main report JRBeanCollectionDataSource is JrBeanCollectionDataSource(List<EmpDetail>) Rest of the population is just iReport Configuration of subreport. You subreport should have fields for ProjectDetailsClass. Change the subreport element properties to following:- At the subreport tab select "use DataSource Expression" Here enter "new JrBeanCollectionDataSource(List<ProjectDetail>)" as the datasource expression. I hope i am clear now.
  13. Class MainReport{ List<EmpDetail> List <ProjectDetail> } Class EmpDetail{ empCode,Name } Class ProjectDetail{ empCode, projectDetails } Your main class should look like this. You have beancollection of MainReport only. The mainReport will have two fields automatically created as List. Once you done that change the subreport datasource as JavaBeancollectionSource(NameofListField). This way you can achieve very complex reports. Your subreport just needs to have the fields from the respective beans. It is difficult to write all in message but i have written enough for your understanding.
  14. I have a report with huge data in subreports. It takes lot of time to generate the report. I wish to know if i can fill the report asynchronously so it generates the report faster. has anyone used this ?
  15. You can pass parameters to the subreport jrxml from the subreport parameter tab in the subreport element. The same parameter name is to be specified in the subreport jrxml in order that the value is passed sucessfully.
  16. You mention that you need an arbritatry number of subreports. How do you decide the no of subreports ?
  17. It means the solution is correct the only issue is with finding the ttf file in the environment. You can find in one way. Get the jasperserver source code and look for the exception. You will surely get some clue. I had this similar experience some time back when i looked through the source code it gave me a striong clue. I havent used jasperserver so i dont have the source code. Not sure if I can download it since it is a GPL license.
  18. You have to use JRBeanCollectionDataSource(Collection) This is a collection of javabeans or an array of java beans. And these javabeans represent the fields in your report.
  19. subreports are used where you want to represent data that is child to the data in the parent report. You could show data that is a reference data which may not any relation. You can have as many levels of subreports. You can pass parameters to the subreport jrxml from the subreport parameter tab in the subreport element. The same parameter name is to be specified in the subreport jrxml in order that the value is passed sucessfully.
  20. Waht does the expression look like now ? If that is the change that fixed it. Waht way did it fix otherwise ?
  21. You have to work on the JRPrint object rather than the JasperDesign object. Once you obtain the jasperPrint object, manipulate it similar to the code below. private static JasperPrint moveTableOfContents(JasperPrint jasperPrint) { if (jasperPrint != null) { List pages = jasperPrint.getPages(); if (pages != null && pages.size() > 0) { JRPrintPage page = null; Collection elements = null; Iterator it = null; JRPrintElement element = null; int i = pages.size() - 1; boolean isFound = false; List modifiedElements = new ArrayList(); while(i >= 0 && !isFound) { page = (JRPrintPage)pages.get(i); elements = page.getElements(); if (elements != null && elements.size() > 0) { it = elements.iterator(); int positionX = -1; int positionY = -1; while(it.hasNext() && !isFound) { element = (JRPrintElement)it.next(); if (element instanceof JRPrintFrame) { JRPrintFrame jrPrintFrame = (JRPrintFrame)element; List listElements = jrPrintFrame.getElements(); for (Object object : listElements) { System.out.println("object.getClass().getSimpleName()=" + object.getClass().getSimpleName()); } } if (element instanceof JRPrintText) { //System.out.println(key + ((JRPrintText)element).getText()); System.out.println("element.getY()+element.getWidth()=" + element.getY()+""+element.getWidth()); JRPrintText modifiedElement = ((JRPrintText)element); positionX = positionX == -1 ? (modifiedElement.getX()-modifiedElement.getWidth()): positionX; positionX+=modifiedElement.getWidth(); positionY = positionY == -1 ? (modifiedElement.getY()-modifiedElement.getHeight()): positionY; modifiedElement.setX(positionX); modifiedElement.setY(positionY); modifiedElements.add(modifiedElement); System.out.println("element.getY()+element.getWidth()=" + element.getY()+""+element.getWidth()); } modifiedElements.add(element); } } i--; } page.setElements(modifiedElements); //jasperPrint. //jasperPrint.addPage(0,jasperPrint.removePage(0)); } } return jasperPrint; } Here in this way you can resize, relocate any of the items in the report.
  22. I am not sure why the beans in the xml file are commented. It may not have any effect at all. Secondly the index 0 of the Arial Unicode MS should be a valid path. You have added repo: in front of that. That may be wrong. Try removing the xml comments too.
×
×
  • Create New...