Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By jim829

Thread: Table With Charts On it.

  1. #1
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    7

    Default Table With Charts On it.

    Hello everyone..

    I am not really sure if my question is going to be an advanced or not so i will leave the moderators to handle it.

    I have to create a program for a client. The programs stores data for customers and extract reports about them.
    The report will be a pdf file in which there will be a text about the clients info, some tables with values and some charts and images. Now I don't really care about how I am going to make the pdf file (probably I will use 3rd party library/software). My client wants to create the report himself from the beginning and inside the program. More or less he want to have something like LibreOffice or Microsoft excel , and to create tables and charts himself and set their locations etc. Now of course i can create a JTable or TableView (Javafx) and make it work like Excel's spread Sheets but i am not really sure how can I put Images/Charts on it like image below :

    Table With Charts On it.-here.png

    He want to be able to resize the charts or images , to reorganize the entire spreadsheet with the mouse like the programs I mentioned.

    1.Now one way i can think of it , is to create JPanel in which i will put my JTable (acting like spread sheet) and to @Override the paintComponent/paint method so i can draw the Images or the charts he wants in specific locations upon JTable . Now this will be little difficult to achieve (at least i think) cause after that i am not really sure how i am going to give the user the ability to move/resize/delete/change the images or the charts he puts on it. And of course after that i will have to find a way to mark the entire JTable or some part of it and to make a pdf from it.

    2. Onother way to display all the above (somehow) inside JEditorPane or Javafx Html Editor which will be more easy to make changes and extract everything into a word/pdf etc (i guess :P ). But for that i have to think a way to insert the JTable or something looks like it inside the JEditorPane.

    I would like to know if someone has any idea about the implementation of this program , any info would be really helpful..

    ps. the post title was a poor choice :P

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,993
    Rep Power
    9

    Default Re: Table With Charts On it.

    As far as PDF creating goes, you can use https://pdfbox.apache.org/.

    I think you could approach this in a layered manner. Use a JLayeredPane if you want to have different components stacked on top of eachother. More info here: https://docs.oracle.com/javase/tutor...yeredpane.html
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    7

    Default Re: Table With Charts On it.

    Thanks for the reply.. I decided to do it with StackPane in javafx which is something like JLayeredPane in Swings.. As a fan of swings i find it difficult to make the TableView in javafx acting like JTable , so i embed the Swing JTable inside the JavaFx app i hope it's ok until now it's working smoothly. I have implement the resize/reorganize utility for the nodes inside my Pane and I will use the the 3d-party library you suggested to me to for the extraction of the reports in pdf format. The only reason for me choosing JavaFx over Swings is because of the chart support and for the animations that javafx provides.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Table With Charts On it.

    I am curious about something. I would think that there would be commercial products (like Excel or similar) or even open source (like POI) which would already offer this capability. And I would think they would be less expensive for the client than having some custom developed software. Perhaps even the pdf reporting could be retrofitted with an exported xml file from Excel or some other technique.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  5. #5
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    7

    Default Re: Table With Charts On it.

    Yes.. You are right.. that's the first thing i said to him when he ask me to develop such as software. He was working with excel for many years and he is not very satisfied so he ask me to improve some features. The problem is that i am not really sure how much it will cost eventually xD cause the above description of the software is like the 5% of the entire project.

  6. #6
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,993
    Rep Power
    9

    Default Re: Table With Charts On it.

    Quote Originally Posted by ShadowWalker View Post
    he is not very satisfied
    He needs a solid Excel course. Excel rocks when it comes to tabular data, charts and saving as PDF. Recreating all that in Java is a nice challenge for you, and although I do not doubt your coding skills, I doubt he will get anything better than Excel.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  7. #7
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    7

    Default Re: Table With Charts On it.

    Yeah it's going to be really a challenge.. of course it's almost impossible to recreate the entire excel and make it better i know that :P. But i will make a small database with all his customers and i believe through my software he will be more comfortable managing all of them even if i never reach the quality that excel offers.

  8. #8
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Table With Charts On it.

    And of course the plus side is you get paid for learning something which will certainly be useful when supporting other clients.

    Regards,
    Jim
    ShadowWalker likes this.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. wicked Charts 0.1
    By java software in forum Java Software
    Replies: 0
    Last Post: 01-19-2013, 08:01 AM
  2. Need Help for JSF Charts
    By maulikmodi08 in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 03-22-2011, 12:29 PM
  3. jsp and jfree charts
    By asad.naqvi in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 12-22-2010, 02:21 PM
  4. Charts using iReports
    By roshni in forum Advanced Java
    Replies: 1
    Last Post: 04-21-2009, 08:42 PM
  5. Charts - Pie CHarts
    By null_guy in forum New To Java
    Replies: 0
    Last Post: 03-10-2008, 11:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •