Groups | Blog | Home
all groups > sql server reporting services > june 2007 >

sql server reporting services : Deploying generated reports at runtime



Stu
6/20/2007 10:26:00 AM
Due to the requirements of my project I think I need to generate the RDL for
my reports programatically.

However, I think I also need to view them in the ReportViewer web control in
Remote processing mode. My question is, once my app has generated the RDL,
what's the best way of "getting it to SSRS" to that it can be processed.

In the following sequence, it is steps 3 & 4 that I am unsure about:

1. User requests report
2. App generates RDL based on user's config
3. App does something to give it to give the RDL to SSRS?
4. App sets ReportViewer.ServerReport.ReportPath to the path to the report
(what is the path?)
5. SSRS renders report and ReportViewer displays it to user.

I'd be grateful for any help

weilu NO[at]SPAM online.microsoft.com
6/21/2007 3:36:37 AM
Hello Stu,

You could use the Reporting Services Web Service to upload the report to
the report server.

Here is the sample code:

using System;
using System.IO;
using System.Web.Services.Protocols;

class Sample
{
public static void Main()
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

Byte[] definition = null;
Warning[] warnings = null;
string name = "MyReport";

try
{
FileStream stream = File.OpenRead("MyReport.rdl");
definition = new Byte[stream.Length];
stream.Read(definition, 0, (int) stream.Length);
stream.Close();
}

catch(IOException e)
{
Console.WriteLine(e.Message);
}

try
{
warnings = rs.CreateReport(name, "/Samples", false, definition,
null);

if (warnings != null)
{
foreach (Warning warning in warnings)
{
Console.WriteLine(warning.Message);
}
}

else
Console.WriteLine("Report: {0} created successfully with no
warnings", name);
}

catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}

}
}

You could refer the following article for more information.

ReportingService2005.CreateReport Method
http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswe
bservice.rsmanagementservice2005.reportingservice2005.createreport(SQL.90).a
spx

http://msdn2.microsoft.com/en-us/library/bb326462(SQL.90).aspx

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
weilu NO[at]SPAM online.microsoft.com
6/25/2007 12:00:00 AM
Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Marvin
7/20/2007 12:38:03 PM
Wei,

I have this set-up and working. Are there any performance issues when
multiple users are uploading reports to the reportserver?

-marv

[quoted text, click to view]
AddThis Social Bookmark Button