Menu

#2296 Patch for RFE:1665229 HTML report for compared files

Trunk
closed-accepted
None
5
2007-07-14
2007-06-18
No

This patch adds the feature to generate a HTML report for file compare.

This is not a complete patch because:

- Needs to add more comments to source code. It is not an easy task for me:(
- Only HTML report. Should we also create XML or CSV report?
- I'm not familiar with HTML. Maybe this patch generates a terrible HTML. I appreciate if someone fixes it.
- A long line without space is not wrapped in Firefox.
- Do we really need this feature?:)

Discussion

  • Takashi Sawanaka

     
  • Takashi Sawanaka

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    File Added: sample.7z

     
  • Kimmo Varis

    Kimmo Varis - 2007-06-18

    Logged In: YES
    user_id=631874
    Originator: NO

    Looks nice!

    Yes, we'll need this patch. Many users want to show/print reports of changes for review
    purposes. Or for management etc.

    I can help with comments and documentation.

    One comment about code, after very quick look at it:
    - doesn't my SelectFile() warn about overriding file?

    Then bigger task is we later want to use templates for these reports, so users can customize them for their needs. And that means we also need dialog to select template and set related options.

    But I think we can start with this patch - with hard-coded HTML report.

    Also, we can think of XML reports later, I don't think anybody really needs CSV...

     
  • Tim Gerundt

    Tim Gerundt - 2007-06-18

    Logged In: YES
    user_id=652377
    Originator: NO

    And the HTML code looks also nice! :)

     
  • Takashi Sawanaka

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    Thank you Kimmo and Tim for checking the patch.

    >One comment about code, after very quick look at it:
    >- doesn't my SelectFile() warn about overriding file?

    I'm afraid that your SelectFile() didn't warn.

    Is there any idea to solve long line problem?
    Please see the attached picture.

    File Added: longline.PNG

     
  • Tim Gerundt

    Tim Gerundt - 2007-06-19

    Logged In: YES
    user_id=652377
    Originator: NO

    > Is there any idea to solve long line problem?

    No at the moment. :-/

    Problem is the "word-break" property from CSS. First it was a MS-IE-only thing, but it is now a CSS3 property. But unfortunately Firefox not support it now. :-(

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    Thank you for the response.

    I think that another diff tools might have the solution of this problem. So I will investigate how the another diff tools treat the problem.

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    I could not find any free diff tools that can generate HTML reports.
    But how about inserting <wbr> tag to break a long line? Although it is only supported by IE or Gecko browsers, To use the tag is better than previous patch.

    I am attaching the second patch that adds comments and the above fix.
    File Added: patch-htmlreportV2.7z

     
  • Takashi Sawanaka

     
  • Kimmo Varis

    Kimmo Varis - 2007-07-08

    Logged In: YES
    user_id=631874
    Originator: NO

    I got curious why "my" SelectFile() doesn't warn about overriding a file. And I only now notice you are giving last parameter "is_open" as TRUE. Which means selection is for opening the file, and file is not supposed to be overridden, so there is no warning. If you change the last parameter to FALSE, meaning saving a file, then it warns about overriding.

    Sorry, this is lack of documentation, I'll document this to doxygen comments.

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    Oh! I didn't notice the parameter. Sorry for it.
    I've confirmed SelectFile() warns about overriding a file.
    But when omitting file extension '.html', SelectFile() doesn't warn about it.
    So I will remove the feature 'auto adding .html extension' for simplification.

     
  • Kimmo Varis

    Kimmo Varis - 2007-07-08

    Logged In: YES
    user_id=631874
    Originator: NO

    I think SelectFile() should know about this file extension omitting, as it is pretty common usage for the function. Nobody just haven't yet added it into the SelectFile(). But at least project file saving should handle it. Maybe we only need to move few lines of code from project file saving into SelectFile(). Just speculating as I haven't looked at that code for a while. Anyway, different tracker item is needed for that..

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    I am attaching V3 patch...
    File Added: patch-htmlreportV3.7z

     
  • Takashi Sawanaka

     
  • Kimmo Varis

    Kimmo Varis - 2007-07-12

    Logged In: YES
    user_id=631874
    Originator: NO

    Latest patch seems good. Couple of minor comments:
    - maybe CString CCrystalTextView::EscapeHTML() and CString CCrystalTextView::GetHTMLAttribute() could be static functions, or maybe even tool functions in separate file (htmltools.cpp?). Escaping might be useful for folder compare reports at least.
    - please remove copy/pasted comments from CString CCrystalTextView::GetHTMLLine(). I mean those "BEGIN SW" and "END SW" comments. I don't think they are useful for anybody.

    Patch looks good to be applied.

     
  • Takashi Sawanaka

    • assigned_to: nobody --> sdottaka
    • status: open --> closed-accepted
     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    Committed to SVN trunk.
    Completed: At revision: 4367

    I've made EscapeHTML() a static function. But I didn't make GetHTMLAttribute() a static function because GetHTMLAttribute() calls CCrystalTextView::GetColor().

     

Log in to post a comment.