Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Tuesday, March 27, 2012

Error programaticaly rendering a report using Reporting Services Web Services

I'm using Reporting Services 2005 SP1 and wrote some code to render reports server-side.
My sample report has few parameters that must be passed so I pass these parameters with code.

<My code>
ReportServiceExecution.ReportExecutionService rs = new ReportServiceExecution.ReportExecutionService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
string extension, mimeType, encoding;
ReportServiceExecution.Warning[] warnings;
string[] streamID;

ParameterValue[] parameters = new ParameterValue[2];

parameters[0] = new ParameterValue();
parameters[0].Name = "pID";
parameters[0].Value = "6548747";

parameters[1] = new ParameterValue();

parameters[1].Name = "pClass";

parameters[1].Value = "8";

ExecutionHeader header = new ExecutionHeader();
ExecutionInfo executionInfo = rs.LoadReport(reportPayslip.Name, null);
executionInfo = rs.SetExecutionParameters(parameters, "en-us");
rs.ExecutionHeaderValue = header;
rs.ExecutionHeaderValue.ExecutionID = executionInfo.ExecutionID;

byte[] report = rs.Render("PDF", "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>", out extension, out mimeType, out encoding, out warnings, out streamID);
</My code>

Actually, I have several more parameters but I've checked the collection and all the parameters I want are there and have values. Their names match those found in executionInfo.Parameters. But when I run my code I get the following error on Render():

<Error>
"This report requires a default or user-defined value for the report parameter 'pClass'. To run or subscribe to this report, you must provide a parameter value. > This report requires a default or user-defined value for the report parameter 'pClass'. To run or subscribe to this report, you must provide a parameter value. > This report requires a default or user-defined value for the report parameter 'pClass'. To run or subscribe to this report, you must provide a parameter value."
</Error>

I've double-checked and my parameter array does have the problematic parameter, I passed it a value but when I check executionInfo.Parameters I see that it's the only parameter that hasn't been give a default value after calling SetExecutionParameters(). So my parameters do seem to be passed but one seems to refuse getting a value. If I comment out the SetExecutionParameters() line I get, as expected a similar error but on another parameter (first one in the executionInfo.Parameters collection). So I'm left to beleive that the SetExecutionParameters() has some kind of bug as it works for all but one parameter. I've checked casing, spelling, tried passing phony parameters and from what I've seen I should be getting an error when I pass the parameters if I got something wrong.

Any help would be much appreciated.

I've done some (desperate) tests and changed the following line:
executionInfo = rs.SetExecutionParameters(parameters, "en-us");
to
executionInfo = rs.SetExecutionParameters(parameters, "fr-ch");
I'm currently based in French Switzerland but our reports are written in english, besides, the documentation about this parameter is basically "A .Net language" which is not very helpful. So now it works but I'm afraid if I have to access a server that is of another culture it will fail.

Error processing events

Let me start by saying this is my first crack at NotificationServices. I installed a sample from "Microsoft SQL Server 2000 Notification Services" that processes stock events (I think it may be a copy of the one in the help file). I get the following error when I place a file in the EventsWatchDirectory. I have uninstalled and reinstalled SQLXML and MSXML3 (I already had MSXML4 sp2). Any help is appreciated.

<NotificationServicesEvent>

<Description>

The FileSystemWatcher event provider failed to submit events.

</Description>

<Context>

<EventParameters>

<ProviderName>StockEventProvider</ProviderName>

<EventFileName>C:\SQL-NS\Chapter03\Stock\EventsWatchDirectory\EventData.xml</EventFileName>

<EventClassName>StockPriceChange</EventClassName>

</EventParameters>

</Context>

<Description>

Unable to cast COM object of type 'SqlXmlBulkLoad.SQLXMLBulkLoadClass' to interface type 'SqlXmlBulkLoad.ISQLXMLBulkLoad'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{1380DD8D-DCB9-4A6E-9D53-EECDDF18DA85}' failed with HRESULT: 0x80004002 (No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))).

</Description>

<Instance>Chapter03</Instance>

<ApplicationName>Stock</ApplicationName>

<Component>Event collection</Component>

<Thread>15</Thread>

</NotificationServicesEvent>

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Also of note:

