Listing 1

CatalogItem[] catalogItems = null;
ReportingService  rs = new ReportingService();

// Authenticate to the Web service using Windows credentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Assign the URL of the Web service
rs.Url = "http://localhost/ReportServer/ReportService.asmx";

// Main part of method
if (catalogItems != null)
   {
       foreach ( CatalogItem ci in catalogItems )
       {
       // Create a ListView item containing a CatalogItem
          CatalogListViewItem newItem = new CatalogListViewItem( ci );
          newItem.ImageIndex = 
		  rs.GetTypeIndex(newItem.Item.Type);
          ListView.Items.Add(newItem);
       }
   }


Listing 2

using System.IO;
using System.Diagnostics;

rs = new ReportingService();

// Authenticate to the Web service using Windows credentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Assign the URL of the Web service
rs.Url = "http://localhost/ReportServer/ReportService.asmx";

string fileName = "PDFSampleReport.pdf";

// Prepare Render arguments
string historyID = null;
string deviceInfo = null;
string format = "PDF";
string showHide = null;
ParameterValue[] parameterVals = new ParameterValue[1];
DataSourceCredentials[] credentials = null;
Byte[] results;
string encoding;
string mimeType;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string[] streamIDs = null;

ParameterValue param = new ParameterValue();
param.Name = "SalesID";
param.Value = "321321";
parameterVals[0] = param;

results = rs.Render("/SampleReports/PDFSampleReport", format,
          historyID, deviceInfo, parameterVals, 
		  credentials, showHide, out encoding, out mimeType, 
		  out reportHistoryParameters, out warnings, out streamIDs);

// Create a file stream and write the report to it
File.Delete(fileName);
FileStream stream = File.OpenWrite(fileName);
stream.Write(results, 0, results.Length);
stream.Close();

Process myProcess = new Process();
myProcess.StartInfo.FileName = fileName;
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
myProcess.Start();