If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Save to Local File

Started by bcrandall, 18 Jul 2006 04:54:23 PM

Previous topic - Next topic

bcrandall

Anyone know how to save Report Studio output to a local file, rather than the Report Studio server?  I heard it is possible using the SDK, but I did not get any details.

Any help you can offer will be greatly appreciated.

- Brian

mrcool

Hi...Hope this will help u...
The 'execute' method is called on a specific report with the option to save the report output set to true.  Then a new method is called which calls the SDK 'query' method to see if the saved output exists - more than one output may be found. Each output has a default name which is a timestamp of when the report was saved. Each saved output is extracted from the Content Store and saved to the local file system in the path specified.

Steps:

In ReportNet for example:

To run the sample:

1) Modify the following hard coded values in the main method of SaveReportAndExtractOutput.java
to reflect your own environment:

// CRN endpoint
String endpoint = "http://localhost/crn/cgi-bin/cognos.cgi";
// local file location where the output will be saved
String savePath = "F:\\Program Files\\Cognos\\crn\\webcontent\\samples\\";
// search Path to an existing report
String searchPath = "/content/package[@name='GO Sales and Retailers']/folder[@name='Documentation Report Samples']/report[@name='Add Color']";
// name of the report
String reportName = "Add Color";
 
// use this if anonoymous logon is disabled in Cognos Configuration
String userName =  "user";
String passWord =  "password";
String nameSpaceID = "namespaceID";

2. If you are not using anononymous logon, uncomment the following line if logon is required.

//connect.quickLogon(nameSpaceID, userName, passWord);

3. Compile and execute the sample code. Information on the ReportNet Java Toolkit can be found in Chapter 1 of the ReportNet SDK Getting Started Guide in the ReportNet Java Toolkit section.


mrcool

All Cognos ReportNet reports are saved in Content Manager as XML specifications.

In order to save a report outside of Content Manager to a file system you have to enable a download feature.

Steps -

1. Edit the system.xml file found in the crn\templates\ps\portal directory.

    Open the file in your favorite editor and search for the following string:

    "Allow downloads of saved reports section"

2. Enter the format that you want for download. For this example, enter HTML.

3. Stop and restart the Cognos ReportNet service.

4. After restarting the service, navigate to the saved outputs of a report and note that there is now a download HTML icon beside the HTML saved output.

5. Click the Download icon and click the Save button. Specify a drive and filename and click Close.

6. In Windows Explorer it should now be possible to open the html file of the saved report.



brain1e55

Here is another method:


Quote1. In Cognos Connection, click the Server Administration link.

2. In the Server Administration page, under Type, click the Services radio button and then choose Content Manager in the drop-down menu.

The Content Manager service appears below the drop-down menu.

3. Under the Actions column, click the set properties button.

4. Click the Settings tab.

5. Under the Value column, click Edit.

6. In the Set advanced settings - ContentManagerService page, select the Override the settings acquired from the parent entry check box.

A table appears, in which you can add parameters.

7. Under Parameter, click in a cell and type

CM.OUTPUTLOCATION

In the corresponding Value cell, type the file system location where you want to store report outputs.

If you want to specify a shell script, such as a .bat or .sh file, that will run after a report output is saved to the target directory, do the following:

Under Parameter , click in an empty cell and type

CM.OUTPUTSCRIPT

In the corresponding Value cell, type the location and the name of the script.

The full file names of the output file and descriptor are passed to the script. For example, c:\reportnet\146_1062107695000.pdf c:\reportnet\146_1062107695000_desc.xml.

8. Click OK.

Copies of saved report outputs are placed in the location specified. Old report versions are not deleted when a new one is saved. You must manage the content of the output directory to keep the report versions you want.

mrcool


tpaddack

I tried your method in Replay #3, but no file was saved to that location.

I tried both a network path '\\<machine name>\<directory>' and a relative path within the server 'F:\<directrory>' for the parameter CM.OUTPUTLOCATION. 

I did NOT specify the parameter for the script.

We are on Cognos 8.1.209.  Does that make a difference?  Do I have to enable something else?

Any ideas?