+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
MIS Systems Thread, help in running sims commandreporter (yet again!) in Technical; @iceman - that's torture to a room full of geeks! I don't even have delphi, and it would be needed ...
  1. #16

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,844
    Thank Post
    671
    Thanked 1,381 Times in 1,143 Posts
    Rep Power
    349
    @iceman - that's torture to a room full of geeks!
    I don't even have delphi, and it would be needed to do any form of testing, <must resist urge to waste time on non-essential but probably really useful in the future task..>

    can you at least give me the full syntax that your using, so i can see the quote mark usage on the whole string...
    i'll run it through my quote stripper/parser and see what it comes back with.

  2. #17


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,710
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    Quote Originally Posted by nickbro View Post
    if you use "" it will just see end of one quote start of another, which it doesn't like. Using ' instead gets around this.
    Escaping the second set of each pair of double quotes with a \ seems to work for me.

    Code:
    /PARAMS:<Parameter id=""DDNzGLsaAUi8eGtd+3PIGw==\"" subreportfilter=""True\""> <Name>Mark date</Name> <Type>Date</Type> <PromptText>MarkDateBefore</PromptText> <Values> <Date>2011-06-09T00:01:00</Date> </Values> </Parameter> <Parameter id=""eNvt6kqoTcUAoHB2VMyWRg==\"" subreportfilter=""True\""> <Name>Mark date</Name> <Type>Date</Type> <PromptText>MarkDateAfter</PromptText> <Values> <Date>2010-08-15T23:59:00</Date> </Values> </Parameter>


    ArgsTest.exe can be downloaded from here.

  3. #18

    Join Date
    Mar 2007
    Posts
    39
    Thank Post
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    15
    Arthur,
    Every second pair! I must admit that was one combination I didn't try.
    I'll try that out with the real thing and post back.

    Vicpaw
    The full line I would like to pass to CreateProcess to avoid making a file is below. It refers to a report based on student with a sub report of attendance marks and (following your comments from a much earlier post) with two parameters for the start date and end date with prompt names of MarkDateAfter and MarkDateBefore. I generate these dates using code, change them to a string and, at the moment, embed them into the short bit of xml that gets written to a file. What I have below is preferable though if I can get the format right.

    Oh, and the actual file paths will be full UNC paths containing double backslashes and Dollar signs, this example is from my development machine.

    Code:
    "C:\Program Files\sims\sims .net\commandreporter.exe"   /USER:"d" /PASSWORD:"x" /REPORT:"SITKA_Attendance" /OUTPUT:"K:\Howards Documents\SITKA\jobs\Attendance\Delphi version\delphi code version 2\init\SITKA_Attendance.csv" 
     /PARAMS:"<?xml version="1.0" encoding="us-ascii"?>
    <ReportParameters>
        <Parameter id="DDNzGLsaAUi8eGtd+3PIGw==" subreportfilter="True">
            <Name>Mark date</Name>
            <Type>Date</Type>
            <PromptText>MarkDateBefore</PromptText>
            <Values>
                <Date>2011-06-10T00:01:00</Date>
            </Values>
        </Parameter>
        <Parameter id="eNvt6kqoTcUAoHB2VMyWRg==" subreportfilter="True">
            <Name>Mark date</Name>
            <Type>Date</Type>
            <PromptText>MarkDateAfter</PromptText>
            <Values>
                <Date>2010-08-15T23:59:00</Date>
            </Values>
    </Parameter>
     </ReportParameters>"

  4. #19

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,529
    Thank Post
    513
    Thanked 2,406 Times in 1,862 Posts
    Blog Entries
    24
    Rep Power
    822
    Can I ask why you are avoiding creating a temp file to do the job? It'd save a heck of a lot of faffing with very little drawback that I can see?

  5. #20

    Join Date
    Mar 2007
    Posts
    39
    Thank Post
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    15
    Localzuk
    I've had no end of hassle with different microsoft office versions / invalid registry values / unregistered components / changed or incorrect folder and user permissions preventing me from doing what I want to do with my programs. Consequently I have re-coded (am in the process of re-coding) all my analysis systems from a mixture of Access and Excel with some VBA thrown in to stand alone, fully compiled programs written in Delphi. As you can see from my earlier post, once again folder permission reared their head when I wrote out the xml file to the same folder from which I was running my program and yet command reporter was unable to then read from that folder due to permissions and the credentials under which CR appeared to be running.

    Therefore I am trying to limit as much as possible any reading and writing of files that is not absolutely necessary. If I can get away with one single SIMS export (OK a few exports) and then do everything else via my program then I know I'm in complete control and not at the mercy of network changes and software upgrades performed by sombody else.

  6. #21

    Join Date
    Mar 2007
    Posts
    39
    Thank Post
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    15
    Arthur,
    I couldn't get it to work.
    The whole /PARAMS: value must also be in double quotes as it contains spaces and CreateProcess delimits by spaces.

    I tried
    Code:
    /PARAMS:""<ReportParameters><Parameter id=\""DDNzGLsaAUi8eGtd+3PIGw=="" subreportfilter=\""True""><Name>Mark date</Name> <Type>Date</Type> <PromptText>MarkDateBefore</PromptText><Values><Date>2011-06-11T00:01:00</Date></Values></Parameter><Parameter id=\""eNvt6kqoTcUAoHB2VMyWRg=="" subreportfilter=\""True""><Name>Mark date</Name> <Type>Date</Type> <PromptText>MarkDateAfter</PromptText><Values><Date>2010-08-15T23:59:00</Date></Values></Parameter></ReportParameters>\""'
    And got the following passed into commandreporter (actually a dummy version of CR that simply prints out its parameters)

    Code:
    Paramcount = 15
    parameters passed are:
    0:   C:\Program Files\sims\sims .net\commandreporter.exe
    1:   /USER:d
    2:   /PASSWORD:x
    3:   /REPORT:SITKA_Attendance
    4:   /OUTPUT:K:\Howards Documents\SITKA\jobs\Attendance\Delphi version\delphi code version 2\init\SITKA_Attendance.csv
    5:   /PARAMS:<ReportParameters><Parameter
    6:   id=\DDNzGLsaAUi8eGtd+3PIGw==
    7:   subreportfilter=\True><Name>Mark
    8:   date</Name>
    9:   <Type>Date</Type>
    10:   <PromptText>MarkDateBefore</PromptText><Values><Date>2011-06-11T00:01:00</Date></Values></Parameter><Parameter
    11:   id=\eNvt6kqoTcUAoHB2VMyWRg==
    12:   subreportfilter=\True><Name>Mark
    13:   date</Name>
    14:   <Type>Date</Type>
    15:   <PromptText>MarkDateAfter</PromptText><Values><Date>2010-08-15T23:59:00</Date></Values></Parameter></ReportParameters>\
    Did you get your result passing the string to CreateProcess() which then called argstest with the parameter or did you call argstest directly. Obviously there is quite a difference as there is only one layer of parsing with the latter whereas with createprocess() the line gets mangled before argstest even gets to see it.
    Last edited by iceman; 11th June 2011 at 10:59 PM. Reason: added a bit

  7. #22


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,710
    Thank Post
    220
    Thanked 2,615 Times in 1,926 Posts
    Rep Power
    777
    After a lot of trial-and-error, this is the best I can come up with (the PARAMS bit has double double quotes).

    Code:
    argstest "\"C:\Program Files\SIMS\Sims .net\CommandReporter.exe"\" /USER:"\"d"\" /PASSWORD:"\"x"\" /REPORT:"\"SITKA_Attendance"\" /OUTPUT:"\"K:\SITKA_Attendance.csv"\" /PARAMS:\"""\""<?xml version="\"1.0"\" encoding="\"us-ascii"\"?><ReportParameters><Parameter id="\"DDNzGLsaAUi8eGtd+3PIGw=="\" subreportfilter="\"True"\"><Name>Mark date</Name><Type>Date</Type><PromptText>MarkDateBefore</PromptText><Values><Date>2011-06-09T00:01:00</Date></Values></Parameter><Parameter id="\"eNvt6kqoTcUAoHB2VMyWRg=="\" subreportfilter="\"True"\"><Name>Mark date</Name><Type>Date</Type> <PromptText>MarkDateAfter</PromptText><Values><Date>2010-08-15T23:59:00</Date></Values></Parameter></ReportParameters>"\""""

  8. #23

    Join Date
    Mar 2007
    Posts
    39
    Thank Post
    0
    Thanked 2 Times in 2 Posts
    Rep Power
    15
    Thanks for your efforts Arthur but it still gets mangled when being pre-processed by CreateProcess(), which appears to do escape character conversions all of its own before even CR sees it and still splits on spaces and refuses to send out any quote chars.
    Ah well, you have pointed me in the right direction. Another project to put on my laptop for the summer holidays!

  9. #24

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,844
    Thank Post
    671
    Thanked 1,381 Times in 1,143 Posts
    Rep Power
    349
    Instead of escaping doesn't it work by interchanging single and double quotes depending on what level you are at? So start with double around the lot then the next set use single then after that double again.. either that second double works or closes the first lot and starts the second lot in which case you can start with single again.

    Not sure that made sense :s

    What about putting the string into a string variable and then passing that in as a parameter is that doable..? either the whole string or just the params part..

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. sims.net commandreporter
    By oxide54 in forum MIS Systems
    Replies: 6
    Last Post: 23rd November 2010, 11:41 AM
  2. SIMS ID Interface / CommandReporter Example
    By LosOjos in forum MIS Systems
    Replies: 10
    Last Post: 7th June 2010, 01:51 PM
  3. Need a way of running SIMS
    By sidewinder in forum Mac
    Replies: 14
    Last Post: 8th December 2009, 03:06 PM
  4. SIMS.Net CommandReporter scheduled doesn't work
    By u8dmtm in forum MIS Systems
    Replies: 9
    Last Post: 8th January 2009, 11:07 AM
  5. Running Sims standalone?
    By Outpost in forum MIS Systems
    Replies: 1
    Last Post: 11th September 2007, 09:30 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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