I can instantiate SQLXMLBulkLoad.SQLXMLBulkLoad but not SQLXMLBulkLoad.SQLXMLBulkLoadClass. The first sample VB Script from the SQLXML works fine to insert data into a table.|||Answer was in the old forums. I had .Net 2.0 Beta 2 installed. Uninstalled it and repaired XML4.0 and SQLXML3.0 and all was good. Thanks Shyam|||Larry,
What version of the .NET frameworks do you have on the machine. Notification Services in SQL 2000 requires the .NET Framework 1.1. If you have version 2.0 (only - without a side-by-side copy of version 1.1), you will see this problem. The reason is that one of the methods we call when loading the XML event loading components has been made obsolete in the 2.0 .NET Frameworks.

If you want to go with the .NET Frameworks 2.0, you should use the version of Notification SErvices in SQL Server 2005 - that version is designed to work on .NET 2.0.

THanks
-shyam
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.|||

Hello Shyam,

I have the exact same problem (I am also using your book code samples) the SQL-NS applications are compiling OK, and the service starts nicely, but when I try to trigger an event, I get the following error:

Unable to cast COM object of type 'SqlXmlBulkLoad.SQLXMLBulkLoadClass' to interface type 'SqlXmlBulkLoad.ISQLXMLBulkLoad'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{1380DD8D-DCB9-4A6E-9D53-EECDDF18DA85}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

the configuration of my development machine is the following:

Windows XP Pro SP2

SQL Server 2000 SP4

SQL Server 2000 Notification Services SP1

SQLXML 3.0 SP3

.NET Framework 1.1 (VS 2003)

.NET Framework 2.0 (VS 2005)

SQL Server 2005 Express (the edition that is installed with VS 2005)

Unfortunately I am developping with both versions of visual studio (2003 & 2005) so I need both frameworks.

We are using SQL server 2000 and are not ready to upgrade to SQL server 2005.

Is there any fix I could use?

Thanks for your help.

Henri PIQUET

Error processing events

Let me start by saying this is my first crack at NotificationServices. I installed a sample from "Microsoft SQL Server 2000 Notification Services" that processes stock events (I think it may be a copy of the one in the help file). I get the following error when I place a file in the EventsWatchDirectory. I have uninstalled and reinstalled SQLXML and MSXML3 (I already had MSXML4 sp2). Any help is appreciated.

<NotificationServicesEvent>

<Description>

The FileSystemWatcher event provider failed to submit events.

</Description>

<Context>

<EventParameters>

<ProviderName>StockEventProvider</ProviderName>

<EventFileName>C:\SQL-NS\Chapter03\Stock\EventsWatchDirectory\EventData.xml</EventFileName>

<EventClassName>StockPriceChange</EventClassName>

</EventParameters>

</Context>

<Description>

Unable to cast COM object of type 'SqlXmlBulkLoad.SQLXMLBulkLoadClass' to interface type 'SqlXmlBulkLoad.ISQLXMLBulkLoad'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{1380DD8D-DCB9-4A6E-9D53-EECDDF18DA85}' failed with HRESULT: 0x80004002 (No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))).

</Description>

<Instance>Chapter03</Instance>

<ApplicationName>Stock</ApplicationName>

<Component>Event collection</Component>

<Thread>15</Thread>

</NotificationServicesEvent>

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Also of note:

I can instantiate SQLXMLBulkLoad.SQLXMLBulkLoad but not SQLXMLBulkLoad.SQLXMLBulkLoadClass. The first sample VB Script from the SQLXML works fine to insert data into a table.|||Answer was in the old forums. I had .Net 2.0 Beta 2 installed. Uninstalled it and repaired XML4.0 and SQLXML3.0 and all was good. Thanks Shyam|||Larry,
What version of the .NET frameworks do you have on the machine. Notification Services in SQL 2000 requires the .NET Framework 1.1. If you have version 2.0 (only - without a side-by-side copy of version 1.1), you will see this problem. The reason is that one of the methods we call when loading the XML event loading components has been made obsolete in the 2.0 .NET Frameworks.

If you want to go with the .NET Frameworks 2.0, you should use the version of Notification SErvices in SQL Server 2005 - that version is designed to work on .NET 2.0.

THanks
-shyam
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.|||

Hello Shyam,

