Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Monday, March 26, 2012

Read only permissions for report writer

I have an msde database (SQL Server 2000) with an web front end. I would
like to create an MS Access Project to allow certain users to create ad hoc
reports.
I have created a new login named Reporter and connected to the msde database
using this user. This user has dbreadonly permissions.
This works to a certain extent in that new reports can be created based on
existing tables. However, I would like the user to be able to create their
own select queries and cannot find a way to manage this. I recieve a
message saying the user needs 'Create Procedure' rights.
Can anyone tell me how I can let Reporter create their own queries but not
add/edit/delete any existing data?
Many thanks
June
hi June,
June Macleod wrote:
> I have an msde database (SQL Server 2000) with an web front end. I
> would like to create an MS Access Project to allow certain users to
> create ad hoc reports.
> I have created a new login named Reporter and connected to the msde
> database using this user. This user has dbreadonly permissions.
> This works to a certain extent in that new reports can be created
> based on existing tables. However, I would like the user to be able
> to create their own select queries and cannot find a way to manage
> this. I recieve a message saying the user needs 'Create Procedure'
> rights.
> Can anyone tell me how I can let Reporter create their own queries
> but not add/edit/delete any existing data?
> Many thanks
> June
if you are required to allow "CREATE PROC" statement you have to grant
membership to ddladmin database role but, with such a permission, Reporter
can even create new tables and of course access/modify their data..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||better,
if you only are required to create procedures, you can grant that specific
permission to Reporte user like
GRANT CREATE PROCEDURE TO [Reporter]
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Read Only permission for ReportingServices.GetPolicies()

