Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2017
    Posts
    4

    Default Loading session using <comparison> parameter

    Hi,

    I would like to load a session using the "data-report" command (among others).

    I have saved a session using the UI named "TestSession". I then call a simple script via command line:
    BCScript.txt
    --------------------------------------------
    data-report layout:side-by-side &
    options:ignore-unimportant &
    output-to:%3 output-options:html-color %1 %2 &
    "TestSession"

    -------------------------------------------
    But I end up with the uninformative error:
    "A fatal error has occured:
    Unable to create report
    The script will now exit."


    The script would otherwise work without the last parameter. I was wondering what is the correct way to invoke the <comparison> parameter so I can load a session with some rules I need for my comparison, or maybe there is some other mistake I am making.

    Thanks,
    Hong Wang

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    2,518

    Default

    The *-REPORT commands only accept one of a session name or a pair of filenames. To do what you want, I'd suggest changing the saved session so it uses environment variables (like "%LEFT_FILE%") as the paths, then set the variables to the correct values before calling BC with the script. Loading the session settings as a template for arbitrary files is on our wishlist and I've added your request as a vote for it.
    ZoŽ P Scooter Software

  3. #3
    Join Date
    Nov 2017
    Posts
    4

    Default

    Thanks for the quick reply!
    I changed the element in BCSessions.xml to <Left Value="%BC4_LEFT_FILE%"/>
    and in my batch script I call
    set BC4_LEFT_FILE ="C:\Users\p123e9f\Desktop\FileDiff\FileDiff\TestF iles\a.txt"
    I have also tried several variations of this (quotes and escapes) but always get a generic error message.
    Could you please explain what exactly to set the element and environment variable for this to work?

    As a side note

    Thanks,
    Hong Wang

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    2,518

    Default

    The SET line shouldn't have quotes, but otherwise I think that should work. Can you email your script and batch file to support@scootersoftware.com along with a link back to this forum post?
    ZoŽ P Scooter Software

  5. #5
    Join Date
    Nov 2017
    Posts
    4

    Default

    It seems that the <Left Value="%BC4_EXPORT_FRAMEWORK_LEFT_FILE%"/> element needs to be <Left Value="%25BC4_EXPORT_FRAMEWORK_LEFT_FILE%"/> instead. Setting it in the UI will change the xml settings properly. I can now pass the filenames and session as parameters (though filenames are passed through environment variables). Thanks for your help!

    EDIT***
    For reference, the batch file I use now is:
    -------BC.bat-------
    set BC4_EXPORT_FRAMEWORK_LEFT_FILE=C:\Users\p123e9f\De sktop\FileDiff\FileDiff\TestFiles\a.txt
    set BC4_EXPORT_FRAMEWORK_RIGHT_FILE=C:\Users\p123e9f\D esktop\FileDiff\FileDiff\TestFiles\b.txt
    ..\BC4\BCompare.exe @"BCScript.txt" ..\Report.html
    -----------------------------------------------

    The XML subsection for the corresponding session has the element
    -----XML settings--------------
    <Left Value="%25BC4_EXPORT_FRAMEWORK_LEFT_FILE%"/>
    <Right Value="%25BC4_EXPORT_FRAMEWORK_RIGHT_FILE%"/>
    --------------------------------------
    Last edited by Hong Wang; 28-Nov-2017 at 08:42 AM.

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    2,518

    Default

    Oh, right, the XML reader/writer has to escape the % character. Glad you got it working.

    If you modify the session from the user interface it should do the escaping automatically. You should change the ones at the end of the path to %25 too. They're only working now because the " after it isn't a valid hexidecimal character.
    ZoŽ P Scooter Software

  7. #7
    Join Date
    Nov 2017
    Posts
    4

    Default

    Modifying the session from the UI does not change the end of the path to %25, but I will keep your advice in mind in case I run into problems later.

Posting Permissions

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