List Info

Thread: Re: Get report from url returned by getReportOutputUrl




Re: Get report from url returned by getReportOutputUrl
country flaguser name
United States
2007-08-30 08:55:02

How do you read the file into a HTTP response stream? What do you use
in C#? If possible could you paste you code here and i will try
convert to PHP.

Thaanks
Dermot

__._,_.___
.

__,_._,___
Re: Get report from url returned by getReportOutputUrl
country flaguser name
United States
2007-08-30 08:59:48

> How do you read the file into a HTTP response stream? What do you
use
> in C#? If possible could you paste you code here and i will try
> convert to PHP.
>;
> Thaanks
> Dermot

Below is a VERY stripped down version of how to get the Report back
as a zipped XML file.

private static void ProcessReport( int reportId,
BasicReportServiceService reportService )
{
FileOutputFormat fileOutputFormat = new FileOutputFormat
();
fileOutputFormat.fileOutputType = FileOutputType.XML;
fileOutputFormat.fileOutputTypeSpecified = true;
fileOutputFormat.zipped = true;
fileOutputFormat.zippedSpecified = true;

//get the secure URL of the report
string reportUrl = reportService.getReportOutputUrl( reportId,
fileOutputFormat );

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(
reportUrl );

using ( HttpWebResponse webResponse = (HttpWebResponse)
webRequest.GetResponse() )
{
using ( ZipInputStream zipStream = new ZipInputStream(
webResponse.GetResponseStream() ) )
{
ZipEntry zipFile = zipStream.GetNextEntry();

/* Read from zip file here */
}
}
}

__._,_.___
.

__,_._,___
RE: Re: Get report from url returned by getReportOutputUrl
country flaguser name
United States
2007-08-31 03:19:21

Hi there,
 
Your making things more difficult than they have to be. You dont have to request the report in zip format, you can get it as raw XML data. My client is written in VB, but im sure this will help.
 
Before you request the report you create a fileformat object:
 
Dim fileoutputformat As New BasicReportService.FileOutputFormat
fileoutputformat.fileOutputType = BasicReportService.FileOutputType.XML
fileoutputformat.fileOutputTypeSpecified =
True (Here you are saying no zip please just XML)
fileoutputformat.zippedSpecified = False
 
Now when you check ont he status of the report you pass it in as follows:
 
downloadurl = reportobject.getReportOutputUrl(report.reportID, fileoutputformat) (Request your report in XML, no zip etc)
 
Hope that helps, I'll let you "php-ize" the above ;)
 ;
Justin
 
 
 

 


To: yws-searchmarketingyahoogroups.com
From: dermotdoneganyahoo.com
Date: Thu, 30 Aug 2007 13:55:02 +0000
Subject: [yws-searchmarketing] Re: Get report from url returned by getReportOutputUrl

How do you read the file into a HTTP response stream? What do you use
in C#? If possible could you paste you code here and i will try
convert to PHP.

Thaanks
Dermot




Get the ultimate real-time chat experience - Windows Live Messenger! Windows Live Messenger

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )