Normal Topic Uploading A Report Via FTP (Read 2527 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Uploading A Report Via FTP
Sep 27th, 2022 at 7:44pm
Print Post Print Post  
Hey folks -- I am working on some test code to automate uploading an HTML file to a web server via FTP.  Everything about the upload is going great, but not the actual report.

When Sesame generates a report, it puts a date at the end.  How can I run the report, and then save it elsewhere under a default name?

Thanks!
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Uploading A Report Via FTP
Reply #1 - Sep 28th, 2022 at 1:52pm
Print Post Print Post  
Hi Blair,

If you are using @PrintAReport, the mode of REPORT_MODE_HTML_GENERATE will return the exact name of the report that was generated. From there you can either use the File I/O commands to read it in and write it out to a different directory and name, or use @Shell to call the dos MOVE command which can move and rename, or use that filename in the FTP PUT command as the local filename and give it the standard name as the remote filename.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
cbislander
Full Member
***
Offline



Posts: 103
Joined: Mar 22nd, 2018
Re: Uploading A Report Via FTP
Reply #2 - Oct 1st, 2022 at 12:39pm
Print Post Print Post  
Below is what I use in my program layout to generate reports.


var vTmp as String
var vTmp1 as Int
Var vCopyReport as String
Var vCopyRun as Int



     If @Mode() = 1
     {
           // This prints the report to HTML Preview with default settings.
           // See the documentation for @PrintAReport for other settings you can use.
           vTmp = @PrintAReport("FRED SPC ARR", 1, 1, 0, -1, -1, -1, -1, -1, -1)
           vCopyReport = "Copy "+ vTmp +" z:\SPC-FRED.HTM"
           vCopyRun = @Shell(vCopyReport)
           
     }

vCopyReport = "TASKKILL /IM chrome.exe /F"
vCopyRun = @Shell(vCopyReport)

ExitSesame()
  
Back to top
 
IP Logged