Click here to Skip to main content
16,017,261 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Please Help me out guys,Im fighting with this requirement from the last one month....:-(



Thanks in Advance.....
Posted
Updated 22-Jul-12 18:53pm
v3
Comments
Sandeep Mewara 20-Jul-12 17:38pm    
bind a rdl Report in c#.Net
Bind to what?
varadaanil 23-Jul-12 0:36am    
Thanks for your reply sandeep

I need to bind the report to a HTML div tag (<div>.....</div>).

I need to bind the report to a HTML div tag (<div>.....</div>).
You cannot bind report to div tags. In order to render an rdl and show in UI, you would need a report viewer control.
 
Share this answer
 
Comments
varadaanil 23-Jul-12 2:06am    
But i heard that it is possible by using ReportingService2010.cs proxy class.
Sandeep Mewara 23-Jul-12 7:16am    
Where did you heard? I doubt it's authenticity.
1)Add Reporting Service2005 and Report Execution Service web services as a web references to your application.

2)The Reporting Service and Report Execution Service Web Services enables you to manage a report server.

http://localhost/ReportServer/ReportService2005.asmx
http://localhost/ReportServer/ReportExecution2005.asmx

By using these url`s you can add the web references to your application

3)Method to generate a Report
public string GetDashBoard(string reportpath)
{
try
{
RS2005.ReportingService2005 rs = new RS2005.ReportingService2005();
RE2005.ReportExecutionService rsExec = new RE2005.ReportExecutionService();


rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;


rs.Url = "http://localhost/reportserver/reportservice2005.asmx";
rsExec.Url = "http://localhost/reportserver/reportexecution2005.asmx";

string historyID = null;
string deviceInfo = null;
string format = "HTML4.0";
Byte[] results;
string encoding = String.Empty;
string mimeType = String.Empty;
string extension = String.Empty;
RE2005.Warning[] warnings = null;
string[] streamIDs = null;

string _reportName = @"/" + reportpath+ "";
string _historyID = null;
bool _forRendering = false;

RS2005.ParameterValue[] _values = null;
RS2005.DataSourceCredentials[] _credentials = null;
RS2005.ReportParameter[] _parameters = null;
try
{
_parameters = rs.GetReportParameters(_reportName, _historyID, _forRendering, _values, _credentials);
RE2005.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);


RE2005.ParameterValue[] parameters = new RE2005.ParameterValue[1];
if (_parameters.Length > 0)
{

parameters[0] = new RE2005.ParameterValue();
parameters[0].Label = "";
parameters[0].Name = "parametername";
parameters[0].Value = "parametervalues";


}
rsExec.SetExecutionParameters(parameters, "en-us");


results = rsExec.Render(format, deviceInfo,
out extension, out encoding,
out mimeType, out warnings, out streamIDs);
System.Text.Encoding enc = System.Text.Encoding.UTF8;
string tmpReport = enc.GetString(results);

return tmpReport;
}
catch (Exception e)
{
throw e;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
}
}



4)The above method returns the Html code of the given report ,bind the html code in the user interface where ever you required.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900