Showing posts with label generate. Show all posts
Showing posts with label generate. Show all posts

Friday, March 9, 2012

Deploying generated reports at runtime

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
StuHello 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.|||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.|||Wei,
I have this set-up and working. Are there any performance issues when
multiple users are uploading reports to the reportserver?
-marv
"Wei Lu [MSFT]" wrote:
> 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.
>|||hi lu
i am getting invalidoperation exception. any ideas?
XmlSerializer serializer = new XmlSerializer(typeof(String));
using (MemoryStream memorystream = new MemoryStream())
{
serializer.Serialize(memorystream, GenerateRDL());
ReportService = new ReportingService2005();
//ReportService.Credentials =System.Net.CredentialCache.DefaultCredentials;
ReportService.Credentials =System.Net.CredentialCache.DefaultNetworkCredentials;
ReportService.Url = reportserverurl;
memorystream.Position = 0;
Byte[] bytes = memorystream.GetBuffer();
try
{
BAR.RS2005.Warning[] warnings =ReportService.CreateReport("AdHocReport", "/ServerReports", true, bytes,
null);
//BAR.RS2005.Warning[] warnings =ReportService.SetReportDefinition(reportpath, bytes);
}
catch (InvalidOperationException ee)
{
StringBuilder error = new StringBuilder();
error.Append(ee.Message);
error.Append(ee.Source);
error.Append(ee.InnerException);
error.Append(ee.Data);
Trace.WriteLine(error.ToString());
}
}
"Wei Lu [MSFT]" wrote:
> 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.
>

Wednesday, March 7, 2012

deploying changes to cub

Hi,

I have a cube in production server and i want to update that with my latest copy. Is the only way to update it is generate an .xmla again through the deployment wizard? what if i just added a new cube on top of my existing ones. do i need to replace all of them again?

cherriesh

From the underlying XMLA perspective this is definitely possible. The Deployment Wizard uses an Alter command with the AllowCreate option set to true, so aslong as you have not altered the structure of any of the existing cubes and have not chosen the option to do a process operation as part of the deploy, then you should be able to deploy using the Wizard without loosing any data. You would then only need to process the new cube.

It would also be an option to build a CREATE script for just the new cube, but I don't know of any tools that would build this for you. If you have a dev server you could deploy the database to it and connect to it using SSMS and then right click on the new cube and script out the CREATE command.

Note that a cube is dependant on other objects in the database like the dimensions and if any of these have been changed or added then the create script on its own might not work.

Deploying Analysis Server Project to another domain

I am looking for a way to deploy an Analysis Server 2005 project to a remote location. I can generate and XMLA create script, FTP the script to the remote location, and execute it to create the cube database on the other server.

However, the security roles inthe XMLA file contains SIDs instead of Active Directory Security group names. The server I am moving this database to is in another Domain and so the SIDs don't correspond to the same users. However, the Active Directory group names on the remote server are exactly the same as the Active Directory group names in my local domain. (The group names are the names of companies).

I am looking for a way to deploy this project to my remote server with the SIDs converted to the Active Directory group names.

Does anyone have any ideas? This type of deployment scenario will be quite common in my development environment.

I am using SQL2005 SP2, along with Visual Studio 2005.

Have a look at the Analysis Services Deployment Wizard, it has options for either

deploying the roles in full|||

I'll throw in my two cents. If the XMLA for your role contains:

<Members>

<Member>

<Name>YOURDOMAIN\yourusername</Name>

<Sid>S-1-5-21-4211028405-896031999-4015973603-1183</Sid>

</Member>

</Members>

I believe that you can cut out the Sid entirely. The following XMLA works fine for me:

<Members>

<Member>

<Name>YOURDOMAIN\yourusername</Name>

</Member>

</Members>

As for whether you can do without YOURDOMAIN\ in the above, I'm not sure. I know that if the group is local to the computer you're, then leaving off the domain works. But if it's a domain group, I'm guessing you've got to specify the domain. Worth testing, though.

Deploying Analysis Server Project to another domain

I am looking for a way to deploy an Analysis Server 2005 project to a remote location. I can generate and XMLA create script, FTP the script to the remote location, and execute it to create the cube database on the other server.

However, the security roles inthe XMLA file contains SIDs instead of Active Directory Security group names. The server I am moving this database to is in another Domain and so the SIDs don't correspond to the same users. However, the Active Directory group names on the remote server are exactly the same as the Active Directory group names in my local domain. (The group names are the names of companies).

I am looking for a way to deploy this project to my remote server with the SIDs converted to the Active Directory group names.

Does anyone have any ideas? This type of deployment scenario will be quite common in my development environment.

I am using SQL2005 SP2, along with Visual Studio 2005.

Have a look at the Analysis Services Deployment Wizard, it has options for either

deploying the roles in full|||

I'll throw in my two cents. If the XMLA for your role contains:

<Members>

<Member>

<Name>YOURDOMAIN\yourusername</Name>

<Sid>S-1-5-21-4211028405-896031999-4015973603-1183</Sid>

</Member>

</Members>

I believe that you can cut out the Sid entirely. The following XMLA works fine for me:

<Members>

<Member>

<Name>YOURDOMAIN\yourusername</Name>

</Member>

</Members>

As for whether you can do without YOURDOMAIN\ in the above, I'm not sure. I know that if the group is local to the computer you're, then leaving off the domain works. But if it's a domain group, I'm guessing you've got to specify the domain. Worth testing, though.