Results 1 to 15 of 15

Thread: Reporting in Qt4

  1. #1
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Reporting in Qt4

    Has anyone had any success with printing good looking reports in Qt4?

    I've tried NCReports but their Qt4 version only compiles to a command-line version and did not work either. Also the report designer is in Qt3 only which doesn't help me.

    I've tried OpenRPT as well and have had no luck getting it working either.

    I originally was trying to work with a self-generated HTML report and pumped that into a QTextDocument but printing is so limited that I can't do the formatting I want.

    So if you have any info or help I would love to hear it.
    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reporting in Qt4

    I looked into the same thing about 6 months ago. The problem with most of the 3rd party tools I found was that none of them could work across different platforms, and this was a requirement.

    I ended up doing what you had mentioned: generating HTML and cramming it into a QTextDocument. This works pretty well for quick development, but I was annoyed by the lack of control I had over pagination, headers/footers, and other elements that make for good reporting.

    The best solution, I think, is to manually paginate your report and paint it directly to the printer. I haven't done this myself so I can't tell you much, but there is a very good example in C++ GUI Programming with Qt 4 by Jasmin Blanchette and Mark Summerfield. Essentially it looks as though a QPainter is instantiated with a QPrinter being passed into the constructor, and then you draw the text to the painter. The problem here is that it seems to require quite a lot of effort to develop reports this way.

    Perhaps with some time and ambition someone can develop a decent Qt reporting API.

  3. #3
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    Yeah, It looks like we stepped through the same hoops. I have that book and have seen that example. I think i'll take a closer look at it. I think I might just have to bite the bullet and code my own HTML/XML report generator. If I do I'll definitely post it here, but of course time is in such short supply.

  4. #4
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reporting in Qt4

    Yes, time is always in short supply. It's likely that I'll have to write something similar in the next year, so if you're successful (or not) please post back here or send me an email via my account here - I am curious to know how it goes for you.

    Jimmy

  5. #5
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reporting in Qt4

    I have heard a rumour that a new Qt report engine will soon be on the market in the next couple of weeks.

  6. #6
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    Really? Definitely post here with the info when it comes out. Is there a place where we can see some details about it or do we have to wait?

    I don't think Jimmy and me are the only ones waiting for a good reporting engine.

  7. #7
    Join Date
    Mar 2007
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reporting in Qt4

    Has anyone tried kugar from koffice? There seems to be a non KDE version.

    http://docs.kde.org/development/en/k...ng-widget.html

  8. The following user says thank you to prepoc for this useful post:

    jacek (4th March 2007)

  9. #8
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    I was about to reply "kugar is kde only!" but hey, you're right. There does seem to be some classes for crossplatform. Do you know if there are more detailed instructions on using these classes on windows or apart from kde?

    I'm going to keep digging. At least I have more hope than when I started all this.

  10. #9
    Join Date
    May 2006
    Posts
    70
    Thanks
    12
    Thanked 4 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    I've been looking at the Kugar classes from Koffice 1.6.2 and seeing if I can port them from Qt3 to Qt4. I don't know much about Qt3 and porting to Qt4 so I think I'm stuck on that for now. I guess I'll go back to seeing if I can build my own. (or waiting for Brandybuck to cough up some details) Maybe I'll use the kugar classes as an inspiration.

  11. #10
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Reporting in Qt4

    Quote Originally Posted by darkadept View Post
    ...(or waiting for Brandybuck to cough up some details)...
    I really don't know much more. As I said, it's only a rumour. I was given the same maddening sliver of hope I passed on to you.

    p.s. I am working on my own printing classes for Qt, but they will not be geared towards reports.

  12. #11
    Join Date
    Jan 2006
    Posts
    55
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Reporting in Qt4

    Quote Originally Posted by darkadept View Post
    Really? Definitely post here with the info when it comes out. Is there a place where we can see some details about it or do we have to wait?

    I don't think Jimmy and me are the only ones waiting for a good reporting engine.
    Sure,now I am looking for a way to make report forum just like windows office's style .

  13. #12
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    Quote Originally Posted by darkadept View Post
    I've been looking at the Kugar classes from Koffice 1.6.2 and seeing if I can port them from Qt3 to Qt4. I don't know much about Qt3 and porting to Qt4 so I think I'm stuck on that for now. I guess I'll go back to seeing if I can build my own. (or waiting for Brandybuck to cough up some details) Maybe I'll use the kugar classes as an inspiration.
    When I rummaged through the code in OpenRpt I noticed two things:
    1) They had ported it from Qt3 to Qt4
    2) Several of the critical features are in Qt3 and no suitable widget exists in Qt4 without a LOT of recoding and workarounds for features that were in Qt3 but not in Qt4.

    This is probably why they pushed it out as a GPL app. Hoping to get the community to complete the Qt3->Qt4 conversion.

  14. #13

    Default Re: Reporting in Qt4

    Try report manager from sourceforge.net..... it works so well!!!

  15. #14
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    The Qcj data libraries have the startings of this. They, sadly, have trouble crossing page boundaries when printing. I have plans, and they are now at least sort of ready, to have them do their own formatting for the printer. This will be down the road.

    The QcjData classes are a live project which I use a lot and so it's developement and improvements will be on going. You can find them at

    http://www.linuxlots.com/~qcj

    You can email me directly if you (and I'm sure you will) have any questions on the report classes. joe@croftj.net

  16. #15
    Join Date
    Jul 2007
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reporting in Qt4

    hi
    after some googling i found this :
    http://www.eclipse.org/birt/phoenix

    i need to generate some reports in my apps and i'm looking for a good tool.i think birt can be suitable.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.