Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Thursday, March 29, 2012

Delete does not work.

Hi all.
I have used a SqlDataSource in my page with this delete command:
DELETE FROM tblPersonnel WHERE (ID = @.original_ID)
and the "OldValueParameterFormatSring" property of the datasource is "original_{0}".
and i also have a GridView and a button for delete in rows.(it's CommandName is "Delete"). But when i try to delete a record, the record does not get deleted and this button only makes a PostBack on the page! Why doesn't it work?Hmm

Thanks in advance.

Check whether the grid's delete command event is triggered by debugging.

Also, check the parameter value that is passed

|||

Yes. It is triggered. RowDeleting and Even RowDeleted but e.AffectedRows is 0.

|||

Do you have DeleteParameter Original_ID:

<DeleteParameters>
<asp:Parameter Name="original_ID" Type="Int32" />
</DeleteParameters>

|||

Monitor the parameter when deleteing, is it null?

|||

Yes. I have DeleteParameter.
parameters for deleting are not null.
What incomprehensive error!Crying

|||

Can you post your code?

|||

My codes are very long but the main code is here:

<asp:SqlDataSourceID="sdsPersonnel"runat="server"ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:UniversityDBConnectionString %>"DeleteCommand="DELETE FROM tblPersonnel WHERE (ID = @.original_ID)"
InsertCommand="INSERT INTO tblPersonnel(Name, Family, NationalCode, IdentityCardNumber, FatherName, BirthDay, BirthPlace, IsMale, Marital, ServicePlace, EmploymentType, WorkBeginDate, Saved, Education, WorkingField, Duty, IntPhone, ExtPhone, Fax, Email, Image, Type, Culture) VALUES (@.Name, @.Family, @.NationalCode, @.IdentityCardNumber, @.FatherName, @.BirthDay, @.BirthPlace, @.IsMale, Marital, @.ServicePlace, @.EmploymentType, @.WorkBeginDate, @.Saved, @.Education, @.WorkingField, @.Duty, @.IntPhone, @.ExtPhone, @.Fax, @.Email, @.Image, 'AcademicUnit', @.Culture)"
OldValuesParameterFormatString="original_{0}"OnInserted="sdsPersonnel_Inserted"
SelectCommand="SELECT ID, Name, Family, NationalCode, IdentityCardNumber, FatherName, BirthDay, BirthPlace, IsMale, Marital, ServicePlace, EmploymentType, WorkBeginDate, Saved, Education, WorkingField, Duty, IntPhone, ExtPhone, Fax, Email, Image, Type, Culture FROM tblPersonnel WHERE (Type='AcademicUnit') AND (Culture=@.Culture)"
UpdateCommand="UPDATE tblPersonnel SET Name = @.Name, Family = @.Family, NationalCode = @.NationalCode, IdentityCardNumber = @.IdentityCardNumber, FatherName = @.FatherName, BirthDay = @.BirthDay, BirthPlace = @.BirthPlace, IsMale = @.IsMale, Marital=@.Marital, ServicePlace = @.ServicePlace, EmploymentType = @.EmploymentNumber, WorkBeginDate = @.WorkBeginDate, Saved = @.Saved, Education = @.Education, WorkingField = @.WorkingField, Duty = @.Duty, IntPhone = @.IntPhone, ExtPhone = @.ExtPhone, Fax = @.Fax, Email = @.Email WHERE (ID = @.original_ID)">
<DeleteParameters>
<asp:ParameterName="original_ID"Type="Int32"/>
</DeleteParameters>
</asp:SqlDataSource>

<asp:GridViewID="GridView2"runat="server"AutoGenerateColumns="False"DataSourceID="sdsPersonnel"
Width="100%"OnRowDeleted="GridView2_RowDeleted"OnRowDeleting="GridView2_RowDeleting">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ButtonID="btnDeletePersonnel"runat="server"CommandArgument='<%# Eval("Image") %>'
CommandName="Delete"CausesValidation="false"OnCommand="btnDeletePersonnel_Command"
Text="<%$ Resources:Resource, Delete %>"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

protectedvoid btnDeletePersonnel_Command(object sender,CommandEventArgs e)
{
FileInfo fi =newFileInfo(Server.MapPath("~/Upload/Images/Personnels/" + e.CommandArgument.ToString()));
if (fi.Exists)
fi.Delete();
}

|||

I tried to use your code with my database values and everything works like it should. Can you post yourGridView2_RowDeleting andGridView2_RowDeleted events?

Tuesday, February 14, 2012

Default Report Server Web Page

I've only just started working on Sql Server Reporting Services 2005, My role is mainly that of administrator (some other unfortunate sole will be doing the development)

However, I'm having some problems configuring the "Welcome" screen on the server. Currently it looks like a default web directory, I can click through to Data Sources and a directory containing the current test reports:

Looks like:

Wednesday, January 10, 2007 4:14 PM <dir> Data Sources


Wednesday, January 10, 2007 4:14 PM <dir> Test Reports

Clicking on Test Reports

gives:

[To Parent Directory]
Wednesday, January 10, 2007 4:14 PM 15193 Basic Test Report

Question is:
Is there an XML (Or XSL) file somewhere where I can define how the website displays the report directories and names.
Or
Do i need to build a custom web app?

A link in the right direction would be most appreciated!

Thanks

Sam

to access report manager go to http://servername/reports

I hope thats what you're looking for.

|||Hi,

Thanks for the reply, unfortunately thats not what I meant.
What I did need was just some initial guidance on formatting the user access on to the reporting system.

Thanks

Sam|||Forgive me if I dont know what you're looking for. Are you looking for a page that authenticates the user? Maybe if you give us more details we can help you.|||its the http://servername/reportserver page

(I'm guessing now after a little more digging that it is the same format URL for all installations)

Anyway, I just want to be able to customise that to suit the company's needs. I'm not sure if there is a way to edit an XSL file somewhere or if I need to start building a custom web application to act as a portal on to the report server.

Thanks again

Sam|||Here's an example of the page i mean:
http://www.ondotnet.com/dotnet/2004/11/01/graphics/image013.gif

As you can see it looks very basic, I was hoping to be able to make it look a bit prettier :)

Thanks
Sam|||

Sam, like I said in my first post, the portal to the web server is found at

http://servername/reports

Please try that and tell me if thats not what you're looking for.

|||

Ralph,

I think Sam is wanting to know how to modify the page that comes up when you go to http://ServerName/Reports or http://ServerName/ReportServer.

Jarret

|||

Sam Vella wrote:

its the http://servername/reportserver page

(I'm guessing now after a little more digging that it is the same format URL for all installations)

Anyway, I just want to be able to customise that to suit the company's needs. I'm not sure if there is a way to edit an XSL file somewhere or if I need to start building a custom web application to act as a portal on to the report server.

Thanks again

Sam

Sam,

The only way that I know of to accomplish what you are looking for is to create a web application using Visual Studio 2005. Basically you could create a Login page (optionally) along with your own Index page (formatted however you like) with links to the reports.

However, if you're not a developer I must warn you ahead of time that it can get rather involved.

|||Cheers mate,

Just as I feared

No probs about the time just yet either

Sam|||If you're going to go that route, let me know and I'll provide some further direction.|||Just a link to a suitable web resource would be nice
Thanks!|||

I have the same issue, but I was also using reporting services in sql 2000 previously and had a great looking page by default from

http://<servername>/reports/pages/folder.aspx

this took me to a fully formatted page with the ability to set subscriptions. (see below - I've taken out the report links but they were all there)

the equivalent in 2005 found at

C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\Pages

is just what Sam's found a does look very basic.


AC Yule - SQL Reporting Services

Home

Home | My Subscriptions | Site Settings | Help

Help

Search for:

Please enter one or more search terms in the search box

Contents

Properties

Would like to know if anyone's aware that i'm maybe not picking up the right page / link / location in my 2005 installation as i don't see any reason why they would 'downgrade' it.

Thanks

Steven

|||

Sam Vella wrote:

Just a link to a suitable web resource would be nice
Thanks!

I don't exactly have one link that will explain it all.

This link will give you the concepts to use in Visual Studio and SQL (Even though it isn't VS 2005): http://www.codeproject.com/aspnet/AHCreatRepsAspNet.asp

If you want your customized page to be viewable in a web browser, I have found the easiest way is to install Visual Studio Web Application Projects from here: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx

You will also need to enable Internet Information Services. (Control Panel -> Add/Remove Programs -> Add/Remove Windows Components)

Once you have created your Visual Studio Web Application -- create a basic index page with link buttons to your reports -- you will need to publish it to c:\Inetpub\wwwroot using IIS.

If you get stuck somewhere, drop me an e-mail (gmoore@.genevasoftware.com).

|||

Hello Steven,

This page is also in RS 2005. Type this into your browser and you should get the same page as you pasted in your above post. http://<servername>/reports

Jarret

Default Report Server Web Page

I've only just started working on Sql Server Reporting Services 2005, My role is mainly that of administrator (some other unfortunate sole will be doing the development)

However, I'm having some problems configuring the "Welcome" screen on the server. Currently it looks like a default web directory, I can click through to Data Sources and a directory containing the current test reports:

Looks like:

Wednesday, January 10, 2007 4:14 PM <dir> Data Sources


Wednesday, January 10, 2007 4:14 PM <dir> Test Reports

Clicking on Test Reports

gives:

[To Parent Directory]
Wednesday, January 10, 2007 4:14 PM 15193 Basic Test Report

Question is:
Is there an XML (Or XSL) file somewhere where I can define how the website displays the report directories and names.
Or
Do i need to build a custom web app?

A link in the right direction would be most appreciated!

Thanks

Sam

to access report manager go to http://servername/reports

I hope thats what you're looking for.

|||Hi,

Thanks for the reply, unfortunately thats not what I meant.
What I did need was just some initial guidance on formatting the user access on to the reporting system.

Thanks

Sam|||Forgive me if I dont know what you're looking for. Are you looking for a page that authenticates the user? Maybe if you give us more details we can help you.|||its the http://servername/reportserver page

(I'm guessing now after a little more digging that it is the same format URL for all installations)

Anyway, I just want to be able to customise that to suit the company's needs. I'm not sure if there is a way to edit an XSL file somewhere or if I need to start building a custom web application to act as a portal on to the report server.

Thanks again

Sam|||Here's an example of the page i mean:
http://www.ondotnet.com/dotnet/2004/11/01/graphics/image013.gif

As you can see it looks very basic, I was hoping to be able to make it look a bit prettier :)

Thanks
Sam|||

Sam, like I said in my first post, the portal to the web server is found at

http://servername/reports

Please try that and tell me if thats not what you're looking for.

|||

Ralph,

I think Sam is wanting to know how to modify the page that comes up when you go to http://ServerName/Reports or http://ServerName/ReportServer.

Jarret

|||

Sam Vella wrote:

its the http://servername/reportserver page

(I'm guessing now after a little more digging that it is the same format URL for all installations)

Anyway, I just want to be able to customise that to suit the company's needs. I'm not sure if there is a way to edit an XSL file somewhere or if I need to start building a custom web application to act as a portal on to the report server.

Thanks again

Sam

Sam,

The only way that I know of to accomplish what you are looking for is to create a web application using Visual Studio 2005. Basically you could create a Login page (optionally) along with your own Index page (formatted however you like) with links to the reports.

However, if you're not a developer I must warn you ahead of time that it can get rather involved.

|||Cheers mate,

Just as I feared

No probs about the time just yet either

Sam|||If you're going to go that route, let me know and I'll provide some further direction.|||Just a link to a suitable web resource would be nice
Thanks!|||

I have the same issue, but I was also using reporting services in sql 2000 previously and had a great looking page by default from

http://<servername>/reports/pages/folder.aspx

this took me to a fully formatted page with the ability to set subscriptions. (see below - I've taken out the report links but they were all there)

the equivalent in 2005 found at

C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\Pages

is just what Sam's found a does look very basic.


AC Yule - SQL Reporting Services

Home

Home | My Subscriptions | Site Settings | Help

Help

Search for:

Please enter one or more search terms in the search box

Contents

Properties

Would like to know if anyone's aware that i'm maybe not picking up the right page / link / location in my 2005 installation as i don't see any reason why they would 'downgrade' it.

Thanks

Steven

|||

Sam Vella wrote:

Just a link to a suitable web resource would be nice
Thanks!

I don't exactly have one link that will explain it all.

This link will give you the concepts to use in Visual Studio and SQL (Even though it isn't VS 2005): http://www.codeproject.com/aspnet/AHCreatRepsAspNet.asp

If you want your customized page to be viewable in a web browser, I have found the easiest way is to install Visual Studio Web Application Projects from here: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx

You will also need to enable Internet Information Services. (Control Panel -> Add/Remove Programs -> Add/Remove Windows Components)

Once you have created your Visual Studio Web Application -- create a basic index page with link buttons to your reports -- you will need to publish it to c:\Inetpub\wwwroot using IIS.

If you get stuck somewhere, drop me an e-mail (gmoore@.genevasoftware.com).

|||

Hello Steven,

This page is also in RS 2005. Type this into your browser and you should get the same page as you pasted in your above post. http://<servername>/reports

Jarret

Default rendering by report.

Hi All,
Is it possible in RS 2000/2005 to specify a default rendering by
report, within the report manager web page. For example i have a data
extract that users will dump into execl/access so they never want to
see a pretty html rendering so i want that to go straight to csv, other
reports may render straight to pdf or html. I realise i could acheive
this by creating my own report manager, but i think this is quite a
sensible option to expect from the MS report manager.
Thanks for any assistance.
BenI have a user who only likes Excel.
So I created a report that doesn't read any data but consists of some
textboxes. They're formatted in a fancy way to look like buttons. In
the properties | Navigation tab of the textbox I navigate to a URL
which is the "URL access" form (look this up in BOL) for running
reports, from which you can specify parameters, rendering formats, how
much of the RS interface is shown (i.e. parameters, toolbars, document
maps etc.)
It's easy to do and requires no more than for you to look up the URL
access syntax. My user is very happy with this arrangement!
--
Regards
Chris
benaud@.gmail.com wrote:
> Hi All,
> Is it possible in RS 2000/2005 to specify a default rendering by
> report, within the report manager web page. For example i have a data
> extract that users will dump into execl/access so they never want to
> see a pretty html rendering so i want that to go straight to csv,
> other reports may render straight to pdf or html. I realise i could
> acheive this by creating my own report manager, but i think this is
> quite a sensible option to expect from the MS report manager.
> Thanks for any assistance.
> Ben|||Thanks Chris, This is a nice workaround cause it maintains the security
of the report manager... If theres no in-built way of doing what i
want then I will set it up like you suggest. But don't you agree that
the default rendering should be configurable by report?
Ben|||Oh yes, I do agree. There is a wishlist somewhere on microsofts web
site!
--
Regards
Chris
benaud@.gmail.com wrote:
> Thanks Chris, This is a nice workaround cause it maintains the
> security of the report manager... If theres no in-built way of doing
> what i want then I will set it up like you suggest. But don't you
> agree that the default rendering should be configurable by report?
> Ben