Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set Destination folder path programatically

Status
Not open for further replies.

4RRRR

Programmer
Mar 11, 2004
34
US
Hi All,

I am trying to set/change the destination directory path from my c# code. I need to change this path on my test server. I downloaded samples, i couldn't find any where how to change or methods.

btw - is there any book like complete .net sdk reference.

thanks a lot.
 
Give this a try using the report engine object model.
crDiskFileDestOptions = New DiskFileDestinationOptions()
crDiskFileDestOptions.DiskFileName = FName

for file name I use something like this depending on which format i am exporting.

TempReportPath = ConfigurationSettings.AppSettings("TempReportPath")

If RptViewerType = "WORD" Then
FName = TempReportPath & CrystalEventID & ".doc"
Else 'default to Adobe Acrobat Reader
FName = TempReportPath & CrystalEventID & ".pdf"
End If

 
cjlareu thanks a lot for your reply.

Actually I need change this on server schedule destination property. I have 2 servers one is prod and test. After test synched from prod, I need to change the paths to refer test server.

in CMC, Schedule->Destination->Destination Directory
I am trying to change the destination directory.

thanks again.
 
Cjlarue,

this is what I am trying to do.
DestinationPlugin ceDisk = new DestinationPlugin(ceDestinationObject.PluginInterface);

//Create a diskUnmanagedOptions object and its ScheduleOptions from the Destination plugin
DiskUnmanagedOptions ceDiskOpts = new DiskUnmanagedOptions(ceDisk.ScheduleOptions);

for (int i=1; i<=ceDiskOpts.DestinationFiles.Count; i++)
{
ceDiskOpts.DestinationFiles.Delete(i);
}



ceDiskOpts.DestinationFiles.Add(@"\\disk1\development\temp\ScheduledToDisk.rpt");
//instead of giving reportname(including fullpath), I would like to set the directory path. it seems to me there is no method available in DiskUnmanagedOptions to set the directory path or may be I am looking at the wrong object.



}


//Copy the properties from the Destination Plugin object into the report's scheduling
//information. This will cause the file to be transfered to Disk after it has been run.
Destination ceDestination;
ceDestination = ceSchedulingInfo.Destination;
ceDestination.SetFromPlugin(ceDisk);

//schedule report
ceInfoStore.Schedule(ceReportObjects);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top