Page 1 of 1
Command Line Assistance, Please
Posted: Fri May 14, 2010 8:45 am
by Andy
I am using a command line similiar to this:__rswrun.exe /U<UserID> /P<Password> /TT"C:Documents and Settings<User Directory>Application Data<Directory>
c2078.dt" /O"C:Documents and Settings<User Directory>Application Data<Directory>
o2078.dt" /B____The Report Viewer can read the control files and write to the output files just fine. There is no problem with the command line. ____The issue I have is that the path has to be entered for the /TT and /O switch. Is there a way I can use a common path for the directory where I want the Control File and the Output file? If the User Directory is long, I could lose part of the /O switch. I don^t know where it is occurring, but it seems that if the path for /TT or /O is too long, characters are truncated at some certain point. I am having a real problem with the length of the path and the User Directory in the Command Line. Y^all have gone through your code and you cannot find anything that restricts the number of characters in the command line or the switches, so I do not know what causes the characters to be truncated or where it is occurring.____For one solution, I have tried to use the the Environment Variable %APPDATA%.__If I use this command line from the command prompt, the report is shown as expected.__rswrun.exe /U<User ID> /P<Password> /TT"%APPDATA%<Directory>
c2412.dt" /O"%APPDATA%<Directory>
o2412.dt" /B____However, when I use the same command line from a Windows Process in VB.Net, I get an error from the Report Viewer saying it cannot find %APPDATA%<File Name>. __I have also tried this command line.__rswrun.exe /U<User ID> /P<Password> /TT%APPDATA%"<Directory>
c2412.dt" /O%APPDATA%"<Directory>
o2412.dt" /B__But the Report viewer tells me it cannot find the file in the switch. __How can I use an environment variable in the command line? ____I have also tried using the /D switch, but that is for the data directory, not the default application data directory. Is there a similar switch that can be used that would act as the holder for the path so I don^t have to keep repeating the path in the /TT and /O switches?____A solution I haven^t tried, as I don^t know if it exists, is to build a Control File similar to that for the Report Viewer. Is there something that can be used for the command line to use to build the switches?____I don^t have a solution for what I am trying to accomplish, so any assistance would be greatly appreciated.____Thank you in advance.
=> RE: Command Line Assistance, Please
Posted: Sun May 16, 2010 9:13 pm
by kfleming
Can you simply put the files in the same folder as rswrun.exe and not use a path at all?____Kathleen__R&R Support
==> RE: Command Line Assistance, Please
Posted: Mon May 17, 2010 9:15 pm
by Andy
No, I cannot. There are instances where the end-user has the files used for our application in a folder that is ready-only, which includes the rswrun.exe. We use the default data directory, as that directory is not read-only. It also holds all the files used for logging events and errors for debugging purposes, so it is the logical choice from our perspective.____It is true if I do not use the path, I do not have any issues with the Report Control or Status Output files. I found out the hard way I cannot always use the same folder as rswrun.exe, so I have to use paths.
==> RE: Command Line Assistance, Please
Posted: Tue May 18, 2010 9:15 pm
by Andy
No, I cannot. There are instances where the rswrun.exe file is in a directory that is read-only. A user of the rswrun.exe could conceivably have the application that calls rswrun.exe on a server in a read-only directory so users cannot add, delete or modify files. ____An output status file is written when the report is finished. If there is no /O switch, the status report will be written to the directory with the rswrun.exe, so I have to have a path for the status report. Since I am not using the OCX, rswrun.exe needs to know how to build the report. Since these reports are built dynamically, I have to have a control file. Again, because the directory with rswrun.exe could be in a read-only directory, I have to have someplace to store the control file, so I have to use the /TT switch to tell rswrun.exe how to build the report.____I can^t use %APPDATA%, as rswrun.exe does not recognize it. I don^t have any way of using a common path for the switches, so I have to add the path to each switch. I cannot find if there is a file that I can use to hold the path for the switches that is similar to the control file for the reports. I haven^t found a switch that could be used as a common path either.____So, what do you suggest I could use, since putting the control and status files in the same directory as the rswrun.exe is not an option?____Thank you in advance for your assistance.
=> RE: Command Line Assistance, Please
Posted: Mon May 24, 2010 9:30 pm
by kfleming
If the command line works from a command prompt but not from your VB app, then it may be your syntax that is causing a problem.__If rswrun is complaining about %APPDATA% is is because it is being given that as a literal.____I would try adding extra quotes around each of the discrete pieces of the command line and see if that helps.______Kathleen__R&R Support
==> RE: Command Line Assistance, Please
Posted: Tue May 25, 2010 9:58 pm
by Andy
I tried adding %APPDATA% in quotes, as was suggested, but I still get the same error that rswrun.exe cannot fing the directory %APPDATA%etc.____Thank you.