Using Custom CSS for report output

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krpbrown
    Visitor
    • Jun 2015
    • 3

    Using Custom CSS for report output

    Hi,
    I'm trying to output a file report as an html file. I found some documentation on using the output option html-custom to reference an external style sheet which I got from your site, but I can't seem to get it to work.
    Code:
    # Set up basic comparison features.
    criteria timestamp:2sec
    
    # Filter out log files.
    filter "-*.log"
    
    # Load first comparison.
    load "C:\Users\krpbrown\Documents\A" "C:\Users\krpbrown\Documents\B"
    
    # Compare files with timestamp differences.
    select newer.files older.files
    
    # Generate a report of the differences.
    file-report layout:summary options:display-mismatches output-to:"C:\Users\krpbrown\Documents\Report.html" &
    output-options:html-custom="C:\Users\krpbrown\Documents\style.css"
    After running this script and viewing the html report in Notepad++ I don't see any link to the style sheet, and any changes I make in the style sheet aren't reflected in the output.
    Thanks for your help!
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    Only certain report layouts are able to support the custom style sheet, such as Side by Side and Interleaved. I would recommend using the graphical interface first to help troubleshoot generating this report. This way you can get feedback from the report dialog, generate the report that meets your needs, and once that is working automate the process.

    To test these steps in the interface, load a blank Folder Compare session, set the Filter toolbar box to contain your filter without "quotes", then load your two base folders.
    Use the View menu's Display Filters to only Show Differences No Orphans, and use the Edit menu -> Expand All, Edit menu -> Select All files to have a selection of different (newer, older, diff). Then right click or Actions menu -> File Compare Report. Choose the different layouts and options, and in the HTML output define the custom CSS if available.

    Let us know if you have any questions.
    Aaron P Scooter Software

    Comment

    • krpbrown
      Visitor
      • Jun 2015
      • 3

      #3
      Thanks that looks promising. I am also trying to use a batch script to call a beyond compare script, but I'm having trouble passing it the correct file names, if you are able to help with that I would appreciate it.
      This is the batch script...
      Code:
      @echo off
      "C:\Program Files (x86)\Beyond Compare 3\BCompare.exe" @"C:\Users\krpbrown\Documents\policytest\compareScript.txt"^
        "C:\Users\E314521\Documents\policytest\fileA.xml"^
        "C:\Users\E314521\Documents\policytest\fileB.xml"^ 
        "C:\Users\E314521\Documents\policytest\output.html"
      pause
      And here is the compareScript.txt, just one of your examples from the documentation.
      Code:
      text-report layout:side-by-side &
       options:ignore-unimportant,display-context &
       output-to:%3 output-options:html-color %1 %2
      When I run it I don't get an error, but in the log it says the following, like the output file isn't being passed or something.
      Code:
      output-to: output-options:html-color C:\Users\...\fileA.xml C:\Users\...\fileB.xml

      Finally, if my file path has spaces in it, do I need "quotes" around the %1, %2, %3 in the beyond compare script? Thanks for your help!

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16000

        #4
        Yes, I recommend adding quotes around the path variables in the script in case they have spaces.

        The script looks solid and if the first two parameters are passing in, I'd expect the third to pass in as well. Is your code literal? Does C:\Users\...\fileA.xml appear with "..." text or are you removing data there? I'd expect to see the real, full text of the path.

        I would suggest testing outside of the bat first, typing it manually on the command line without the ^. Then insert back into the .bat without the ^, just to see if the (presumably) working command line works when copied/pasted into the .bat.
        Aaron P Scooter Software

        Comment

        • krpbrown
          Visitor
          • Jun 2015
          • 3

          #5
          Your suggestions worked, thanks for the help. For the path, I just cut out the rest of the path for brevity. As for the script issue, it worked when I removed the ^s, not sure why, but I'm not complaining. Thanks again.

          Comment

          Working...