Showing posts with label calling. Show all posts
Showing posts with label calling. Show all posts

Friday, March 9, 2012

How to call report via url in RSReportHost.exe

I am calling my reports via URL, but it presents the report in IE with the url so the users might change the parameters value in IE addressbar. but i see RSReportHost.exe does'nt show the url at all.

Is it possible to show or call a report via URL using RSReportHost.exe

I am using VS 2003 with SQL RS 2005, i don't have a reportviewer control available to use.

Please help guys.

Thank you fery much.

RSReportHost is a desktop application designed for debugging reports. So, the short answer to your question is no. Moreover, URL access is not a very secure way to request reports. The Report ViewerASP.NET control does a reasonable job to hide the parameter values during reposts but it is not foolproof as well. Regardless of the fact that you don’t use the ASP.NET Report, RS 2005 URL addressability uses it behind the scenes by redirecting the user to the ReportViewer.aspx page. So, one way to mitigate the security risk with parameters is to request the report without parameters and rely on the Report Viewer to handle them. Stricter security requirements may require the web application to handle the parameters on the server side.

|||

Thank you very much Teo.

But VS 2003 does'nt have a reportviewer to use with RS 2005.

Microsoft only released the viewer with vs 2005.

I have a very big project fully developed using vs 2003 and lot of state and federal construction projects are using the tool. and also we have integrated third party controls which specifically uses framework 1.1. i don't have an open option to switch to vs 2005 soon might have to wait until all the migration related issues gets cleared.

my current options are to use render webservices to load reports via pdf streams. which i am using. are there any other methods available using vs 2003 and sql rs 2005 please help.

Thank you once again. i read about you on google a lot.

|||

Just to clarify, I was referring to the server ReportViewer.aspx page which the user is automatically redirected to with URL addressability. So, if the user clicks on a URL link which points to a report (e.g. http://localhost/reportserver?%2fAdventureWorks+Sample+Reports%2fCompany+Sales&rs:Command=Render) , the server will redirect her to that page which uses the ReportViewer ASP.NET Report Viewer control behind the scenes. Therefore, you don’t have to upgrade to VS.NET 2005 at all.

|||

Thks Teo, But the problem with URL is the users can manipulate the url parameters by themselves in the IE address bar. I don't want the users manipulate the url's.

|||

True. You have different options to address this depending on the security risk.

1. If you think that hacking the report URL goes beyond the skills of your users, you may be fine with the ReportViewer parameter hiding.

2. You can use the user identity (User!UserID) to filter the parameter available values and/or report data (row-level security).

3. You can configure the Report Server to be accessable from your application server only and not directly from the end users.

4. You can use a trusted account between your application server and Report Server. All report requests will go under this account and you will secure the report catalog accordingly. These security policies will prevent the end users from requesting reports directly.

how to call a stored procedure that returns cursor?

Hello all,
i have a stored procedure that returns a cursor.
i'm currently facing a problem trying to guess the right
syntax for calling such procedure, since SQL Server
syntax says the return variable should be passed as
argument.
it's easy to do so from SQL Query Analyzer, just
declaring a CURSOR variable before the execute. but how
to achieve this through jdbc?
i'll deeply appreciate any help
regards,
Gerardo.
| Content-Class: urn:content-classes:message
| From: "Gerardo" <gerardo@.dangerous-minds.com>
| Sender: "Gerardo" <gerardo@.dangerous-minds.com>
| Subject: how to call a stored procedure that returns cursor?
| Date: Wed, 16 Jun 2004 14:55:31 -0700
| Lines: 16
| Message-ID: <1d6f601c453ec$a4e736a0$a101280a@.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcRT7KTnfRizhvYZRNKIM5cfGF506A==
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| Path: cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6114
| NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hello all,
|
| i have a stored procedure that returns a cursor.
|
| i'm currently facing a problem trying to guess the right
| syntax for calling such procedure, since SQL Server
| syntax says the return variable should be passed as
| argument.
|
| it's easy to do so from SQL Query Analyzer, just
| declaring a CURSOR variable before the execute. but how
| to achieve this through jdbc?
|
| i'll deeply appreciate any help
| regards,
| Gerardo.
|
Hi Gerardo,
As far as I know, your cursor variable is only useful in the context of SQL
Server. I don't think you can return the cursor variable to a datatype in
JDBC directly. What you can do is write some code (a stored procedure, for
example) that extracts the data from the cursor object into a resultset
that can then be accessed by JDBC. Below is a test procedure that returns
a cursor variable, and also a separate stored procedure that extracts data
from the cursor variable:
CREATE PROCEDURE proc_test
@.proc_test_cursor CURSOR VARYING OUTPUT
AS
SET @.proc_test_cursor = CURSOR FOR
SELECT au_lname FROM pubs.dbo.authors
OPEN @.proc_test_cursor
GO
CREATE PROC run_proc_test
AS
BEGIN
DECLARE @.test_cursor_variable CURSOR
DECLARE @.name varchar(40)
EXEC proc_test @.proc_test_cursor = @.test_cursor_variable OUTPUT
DECLARE @.message varchar(4000)
SELECT @.message = ''
WHILE (@.@.FETCH_STATUS <> -1)
BEGIN
FETCH NEXT FROM @.test_cursor_variable INTO @.name
IF (@.@.fetch_status <> -2)
BEGIN
SELECT @.message = @.message + 'au_lname: ' + @.name + ', '
END
FETCH NEXT FROM @.test_cursor_variable INTO @.name
END
SELECT @.message
CLOSE @.test_cursor_variable
DEALLOCATE @.test_cursor_variable
END
GO
Once you call run_proc_test from JDBC, you can use getString to read the
data.
Hope that helps!
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

Wednesday, March 7, 2012

How to call a function from a column formula in my MS SQL table

Good day!

What is the syntax on calling a function from a column formula in an MS SQL table.

I created a table, one column's value will be coming from a function. And at the same time, I will pass parameters to the function. How do I do this? Is this correct?

SELECT dbo.FunctionName([Parameter1, Parameter2])

But i can't save the table, "Error validating the formula".

Pls. help
Thanks a lot.<edit> Never mind, I misunderstood what you are doing.
I'm afraid I have no advice.|||It may or may not work depending on what you are trying to do. You can use a udf and define the result as simply:

DEFAULT (dbo.udfMyFunction('SomeParam','OtherParam'))

However, SomeParam and OtherParam must be constants or system functions (like suser_sname() or host_name()). They can't be names of columns in your table.

Regards,

hmscott|||Or perhaps he want a computed column:

create table foo (
id int,
hash as dbo.getHash(id),
...
);