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

Java_Jasper

Members
  • Posts

    71
  • 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 Java_Jasper

  1. Hello Harsha, This is link to part of your question: http://community.jaspersoft.com/questions/542548/problems-displaying-pdf just an overview. With your line: JasperDesign jasperDesign = JRXmlLoader.load(input); try and put the whole statemnt here.JasperDesign jasperDesign = JRXmlLoader.load (new FileInputStream(new File("./Reports/ipr.jrxml")); If this does not work then I would say you need to give the full file path name for said file, or create a directory which is defined in your development enviroment. Also I would print out "Input" just to see what you are really getting. Hope this helps.B.
  2. Hello, I have a report that is passed a field, said field comes from main report. I can run this report in the iReport Designer and everything works as expected between main report and subreport. When I try and run the report in my application I get a null pointer, since my subreport only has one field which is passed in from the main report can someone tell me why this would be happening? I was was thinking it might be an order of operations type issue, so I made a $V counter and used a print when expression in order to control the first iteration but no luck. Any help would be highly appricated. Errors: Could not load object from location : net.sf.jasperreports.engine.JasperReport ------------------------------------------------------------------------------------------------------------------------------------------------------ Update: After scouring the net I found a helpful tidbit in regards to subreports and Java. // Declare string String jasperFile = " "; // Define String jasperFile = directory + "subReport name.jrxml ---Notice the use of Jrxml here //Load the report templates JasperReport jasperReport = JRXmlLoader.load(new FileInputStream(new File( jrxmlFile))); JasperReport subReport = JRXmlLoader.load(new FileInputStream(new File( jasperFile ))); // Compile the report templates JasperReport jasperReport = JasperCompileManager.compileReport( jsapeReport --pass this in from the load above); JasperReport subReport = JasperCompileManager.compileReport(surReport -- pass this in from load above); //Then you add your subReport in your parameter Map parameters.put("SUBREPORT_JASPER_FILE", subReport); ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Final Update -- In iReport under paramaters set the "SUBREPORT_DIR" In properties window set the "Paramater Class" == java.lang.Object In properties window under "Subreprort Properties" set the Express Class == net.sf.jasperreports.engine.JasperReportsset the Subreport Expression == $P{SUBREPORT_DIR} -- Notice I am not using the .jasper file here!This will allow a sub report to be run when using iReport deigner 4.6.0 & Jdeveloper 11.1.2.4 the end result is you have to load the subreport and compile it before sending it to the fill manager using the .jrxml file as opposed to the .jasper file. As this is where it would die during debuggin, it would just null out in the print manager. Enjoy! BtW if this worked for you please give me Karma points.
  3. Hello all, So after trying for some time to figure this problem out here is the solution that worked for me. I made sure I was calling said IDs in my sql.In order to make my IDs trigger for each iteration of the report I used several "Group Headers" I did this because the headers are evaluated once per cycle per-say.I then placed a sub report into the footer of said report and passed it the "Field" which is $F{ID}, thus when the sql is called upon it gives the ID found at that moment in time to the sub report.The end result is a sub report that triggers, every time the header is evaluated.I know this is a bit of a hack but ENJOY!
  4. You are correct, you would need to use the PrintWhenExpression. If you are not sure how to declare a statement then you will want to look into it. Thus you would use a print when said paramater is true else don't.
  5. Hello, I have a section already in the detail section, where info is printed. When I have said data print it becomes fractured. Thus (data --> Sub Report) is printed over and over not the desired result. Thx.
  6. Hello All, I have a subreprot that is passed a paramater from the main report, I will cal it "ID". In the main report I have a query to select say 10 IDs. When I run the report I get the 10 different IDs and 10 subreports. However the subreport only triggers on the very first ID (thus I have 9 subreorts with the same info). How can I get it to trigger on each ID like in the main report? Thanks in advance!
  7. Hello, When I run my reports I get the error: java.sql.SQLSyntaxErrorException: ORA-00940: "ID" : invalid identifier. Keep in mind I am running this on the JDeveloper Intergrated Weblogic Server, v11.1.2.1.0 I am using iReport 4.5 Funny thing that happens, in iReport all templates compile and query just fine, when I reference them in my applicaiton some work and some dont. Where in the XML file would I be looking to solve this problem. Brian
  8. Ok, so the implementaion provided by gdmoreno is spot on. I would only add that once going through the install Windows 7 x64 will specify the default path to the x86 program files. I.E. "Program Files (x86)" Change this to "Program Files" then make the changes in the config file. Cheers! Brian
  9. Cheers! I will give it a whirl, thanks for posting! Brian.
  10. Great! So where do I find this "ireport.conf" file. Cheers!
  11. Ok so has this issue been fixed? I am running x64 and need iReport to work. I know you can split in windows 7 between the x86 and x64 but why not just have a x64 version. Is there one I am not aware of? Brian.
  12. Hello Shaun, I take it the blob is working, you should post your class so others know how to implement a blob. I would suggest you use a paramater to load the image into the report, Example: //Call the class Blob imageBlob = new Blob(); //Call Class paramater Paramater name = new Paramater(); //Create the hash map to pass the paramater Map Paramater = new HashMap(); //Include the paramater in the reprot paramater.put("Report_Logo", imageBlob.retrieveLogo(); Where Report_Logo is the name of the paramater you set up in iReprot and retrieveLogo() is the return statement of you blob class you created. Hope this helps. Brain H.
  13. Please see my post, all development was done in Jdeveloper. http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=97606 Cheers!
  14. Hello all, For your enjoyment --- TAG LINE "Display PDF in Adobe Reader" //DECLARE LOCATION OF YOUR JRXML FILEprivate static final String Report_Def = ******MY JRMXL FILE LOCATION ON C DRIVE*********//Resource REF example://jdbc/<your DB name>ConnectionDS //javax.sql.DataSource//Containerprivate static final String Report_DataSource = ******MY DB CONNECTION******** public String ActionButton(){ try{ //LOAD THE JRMXL REPORT TEMPLATEJasperDesign reportDefinition = JRMxlLoader.load(new FileInputStream(new File(Reprot_Def);//COMPILE THE REPORT TEMPLATEJasper Report report = JasperCompileManager.compileReport(reportDefinition);//GET THE CONNECTION TO THE DATABASEinitialContext initalContext = new initialContext();DataSourec ds = (DataSource)initialContext.lookup(Report_DataSource);//FILL THE COMPILED REPORT TEMPLATEJasperPrint print = JasperFillManager.fillReport(report, new HashMap<String, Object>(), ds.getConnection());//********DISPLAY IN ADOBE READER*********//CREATE AN OUTPUT STREAM WHERE DATA IS WRITTEN TO BYTE ARRAYByteArrayOutputStream output = new ByteArrayOutputStream();//CALL UPON THE EXPORT MANAGER TO LOAD JASPER PRINT AND BYTE ARRAYJasperExportManager.exportReportToPdfStream(print, output);//DECLARE A STRING WHERE YOU WILL SAVE THE REPORTfinal String PDF_FILE = "C;/****LOCATION YOU WANT TO SAVE THE NEW REPORT****);//CREATE A NEW STREAM AND CALL THE CONVERTED, SAVED REPORTOutputStream pdfFile = new FileOutputStream(new File(PDF_FILE));//WRITE THE PDFpdfFile.write(output.toByteArray());//CLEAN THE PDFpdfFile.flush();//CLOSE ITpdfFile.close();//RUN YOUR BRAND NEW PDF REPROTfinal String PDF_RUN = "rundll32 url.dll, FileProtocolHandaler " + PDF_FILE; //Don't forget the space between 32 and URL.//EXECUTE THE COMMANDRuntime.getRuntime().exec(PDF_RUN);}catch(Exception e){e.printStackTrace();}} Post Edited by bhayman1 at 04/25/2012 18:21
  15. Hello, I am having issues getting a pdf to display. I can bring up a pdf in the JasperViewer but I am trying to just get a pdf to open independent of the viewer. I have included the code for the viewer, only to show that is is working. I have attache my code. Code:private static final String Report_Def = ******MY JRMXL FILE*********private static final String Report_DataSource = ******MY DB CONNECTION********public String ActionButton(){ try{ //Load jrmxl fileJasperDesign reportDefinition = JRMxlLoader.load(new FileInputStream(new File(Reprot_Def);//CompileJasper Report report = JasperCompileManager.compileReport(reportDefinition);//Get DB DatainitialContext initalContext = new initialContext();DataSourec ds = (DataSource)initialContext.lookup(Report_DataSource);//Fill the jrmxl template with dataJasperPrint print = JasperFillManager.fillReport(report, new HashMap<String, Object>(), ds.getConnection());//View in jasperViewerJasperViewer.viewReport(print, false);//Display in pdfOutputStream output = new FileOutputStream(new File(***MY CREATED PDF FROM ABOVVE***));JasperExportManager.exportReportToPdfFile(print, **LOCATION OF MY FILE***);}catch(Exception e){e.printStackTrace();}}[/code]
  16. Hello, When running my reprot from JDeveloper, I noticed that in the log window that <ComponentEnviroment><findCompoonentBundles> Found two compoonents for namespace is thrown why?
  17. Ok, So, I installed the classpath Tools --> Options --> Add Jar --> (for me I went to the oracle DB, and under [ jdbc --> lib ] and selected the correct ojdbc) Cheers.
  18. Hello all, After installing IReport I go to make a database conneciton using the following: JDBC Driver: Oracle (oracle.jdbc.driver.OracleDriver) JDBC URL: I updated my connection string to reflect my host, port and sid. After inputing my username and password I go to test and get the following error: ClassNotFoundError! --> Msg: Oracle.jdbc.driver.OracleDriver --> Possible not found class: oracle.jdbc.driver.OracleDriver. Why is this error happeing and how do I move foward. Brian.
×
×
  • Create New...