Reputation: 59
How is it possible for reporting services to return report data (there are already some complete reports in my report server) that my ASP.Net web application can recevie, format and display using asp.net html and CSS?
Is it possible for RS to retrun the reports as json, xml etc that i easly can use in my code-behind to show them? I want to for instance make the headtitles blue and values dark blue and put a backgroud image for the my reprort and put some icons for some values in the report programmaticlly , etc.
I dont want to use the reportviewer control. My reports do not use any input paramaters.
Upvotes: 3
Views: 1245
Reputation: 3083
There is a way i have tried it ones.
First you need to output the report in XML format by default. http://msdn.microsoft.com/en-us/library/ms154040.aspx http://msdn.microsoft.com/en-us/library/ms152835.aspx
Next you need to applying Transformations to XML Output using XSLT http://msdn.microsoft.com/en-us/library/aa178953(v=sql.80).aspx
I think it is the only way to take a report and transform it styles to look more as HTML
Another sollution Based on TFD suggestion i have created a simple console application which read a csv file generated by reporting services and print the results.
I have used LinqToExcel so it will be quicker to read the data, but you don't have to use it
the code:
System.Net.WebClient client = new WebClient();
client.Credentials = new NetworkCredential("username", "password");
client.DownloadFile("reporingservisesURL/ReportServer?
rs:Command=Render&rs:Format=CSV", "file.csv");
FileInfo file = new FileInfo("file.csv");
var excel = new ExcelQueryFactory(file.FullName);
var worksheetNames = excel.GetWorksheetNames();
var results = from c in excel.Worksheet("UsersTry")
select c;
foreach (var item in results)
{
Console.WriteLine(String.Format("UserID: {0} , UserName:{1} ,
LoginName: {2}",item[0].Value,item[1].Value,item[2].Value));
}
Console.WriteLine("The End :)");
Console.ReadLine();
I hope it help you
Upvotes: 3