Hi
We use Cognos8 in web Asp.net(with c#) application. We have a requirement of saving cognos reports in PDF in local directory, we could save the reports in pdf format in content store but not in local directory... Please advice.. Thanks in advance...
I would generate the report as a PDF and put it in the Content Store (like normal) then use this code to copy it out to another location:
public bool doCopy(contentManagerService1 c8CMS, string reportPath, string targetPath, ref string resultMessage)
{
if (c8CMS == null)
{
resultMessage = "...the Cognos 8 Server connection is invalid.\n";
return false;
}
report rReport = new report();
stringProp reportToCopy = new stringProp();
reportToCopy.value = reportPath;
rReport.searchPath = reportToCopy;
baseClass[] bcaCopy = {rReport};
copyOptions cpOptions = new copyOptions();
searchPathSingleObject targetPathSO = new searchPathSingleObject();
targetPathSO.Value = targetPath;
// sn_dg_sdk_method_contentManagerService_copy_start_0
baseClass[] bcaCopyResults = c8CMS.copy(bcaCopy, targetPathSO, cpOptions);
if (bcaCopyResults.GetLength(0) > 0)
{
//returns the number of successfully copied baseClass objects
resultMessage = "...the report has been successfully copied to : " + targetPath + ".\n";
return true;
}
// sn_dg_sdk_method_contentManagerService_copy_end_0
else
{
resultMessage = "...copying the report to : \"" + targetPath + "\" failed.\n";
return false;
}
}
I would like to hvae the code to save as pdf .... becoz my code works for html format and bombs for pdf...
Thanks in advance...