Problem with Rendering Reports.
Hi all,
I have created some reports using the SQL Server2005 Reporting Service and the reports are deployed properly.
To display the reports from Report server through an windows application I have done the stapes as:- Passing the URL I am getting the Report name, Parameters Name and corresponding value.
The next step is selecting a suitable format (in which format the report will save into hard disk). I have done that thing.
Now my problem is that when I am going to render(save the report into hard disk) then it is showing the error as:-"Report_Publish.RSService.ReportingService2005 has not a definition for Render." ; Here namespace= Report_Publish;Data Source=RSService and ReportingService2005 is the webservice which is coming from web reference.
I am using Visual Studio 2005.
I think in VS2005 the key Word Render is not supported.
Can any one tell me what will be the Keyword for it?
The code are given below for render:-
private void button4_Click(object sender, EventArgs e)
{
//get the format and report item from the comboboxes
Format format = (Format)cboFormat.SelectedItem;
ReportItem reportItem = (ReportItem)cboReports.SelectedItem;
//set up variables needed to call render method
ParameterValue[] parameters = GetParameters();
string encoding;
string mimeType;
ParameterValue[] parametersUsed;
Warning[] warnings;
string[] streamIds;
//render the report
byte[] data;
data = _rs.Render(reportItem.Path, format.Name,null, null, parameters, null, null, out encoding, out mimeType,out parametersUsed, out warnings, out streamIds);
//create a file stream to write the output
string fileName = txtOutputLocation.Text + "\\"+reportItem.Name + format.Extension;
System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode
.OpenOrCreate);
System.IO.BinaryWriter writer = new System.IO.BinaryWriter(fs);
writer.Write(data, 0, data.Length);
writer.Close();
fs.Close();
MessageBox.Show("File written to: " + fileName);
//Report_Publish.RSService.ReportingService2005.Gene rateXmlMappings();
}
private ParameterValue[] GetParameters()
{
ArrayList controls = new ArrayList();
//get the values from the parameter controls
int len = grpParamInfo.Controls.Count;
for (int i = 0; i < len; i++)
{
if (grpParamInfo.Controls[i] is TextBox)
{
controls.Add(grpParamInfo.Controls[i]);
}
}
//add the control information to parameter info objects
len = controls.Count;
ParameterValue[] returnValues = new ParameterValue[len];
for (int i = 0; i < len; i++)
{
returnValues[i] = new ParameterValue();
returnValues[i].Name = ((TextBox)controls[i]).Name;
returnValues[i].Value = ((TextBox)controls[i]).Text;
}
return returnValues;
}
Somesh Chatterjee
__________________
somesh chaterjee
|