+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 27
MIS Systems Thread, CommandReporter param files and parameter IDs in Technical; First post incoming.... I have a SIMS report that runs successfully from within SIMS and I can run it from ...
  1. #1

    Join Date
    Sep 2011
    Location
    Southampton
    Posts
    13
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Question CommandReporter param files and parameter IDs

    First post incoming....

    I have a SIMS report that runs successfully from within SIMS and I can run it from the command line and generate a params file for it. My intention is to change the dates for a certain bounding parameter dependant on values entered into another script. This parameter is a filter clause and is set to "Prompt at runtime" for just this reason but even so the report requires me to enter 2 "default" date values for 'Start' and 'End' dates.

    The generated paramsfile has 2 issues for me:

    1. The XML is not fully fleshed out by including the "default" start and end dates and therefore requires checking of the schema and/or guesswork in order to create the required XML.
    2. The parameter ID seems to be dependant on the information entered into the clause in the report and I have no way of generating a new one. For example changing either of the "default" dates or the prompt text causes the ID to change.


    Here is the relevant part of the paramsfile as generated using CommandReporter with the /PARAMDEF switch:
    Code:
    <Parameter id="tzSA86rr9eK9xo8FOcP5Uw==" subreportfilter="True">
    	<Name>Active</Name>
    	<Type>DateRangeRange</Type>
    	<PromptText>Active during</PromptText>
    	<Values />
    </Parameter>
    You can see the blank <Values /> element is where I hoped the "default" dates would be.

    Using the inline schema I reckon the fully fleshed out version with example dates should look something like this:
    Code:
    <Parameter id=tzSA86rr9eK9xo8FOcP5Uw==" subreportfilter="True">
    	<Name>Active</Name>
    	<Type>DateRangeRange</Type>
    	<PromptText>Active during</PromptText>
    	<Values>
    		<DateRange>
    			<Start>2011-09-01T00:00:00</Start>
    			<End>2011-09-20T23:59:59</End>
    		</DateRange>
    	</Values>
    </Parameter>
    However, with the completed params file sorted and saved as above and read back in by the CommandReporter this section seems to get ignored and the report runs with the date values which are stored in the actual report. Either the format of the <Values /> element is wrong or the parameter ID is now wrong.

    If the <Values> element is wrong how do I find out what the correct syntax should be? If the parameter ID is dependant on the contents of the parameter as some sort of encoded hash how do I generate it? My feeling is that the structure is right but the ID is now wrong but any help here would be very gratefully received.

    Thanks in advance,

    Polski

  2. #2

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,843
    Thank Post
    671
    Thanked 1,381 Times in 1,143 Posts
    Rep Power
    349
    I don't think guessing will work as you've found. You need to find out why the values are not being output, and then fix that.
    Can you try it without a prompt at run time, just hardcoded. This may populate the params file and allow you to just tweak the date data in the relevant tags?
    I'm sure someone else had this a while ago, will just check that thread.

  3. Thanks to vikpaw from:

    DoctorPolski (21st September 2011)

  4. #3

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,843
    Thank Post
    671
    Thanked 1,381 Times in 1,143 Posts
    Rep Power
    349
    Ignore what i said, you need prompt at run time ticked.
    Just need to put default dates in. Maybe put them in, in design mode and save it, then run it. That usually keeps them there for the next user.
    Check this thread - especially the bit from about post 30 onwards.
    SIMs and Command Reporter

  5. #4

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,843
    Thank Post
    671
    Thanked 1,381 Times in 1,143 Posts
    Rep Power
    349
    Your parameter type is daterangerange is that correct or just a typo? When i did it before it was just daterange.

  6. #5

    Join Date
    Sep 2011
    Location
    Southampton
    Posts
    13
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the response vikpaw.

    I read through that thread you linked, it came close but not close enough. None of those examples used a type of DateRange which it *appears* from the inline schema of the /PARAMDEF file I need to use.

    As it seems you may have already discovered if you don't have the "prompt at run time" ticked then the generated param file has no mention of that particular element at all. Having "prompt at run time" ticked gives the example in my first post which just has an empty <Values /> element. I have no choice but to supply dates in the report designer on SIMS so there are default dates in there.

    The parameter type of "DateRangeRange" is what is generated by the CLR with /PARAMDEF. I have tried it with just "DateRange" to no avail.

    Any thoughts on the parameter ID? This changes if I change the default dates in the report designer so how can it ever be correct in my params.xml when it is read back into clr?

    Am I right in thinking that I need to sign NDA's and stuff just to get documentation for the CLR which is a part of the SIMS software we already license and use in school?

  7. #6

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    Quote Originally Posted by DoctorPolski View Post
    Any thoughts on the parameter ID? This changes if I change the default dates in the report designer so how can it ever be correct in my params.xml when it is read back into clr?
    Having created a few automated reports using CLR, I can tell you the ParamDef changes whenever you save the report in SIMS, so you will need to check it each time you make an alteration. Once it works how you want it to though it won't be a problem (as long as you don't make any more changes to it!)

    Quote Originally Posted by DoctorPolski View Post
    Am I right in thinking that I need to sign NDA's and stuff just to get documentation for the CLR which is a part of the SIMS software we already license and use in school?
    Supposedly yes, however I have tried repeatedly to obtain said documentation to no avail (my local support don't know what I'm talking about). Trial and error is key, there are quirks but it is quite simple to use once you get the hang of it.

    I did write a script for another member here a few months back that set the date range based on the current date, I'm just trying to find the thread... hopefully the code from that will help us figure out why your paramdef isn't working...

  8. #7

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    I've found the thread and can't see anything that I did differently (I would definitely make sure the "Type" is "DateRange" though).

    One thing that does come to mind - are you using a ParamsDef XML file, or trying to pass the XML straight in to CLR? I have never had any luck passing XML, I always create an XML file and pass that as the argument.

    [If you're interested, the thread I was referring to is here: SIMS.net Reporting]

  9. #8

    Join Date
    Sep 2011
    Location
    Southampton
    Posts
    13
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks LosOjos, it's good to know the parameter ID can be set then forgotten.

    I have a little progress I think. Here is my param file:

    Code:
    <ReportParameters>
    	<Parameter id="tzSA86rr9eK9xo8FOcP5Uw==" subreportfilter="TRUE">
    		<Name>Active</Name>
    		<Type>DateRangeRange</Type>
    		<PromptText>Active during</PromptText>
    		<Values>
    			<DateRange>
    				<Start>2011-09-06T00:00:00+01:00</Start>
    				<End>2011-09-20T23:59:00+01:00</End>
    			</DateRange>
    		</Values>
    	</Parameter>
    </ReportParameters>
    I have tried it with and without the timezone addition in the DateTime fields but it made no difference. The interesting thing is highlighted in red. When this value is set to ALL CAPS I get the output as if I was running the report without prompting at runtime, that is to say using the default dates in the report. If it is "True" as per the /PARAMDEF then I get no output at all, well I get the output file schema but with no actual data. Does that mean that having all caps is rejected and so it goes with the value in the report? If so and if "True" is correct then it must be trying to use my parameter but somehow failing.

    I am using a param file rather than supply an xml snippet on the clr. That way I can edit the file and test.

    If it matters the parameter is supplying the "Active during" filter/clause for Group Membership (Historical). The report allows 'active on' which reqires a single datetime field or 'active during' which requires 2 datetime fields.

  10. #9

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    I'm scratching my head with this one... I am going to assume that using "TRUE" simply causes SIMS to reject the XML and go for default values instead, as I use "True" successfully in my reports and theoretically it should be the same for you.

    Other things that come to mind are that there's a problem somewhere else in your XML... are you including the XML schema? I don't, so if you do try removing it.

    I know you have already said this is just a snippet, but just to confirm you are opening and closing your XML with "<ReportParameters>" and "</ReportParameters>" respectively?

    If you really are at a loss with it, I don't mind taking a look at your full XML, just post it here or PM me and I'll take a look for you if you want me to.

  11. #10

    Join Date
    Sep 2011
    Location
    Southampton
    Posts
    13
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks again mate.

    This is the full contents of my params.xml file:

    Code:
    <ReportParameters>
    	<Parameter id="tzSA86rr9eK9xo8FOcP5Uw==" subreportfilter="True">
    		<Name>Active</Name>
    		<Type>DateRange</Type>
    		<PromptText>Active during</PromptText>
    		<Values>
    			<DateRange>
    				<Start>2011-09-06T00:00:00</Start>
    				<End>2011-09-19T23:59:00</End>
    			</DateRange>
    		</Values>
    	</Parameter>
    </ReportParameters>
    It represents my best shot at this. I've changed
    Code:
    <Type>DateRangeRange</Type>
    from the /PARAMDEF output to
    Code:
    <Type>DateRange</Type>
    as I agree that makes sense.

    I did even try changing
    Code:
    <DateRange>
    to
    Code:
    <DateRangeRange>
    so it matched the /PARAMDEF output but to no avail.

    I have used the datetime with and without timezone, I have removed all the tabs so it is one unbroken line. I'm not sure what else I can try.

    Thanks for your continued help though.

  12. #11

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    This is very odd, I can't see any problem whatsoever with your XML...

    Just a couple of things to check:
    - That the report runs as you would expect it to from SIMS
    - That you are definitely using the parameter ID as given by the latest version of the report (re-run paramdef to make sure)
    - That you have not ticked "accept all" to bypass the filter by default in SIMS before saving it (to check, open up the report filter page, click modify on the date filter and see if it is checked. If it is, un-check it, close the window, save the report and don't forget to get the new parameter ID from the paramdef)

  13. #12

    Join Date
    Sep 2011
    Location
    Southampton
    Posts
    13
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Yep the report runs as expected in SIMS, I can easily check it's working by supplying and earlier start date and seeing 5 more lines in the onscreen output. The parameter ID is definitely correct, I check it every time with /PARAMDEF everytime I even look at the report design.

    Now, on the window to modify the filter there is no option to "accept all" although I have seen that elsewhere. Interestingly when I run the report from within SIMS the pop-up window that asks you to supply the dates does have that option underneath but it is not checked.

    The thing is though, the only way I can get the report to run with the default dates from the report is to change that True to TRUE. Otherwise my output contains xml schema for the output but no records.

  14. #13

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    Very strange... and I am finding it odd that your default values don't come out in the paramdef, just tried it on one of mine using a DateRange and that does.

    Last idea I have is if you'll let me try the report on my system? If you go to "Reports > Export", then Zip it and either post it in here or PM me for my email, I'll try running it on my system and see if I can spot anything more from that (don't worry about data protection, only the fields used in the report are exported, no actual student data will be [just in case])

  15. Thanks to LosOjos from:

    DoctorPolski (21st September 2011)

  16. #14

    Join Date
    Sep 2011
    Location
    Southampton
    Posts
    13
    Thank Post
    3
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    OK here is the report:

    Timetable_Members_2.zip

    Good luck.

  17. #15

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,432
    Thank Post
    1,432
    Thanked 1,160 Times in 794 Posts
    Rep Power
    705
    I'm completely at a loss. It's no help to you I know, but the only conclusion I can come to is that there is a problem with that particular sub report ("Group Membership (Historical)") and CLR, because using any other date based filter in a sub report is working for me, but that one just won't.

    Next step - what is it you're trying to extract? Perhaps there is another [CLR friendly] way we can go about it?

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Mass Copy of Files and Folders
    By originofsymmetry in forum Scripts
    Replies: 6
    Last Post: 2nd October 2007, 12:16 PM
  2. Restrict "Search files and folders"
    By sandfie in forum Windows
    Replies: 4
    Last Post: 26th March 2007, 10:45 PM
  3. Replies: 4
    Last Post: 15th November 2006, 03:19 PM
  4. files and settings transfer wizard
    By beeswax in forum Windows
    Replies: 2
    Last Post: 17th May 2006, 08:25 AM
  5. Monitoring of Staff and Student files and emails
    By mark in forum School ICT Policies
    Replies: 12
    Last Post: 12th July 2005, 12:01 PM

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
  •