I would like for a user to view the groups that have permssion for a
particular folder in SQL Reporting Services that they have access to via the
Web Services by calling ReportingServices.GetPolicies(). I realize
(according to MS's website and trial and error) that the user must have the
"Read Security Policies" right for that folder. The only way I have found
to set this via a Role is to allow "Set security for individual items".
Is there any way to allow a user to only view the security information via
ReportingServices.GetPolicies() without allowing them to change the security
policies?
Any help would be greatly appreciated. Thank you.
Jeremy M. WhiteWell, I found a way to do it, but I'm not really excited about it.
Currently, I am selecting directly from the SQL Reporting services database.
Again, I would prefer to do it through the web services, but I guess this
will suffice. For anyone interested, here is the SQL statement to retrieve
the policy information:
SELECT
U.UserName, U.UserType, R.RoleName, R.Description
FROM
Catalog As C INNER JOIN
PolicyUserRole As PU
ON (C.PolicyID = PU.PolicyID)
INNER JOIN
Roles As R
ON (PU.RoleID = R.RoleID)
INNER JOIN
Users As U
ON (PU.UserID = U.UserID)
WHERE
C.Path = @.ItemName
If anyone is able to determine how to provide read-only access to the
policies via a role, please let me know.
Thanks,
Jeremy
"Jeremy M. White" <jeremy_white@.dart.biz> wrote in message
news:uEkE3mbzEHA.1300@.TK2MSFTNGP14.phx.gbl...
> I would like for a user to view the groups that have permssion for a
> particular folder in SQL Reporting Services that they have access to via
the
> Web Services by calling ReportingServices.GetPolicies(). I realize
> (according to MS's website and trial and error) that the user must have
the
> "Read Security Policies" right for that folder. The only way I have found
> to set this via a Role is to allow "Set security for individual items".
> Is there any way to allow a user to only view the security information via
> ReportingServices.GetPolicies() without allowing them to change the
security
> policies?
> Any help would be greatly appreciated. Thank you.
> Jeremy M. White
>

Friday, March 23, 2012

read image from Sql Server

Hello!

My real problem is that i want to read an image from an Sql Server DB, resize them and send them, all this through a Web Service. I decide to split my problem in four steps:

1 - read image from Database

2 - Resize that image

3 - Send her back to the DB

4 - Send the image throw a web service after he use a dataset to read the data from the DB.

i try to read the database with this function

Code Snippet

public System.Drawing.Image ReadImgFromDB(Int64 imageID)

{

System.Drawing.Image image = null;

using (SqlConnection conn = new SqlConnection())

{

string connString = WebConfigurationManager.ConnectionStrings

["StringCC"].ConnectionString;

conn.ConnectionString = connString;

SqlCommand myCommand = new SqlCommand(

"SELECT Pic FROM Images WHERE ID='"+ imageID +"'", conn);

conn.Open();

byte[] imageData = (byte[])myCommand.ExecuteScalar();

System.IO.MemoryStream memStream = new System.IO.MemoryStream(imageData);

image = System.Drawing.Image.FromStream(memStream);

}

return image;

}

i introduce a valid image ID and i get this message

" System.ArgumentException: Parameter is not valid.
at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
at System.Drawing.Image.FromStream(Stream stream)
at Service.ReadImgFromDB(Int64 chaveI) in e:\Web Projects\WSservice\App_Code\Service.cs:line 48"--

line 48: "image = System.Drawing.Image.FromStream(memStream);"

Thank you!

Seems like the image is corrupt, the code looks ok, though you should use parametrized queries: This will prevent SQL injection

Code Snippet

SqlCommand myCommand = new SqlCommand("SELECT Pic FROM Images WHERE ID= @.imageID", conn);

SqlParameter paramImage = new SqlParameter(@.imageID, SqlType.Varchar,20); // Depends on your parameter type

paramImage.Value = imageID;

myCommand.Parameters.Add(paramImage);

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

thank you for your reply.

Yes i usually use parameters, but for now i'm just "playing" with code.

I didn't check the images, i just assume that they're ok. i'll check them.

Thanks!

sql

Wednesday, March 21, 2012

Read a remote web file and parse it

As subject, I need to read a remote web file, csv or xml isn't important,
from a t-sql sp scheduled in a job.
I don't know how to write the remote read steps. Any helps?
AndreaHi
Can you FTP the file? In which case you could use the DTS "File Transfer
Protocol" task to do this although if you used FTP.EXE from the "Execute
Process" or a xp_cmdshell call in a "Execute SQL" task" you may have more
control.
John
Andrea Moro" <moroandrea@.tiscali.it> wrote in message
news:4274c427$0$20669$5fc30a8@.news.tiscali.it...
> As subject, I need to read a remote web file, csv or xml isn't important,
> from a t-sql sp scheduled in a job.
> I don't know how to write the remote read steps. Any helps?
> Andrea
>

Monday, March 12, 2012

rdlc show querystring parameter in page header

I pass in 3 querystring parameters to my web form. The Object Data Sources pick up these parameters

and select the appropriate records.

I want to display one of the querystring parameters in my Page Header, specifically the one for Fiscal Year.

I could return the Fiscal Year in a column from the data source, but the Fiscal Year would not populate if

no records were returned...Therefore, I must get the querystring parameter that was originally passed in...

How do I populate the report control textbox with the value of querystring parameter?

Thanks!

Jim

JIM_LANGDON wrote:

I pass in 3 querystring parameters to my web form. The Object Data Sources pick up these parameters

and select the appropriate records.

I want to display one of the querystring parameters in my Page Header, specifically the one for Fiscal Year.

I could return the Fiscal Year in a column from the data source, but the Fiscal Year would not populate if

no records were returned...Therefore, I must get the querystring parameter that was originally passed in...

How do I populate the report control textbox with the value of querystring parameter?

Thanks!

Jim

Are you using a report generator?

If not, then isn't this is as simple as setting the expression of the textbox to:

=Fields!FiscalYear.Value

|||

I don't know what you mean by "Report Generator"..isn't it SSRS?

I pass in the parameter via the call to the webform that contains the

reportviewer control -- webform.aspx?fy=2007.

The reportviewer control that is bound to the report.rdlc.

The RDLC has several datasources which show up as objectdatasource controls

on the web form. The objectdatasource controls are configured to use the appropriate

datasource method and the parameters are defined to use the querystring and "fy" as

the parameter name.

Doesn't the Fields! collection just have the datasource columns? I tried what you suggested

Fields!fy.Value, since the name in querystring is "fy"...no success.

|||

JIM_LANGDON wrote:

I tried what you suggested

Fields!fy.Value, since the name in querystring is "fy"...no success.

This is probably because you need to specify the dataset on the textbox. Right click the textbox and select properties. In the "containing group or dataset" textbox, you need to either select or enter the dataset that contains 'fy'.

Basically, you can treat a textbox similarly to a table/matrix. It can have a dataset associated with it and you can populate the textbox with any value from the parameters or fields list.

|||

But the querystring does not belong to a "dataset"....so I can't reference it with Fields!fieldname. Hmmm.

|||

Isn't fiscal year one of your fields in a dataset? Aren't you trying to get fiscal year in a textbox?

Why do you want to touch a querystring?

|||

I could return the Fiscal Year in a column from the data source, but the Fiscal Year would not populate if

no records were returned...Therefore, I must get the querystring parameter that was originally passed in...

The goal is to display a specific querystring parameter in the page header of the report.

|||

JIM_LANGDON wrote:

I could return the Fiscal Year in a column from the data source, but the Fiscal Year would not populate if

no records were returned

Yes, and you could conditionally specify what the Fiscal Year should default to if no records are returned.

If you'd like to pursue the querystring path to resolve this, feel free. I'm just somewhat confused with your reasoning.

|||

The Fiscal Year that is passed to the web form is 2006. If no Fiscal Year is passed, it will default to 2007. The records selected are based on the year that is passed in.

If I pass in the year 2006, I want the page header to display "Fiscal Year: 2006" and the body to display "No records found."

It seems clear to me that the querystring is the only place to logically capture the Fiscal Year. Is there another method you had in mind to meet the goal or another way to do things to accomplish the same thing?

|||

JIM_LANGDON wrote:

It seems clear to me that the querystring is the only place to logically capture the Fiscal Year. Is there another method you had in mind to meet the goal or another way to do things to accomplish the same thing?

Maybe I just don't know what you mean by "querystring".

I think everything that you have mentioned so far can be accomplished by using a dataset (as either text or stored procedure).

|||

Sounds like what you have to do is one of the following:

add a new parameter to the report (with no valid values) and set the value of this parameter from the querystring. In your report textbox use Parameters!<your param name>.value to display the value

OR

create a new dataset in your report and load the querystring parameters into it in code, pass this additional dataset to the report

|||

The report page is initiated by a link <a>, html anchor tag.

<a href="report_web_form.aspx?fy=2006">Run This Report</a>

The href property assignment is what I mean by "querystring".

The dataset that is generated uses the 2006 value to determine what

records to select. If no records are returned, you cannot use the dataset to

get the value 2006. I don't see how this can be accomplished using a dataset.

|||

Thanks Adam..

From your first solution how do I "set the value of this parameter from the querystring". Where is that done. Are we talking about an assignment in the page load event of the report web form?

From your second solution how do I "load the querystring parameters into it in code"?

Sorry, I just need a bit more explanation.

|||

OK, here we go. The solution. Thanks to the exhausting yet always productive discussion today.

1. Define a report parameter in the report.rdlc:

Name: FISCAL_YEAR

Data Type: String

"Hidden" checkbox checked.

Default Values: "null" checkbox checked.

2. Place a text box in the page header of the report.rdlc with the value "=parameters!FISCAL_YEAR.Value".

3. Place the following code in the report web form:

Imports Microsoft.Reporting.WebForms

Partical Class reportWebForm

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim _fiscalYearParameter As New ReportParameter("FISCAL_YEAR", "2007")

_fiscalYearParameter.Values(0) = Request.QueryString("fy")

ReportViewer.LocalReport.SetParameters(New ReportParameter() {_fiscalYearParameter})

End Sub

RDLC Object datasource can't get System.Web through webform reportviewer

I am running an RDLC with a object datasource. In the object I try to
access System.Web.Httphandler to get the session, but it is nothing.
The reportviewer running my rdlc from a webform, and it seems as though
there is a setting or something to enable the object datasource access
to the session but I cannot figure it out.
Can someone help?Currently I get this error when it tries to access
System.Web.Httphandler.Current
Microsoft.Reporting.WebForms.AspNetSessionExpiredException|||lotta typos today, I am accessing:
System.Web.HttpContext.Current.Session("PhysicalWebPath")
and Current is Nothing|||This is not too surprising. The web control uses web services. I am not sure
it has a physical web path. What are you trying to determine?
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Greg" <gfricke@.gmail.com> wrote in message
news:1132681439.261358.193190@.g43g2000cwa.googlegroups.com...
> lotta typos today, I am accessing:
> System.Web.HttpContext.Current.Session("PhysicalWebPath")
> and Current is Nothing
>|||Just trying to grab a session value, so if its a web service that the
web control uses, is there an EnableSession true setting I cause use in
my object datasource like I do in a standard webservice to share the
session?|||Sorry, can't help you there. I have been using the winform control.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Greg" <gfricke@.gmail.com> wrote in message
news:1132689249.764262.282850@.f14g2000cwb.googlegroups.com...
> Just trying to grab a session value, so if its a web service that the
> web control uses, is there an EnableSession true setting I cause use in
> my object datasource like I do in a standard webservice to share the
> session?
>|||On a side note, can I see these webservices? Like does it create a
asmx file or something I can connect to in IE for the object
datasources the reportviewer communicates with?|||The webservices are documented and you can use them yourself. Prior to 2005
people would (and still can) roll there own, not using the control. The
previous control (really a sample) used URL integration and so had some
difficulties.
In Books Online look for web services and you will see lots of
documentation.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Greg" <gfricke@.gmail.com> wrote in message
news:1132690648.480837.290540@.o13g2000cwo.googlegroups.com...
> On a side note, can I see these webservices? Like does it create a
> asmx file or something I can connect to in IE for the object
> datasources the reportviewer communicates with?
>

Friday, March 9, 2012

RDLC and Excel - No Grid Lines

Using ASP.NET 2, C#, Web application, we have an rdlc report which will be primarily used to export to an Excel spreadsheet. When we run thw report, then export it, we wind up with a spreadsheet with no gridlines, eg a spreadsheet with invisible cell borders.

Is the a setting or property somewhere which can be changed so that the spreadsheet which opens after the export looks like a standard spreadsheet, that is, with visible cell borders?

Many thanks
Mike Thomas

In the test I just did, setting the BorderStyle to Single on the text boxes I wanted to have borders worked. You should also take a look at http://msdn2.microsoft.com/en-us/library/aa178951(SQL.80).aspx to see how cells are converted. Short and sweet: best, use a table; next best, make sure to align everything.

Larry

|||

Sorry, it's late. I should have also mentioned that every cell in a table and a matrix are textboxes. The BorderStyle is 'none' by default and the BorderColor is 'Black' by default. The properties I mean are those in Visual Studio, not those found through the context menu.

Larry

RDL to RDLC Dataset Bind Question

We got some existing Reports that are set to RDL files but now they want to be able to create a web user interface so the user can interact through such method. As I am finding out, these reports need to be converted to RDLC so that they can all the proper information so they can be binded. My question is, the datasets are already set (I beleive it's the .rdlc.data files) on the RDL solution project. Now I want transfer those DataSets to my Website project and bind those datasets to my Report Viewer Control. Is that the right approach? Or do we have to re-create the Datasets and then bind? Can I use Web Services to bind to these reports? Thanks for the input and all help is appreciated. Big Smile

there is no need to do this what you need to do is to just deploythose reports on the reporting server then create web page and addreport viewer control to it to enable the user view the reports youdeveloped you can see this example to know how to do this

http://www.c-sharpcorner.com/UploadFile/asif.blog/DynamicDataGrouping08042006115320AM/DynamicDataGrouping.aspx

http://www.gotreportviewer.com/

Monday, February 20, 2012

Rapid Prototype Software?

Can someone recommend a software prototyping tool suitable for a web front
end that would collect and store data in a SQL database. I'm looking for
something under $500 that would simulate drop down menus, hyperlinks,
checkboxes and the like. Any suggestions would be appreciated. Thanks, Pancho
try this:
http://www.microsoft.com/france/msdn...s/default.mspx
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0737A734-3663-44B1-AA37-2EEB8B969442@.microsoft.com...
> Can someone recommend a software prototyping tool suitable for a web front
> end that would collect and store data in a SQL database. I'm looking for
> something under $500 that would simulate drop down menus, hyperlinks,
> checkboxes and the like. Any suggestions would be appreciated. Thanks,
> Pancho
|||Parait interessant. Merci, Pancho
"Jéjé" wrote:

> try this:
> http://www.microsoft.com/france/msdn...s/default.mspx
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0737A734-3663-44B1-AA37-2EEB8B969442@.microsoft.com...
>
>

Rapid Prototype Software?

Can someone recommend a software prototyping tool suitable for a web front
end that would collect and store data in a SQL database. I'm looking for
something under $500 that would simulate drop down menus, hyperlinks,
checkboxes and the like. Any suggestions would be appreciated. Thanks, Panc
hotry this:
http://www.microsoft.com/france/msd...rs/default.mspx
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0737A734-3663-44B1-AA37-2EEB8B969442@.microsoft.com...
> Can someone recommend a software prototyping tool suitable for a web front
> end that would collect and store data in a SQL database. I'm looking for
> something under $500 that would simulate drop down menus, hyperlinks,
> checkboxes and the like. Any suggestions would be appreciated. Thanks,
> Pancho|||Parait interessant. Merci, Pancho
"Jéjé" wrote:

> try this:
> http://www.microsoft.com/france/msd...rs/default.mspx
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0737A734-3663-44B1-AA37-2EEB8B969442@.microsoft.com...
>
>

Rapid Prototype Software?

Can someone recommend a software prototyping tool suitable for a web front
end that would collect and store data in a SQL database. I'm looking for
something under $500 that would simulate drop down menus, hyperlinks,
checkboxes and the like. Any suggestions would be appreciated. Thanks, Panchotry this:
http://www.microsoft.com/france/msdn/olymars/default.mspx
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0737A734-3663-44B1-AA37-2EEB8B969442@.microsoft.com...
> Can someone recommend a software prototyping tool suitable for a web front
> end that would collect and store data in a SQL database. I'm looking for
> something under $500 that would simulate drop down menus, hyperlinks,
> checkboxes and the like. Any suggestions would be appreciated. Thanks,
> Pancho|||Parait interessant. Merci, Pancho
"Jéjé" wrote:
> try this:
> http://www.microsoft.com/france/msdn/olymars/default.mspx
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0737A734-3663-44B1-AA37-2EEB8B969442@.microsoft.com...
> > Can someone recommend a software prototyping tool suitable for a web front
> > end that would collect and store data in a SQL database. I'm looking for
> > something under $500 that would simulate drop down menus, hyperlinks,
> > checkboxes and the like. Any suggestions would be appreciated. Thanks,
> > Pancho
>
>