I have the exact same problem (I am also using your book code samples) the SQL-NS applications are compiling OK, and the service starts nicely, but when I try to trigger an event, I get the following error:

Unable to cast COM object of type 'SqlXmlBulkLoad.SQLXMLBulkLoadClass' to interface type 'SqlXmlBulkLoad.ISQLXMLBulkLoad'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{1380DD8D-DCB9-4A6E-9D53-EECDDF18DA85}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

the configuration of my development machine is the following:

Windows XP Pro SP2

SQL Server 2000 SP4

SQL Server 2000 Notification Services SP1

SQLXML 3.0 SP3

.NET Framework 1.1 (VS 2003)

.NET Framework 2.0 (VS 2005)

SQL Server 2005 Express (the edition that is installed with VS 2005)

Unfortunately I am developping with both versions of visual studio (2003 & 2005) so I need both frameworks.

We are using SQL server 2000 and are not ready to upgrade to SQL server 2005.

Is there any fix I could use?

Thanks for your help.

Henri PIQUET

Friday, March 23, 2012

Error on VB Sample which is delivered by installation.

Hi,

after i try to build the web application "Web Development - Data Entry Form" i get the following error message. I already change the variable username to system which is defined in Machine.Config.

The Error messega is like following:
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Thanks,The username you see in machine.config is most likely not the username you want to provide in the connection string in your application. You need to provide a valid username and password for your SQL server. If you did not install the db server yourself, you should be able to get valid login info from the person who installed it.

If the db server is local, you might be able to get away with the following for your connection string: "server=localhost;TrustedConnection=true;database=YOUR_DB"

Sunday, February 26, 2012

Error message when deploying cube to remote server

Hello,

I created an account called sa2 to obtain access to create a datasource for the AdventureworksDW sample database on a remote server, and granted this user all rights on the database.

When I was ready to deploy the cube I typed in the machine name (sserver) in connection settings, and then deployed. However, I got an error:

"The connection either timed out or was lost."

I then tried:

sserver\sserver

but got:

"Error 1 The project could not be deployed to the 'sserver\sserver' server because of the following connectivity problems : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server. 0 0


Permissions issue for the sa2 account?

Are you trying to deploy from BIDS? Is the error message coming up during deployment or during processing?|||

Hello,

Yes, from Bids. Not sure at what point the error occurs, I select deploy, processing occurs and then the error message is displayed.

Since this post I dropped the firewall on the server, and the database seems to be ceated but errors occur, so deployment is not successful.

This link:

http://www.sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

is suggesting that I can only login with a Windows account.

|||You need a Windows Account with administrator access to the Analysis Server to deploy the database (not necessarily an Windows Administrator account). You can use a SQL Server login for the connection from Analysis Services to the relational engine.|||Make sure you used the same windows login with remote server, same username and same password. I think the problem was in authentication method.

Best regards,

Hery|||

Hello,

Thanks for the suggestions everyone. The computer from which I am trying to deploy does not login to the network, so I don't have a profile which I can apply to the database. As a workaround for now I will deploy to localhost.

Wednesday, February 15, 2012

Error Message

I used the sample data (FoodMart) to create cubes. I was successful creating the cubes but when I tried to browse the data, I get this error message 'Unspecified errors'. What should I do? Thank you.
Jenna
Try installing SP3 should solve your problem
"Jenna" <Jobejah@.hotmail.com> wrote in message
news:420436F3-5A52-46BC-96C3-CD954CEB2A80@.microsoft.com...
> I used the sample data (FoodMart) to create cubes. I was successful
creating the cubes but when I tried to browse the data, I get this error
message 'Unspecified errors'. What should I do? Thank you.
> Jenna

Error Message

I used the sample data (FoodMart) to create cubes. I was successful creatin
g the cubes but when I tried to browse the data, I get this error message 'U
nspecified errors'. What should I do? Thank you.
JennaTry installing SP3 should solve your problem
"Jenna" <Jobejah@.hotmail.com> wrote in message
news:420436F3-5A52-46BC-96C3-CD954CEB2A80@.microsoft.com...
> I used the sample data (FoodMart) to create cubes. I was successful
creating the cubes but when I tried to browse the data, I get this error
message 'Unspecified errors'. What should I do? Thank you.
> Jenna