Jump to content
We've recently updated our Privacy Statement, available here ×

graham.smith

Members
  • Posts

    8
  • Joined

  • Last visited

graham.smith's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Looks as though the timeouts are a random anomaly. Other times it runs but with no returned reponse. However, the times it runs, I can see a 401 status code returned. This is something to do with authentication I am guessing - so presumably I need to enter some credentials somehow - maybe in the reportExecutionRequest XML?
  2. I've been playing around with some vbscript to try and figure out how to format and send a valid ReportExecutionRequest to run a report, and then retrieve the output as a PDF file I can save somewhere - but haven't got very far (knowing very little about calling and using webservices - to me, SOAP is something you wash your hands with, and REST is what you need after the grandchildren have visited - it's all foreign to me). So this is as far as I have got, using various bits and pieces from scripts I've found online. The result is that the http.send just times out. ' VBScript to setup and call JasperServer RESTful APIs to execute a report. ' create xmlHttp objectset http = createObject("msxml2.serverxmlhttp.6.0") ' create XML Execution RequeststrExecReq = "<reportExecutionRequest>" &_ "<reportUnitUri>/TMS_Reports/Emergency_Evacuation_Checklist</reportUnitUri>" &_ "<async>true</async>" &_ "<freshData>false</freshData>" &_ "<saveDataSnapshot>false</saveDataSnapshot>" &_ "<outputFormat>pdf</outputFormat>" &_ "<interactive>false</interactive>" &_ "<ignorePagination>false</ignorePagination>" &_ "<parameters>" &_ "<reportParameter name=""EvacuationSite"">" &_ "<value>BI</value>" &_ "</reportParameter>" &_ "</parameters>" &_ "</reportExecutionRequest>" ' Run the report synchronously (i.e. waits for it to finish)http.open "POST", "http://localhost:8080/jasperserver/rest_v2/reportExecutions", falsehttp.SetRequestHeader "Content-Type", "text/xml"http.setRequestHeader "Content-Length", Len(strExecReq)http.send strExecReq ' http response (should contain request ID?)WScript.Echo http.responseText Any advice would be gratefully received :) Thanks, Graham
  3. Thanks Hozawa - I think that your answer is probably the same as the first half of joseng62's. I am limited to running this report from a commandline (including passing it parameters), and then saving it as a PDF file, which I then need to email to someone (also from commandline or scripting), and the whole job is an automated hands-off function that is triggered when a fire alarm goes off. Joseng62 - I haven't followed your links through fully yet, but from your description, it sounds like kind of solution I need... a script that accepts appropriate parameters, and includes all the REST API calls to execute the report. Perhaps I can make a generic script to allow the call of ANY report with ANY parameters to make it more flexible. Many thanks both, for taking the time to reply.
  4. I have just built my first report in Studio 6.6.0, and successfully published it to the report server. I can run the report from within both the Studio and ReportServer GUIs, but I'd like to be able to run the report from a .BAT or Powershell script running on the same server as ReportServer, and get it to put the report output to a PDF file. I found a few forum entries asking the same question - but none have a recent answer, and I couldn't really follow the answers I did find. I am somewhat new to the world of Java, Apache and Tomcat - so if some aspect of these is required to allow me to run a report using commandline, then please lead me gently through the process. I have downloaded the jasperreports-6.6.0-project.zip file, which some say tells me everything I need to know - but I don't know where to start among the 60MB+ of content there either. Many thanks in advance Graham
  5. SOLVED - it appears that it WAS the minimum length record that was causing the substring to fail, even though it was in a part of the IF statement that ensured it would not be executed. I confirmed this by amending the SQL Select to only pick out records where the NAMES field was longer than 5 characters, and was then able to get substring(0,5) to work as well. The solution was to change the select statement to cast the NAMES field as char(25), to make sure that the field was always longer than the longest name, rather than being potentially shorter on the records that have short names.
  6. I've been looking into the substring expression a little more. By substituting actual numbers rather than the result of a function, I find that I can do .susbtring(0,1) and get the first letter... great. I can also go to substring(0,2) or substring(0,3) and get either the first two or three characters. HOWEVER, when I go to substring(0,4) - that's when it all falls apart and the report keeps failing. Now - I have noticed that the shortest name in the list is 'Max' which is 3 characters - is this coincidental, or significant? As that record is just a single name, then in theory, it should not be processed by the second action in the statement - unless the actions are validated against ALL records?
  7. Hi all - I'm new to using Jaspersoft, and am having some trouble understanding the operation of the Expresion Editor in Studio 6.6 - especially for expressions with multiple parts - such as an 'If - Else'. The editor brings up three boxes for the three parts (condition - action if true - action if false), and it seems to be stable as long as each of the three has correct syntax. However being new, I am still coming to terms with how to use the interface, and find that when I get one of the boxes wrong - I end up losing the whole statement and have to start again. I got so frustrated with it last night, that I resoted to hacking the XML code instead of using the Expression Editor. Is there a good 'in-dpeth' resource to help familiarise me with this tool, that explains its use with more complex expressions, and combining expressions, etc? As an example - one of the tasks I am trying to do is pull the first name out of a user name field, where that field may have just one name, or multiple names separated by a space. So I have a Variable called 'FirstName' configured with the expression... IF($F{NAMES}.indexOf(" ") == -1, $F{NAMES}, $F{NAMES}.substring(0,$F{NAMES}.indexOf(" "))) The last element of this expression is causing me problems (any help with that would be greatly appreciated), but each time I try something new in that element via the Expression Editor - I end up losing the rest of the expression and just my new trial code being left in its place. I am sure it is simply down to my understanding of the product and lack of experience - but it is sure getting frustrating. Any advice would be greatly appreciated. Thanks in advance Graham
×
×
  • Create New...