.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Cannot retain changes when using excelservices and C#

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :SharePoint
Sirs, I am fairly new to the sharepoint development coming from  what is described as a hackware c# background.  I am trying to build an application that has two webparts, the first has a left pane which pulls data from and excel spreadsheet and saves data to the excel spreadsheet based on user inputs.  The second pane will be a visio webpart that will update based on the information in the spreadsheet when the page is reloaded. Now for my issue, I am trying to build the framework for the excel functionality.  What I have created is a simple form with three buttons.  The first writes a bunch of data to cells in a spreadsheet.  The second reads the value of the cells.  The third writes different values to the cells.  This way I can run one button to write data, read the data, write different data, and read it again to make sure everything is changing. The problem is that the excel spreadsheet will not update.  If I click the read data button, it is blank.  If I navigate to the spreadsheet in my documents folder, it is unchanged when Click to view it.  However, when I click edit in browser, the changes are there.  When I close it again, and view it in the browser, there are no changes. Does this have anything to do with permissions, impersonation, or the document folder properties?  I am sitting at the server

View Complete Post

More Related Resource Links

Retain DropDown,TextBox's previously selected values after redirected from another page.


 Hi People, How are you all doing?

I have 2 pages one is SearchPage & It has DropDowns, textboxes to specify the search criteria. From the search result the user is redirected to another page when he clicks the hyperlink in the search result  where he fills in the information and again redirected to SearchPage. Now the SearchPage is posted back with no state i just want to retain the search criteria and display when user comes back. Please give me some suggestion how to get this done. I've used ViewState to save the values and check them in Page_Load but they are null.   



 Update: I've come up with this code. But the problem is The values are being retained but the Button_Click event is not being handled properly. When i Check the code even after this "DropDownList1.SelectedValue = Session["Name"].ToString();" DownList1.SelectedValue is EMPTY"" samw with DropDownList2 . please Suggest something


    protected void Page_Load(object sender, EventArgs e)
        if (IsControlsEmpty())
            if (SessionExist())
                DropDownList1.SelectedValue = Session["Name"].ToString()

Join 2 flat file data flows - retain unmatched rows

I have two data flows from two separate flat files. They may contain matching IDs (account number), in this case specific data from each flow should be used to create one row. When there is no match, the rows would stand on their own. At the end of the flow, I need both flows combined into one flow, with one record for each key record (account number). If I were able to use a look-up, I could easily union the no-match data flow back into the match data flow and have the desired result. I cannot use a look-up, since the source is flat files, but this is exactly the functionality I am trying to achieve. Solutions I want to avoid: staging tables, and cache transformations. Any ideas are appreciated.

how to retain data in dynamic textboxes

Hello there, more than 24 hours of googling up by now but i hv'nt yet found the commendable solution of my problem. Actually what i searching is ihave a bunch of textboxes created dynamically on the basis of no. of rows in a sql table i put in some data in these textboxes and inserting in other table and here comes the actual problem i have to create the dynamic controls on every postbacks otherwise controls does disappear. other thing i can do is recreate the table on insert button click but in that way i am able to insert the data in the table and recreate the controls but this way text in dynamic textboxes does not remain there. any help in this context would be highly appreciable. thanks in advance  

What is the best way to nest Listviews together and have all listivew columns retain the same width

I have 3 listviews that I need to be come one.  Each listview has a different source, but information from each is used in the other for totals. I have no problem nesting the listviews one after another to look as if they are actually one listview in the end, but I need to figure out a way to make the  columns identical.  What is the easiest way to do that? Thanks 

Jquery.tools tabs doesn't retain tab index on postback

The graphic designer of a project I'm building a web site for chose jquery.tools (http://flowplayer.org/tools/tabs/index.html) for a tabs tool in the site. Unfortunately it seems that the tool doesn't behave properly on a postback in IE7 or IE8 (it does behave properly in FireFox, Chrome and Safari). Does anyone have experience using the jquery.tools with asp.net? and know how to retain the tab index on a postback? I've tried a lot of things and can't get it to work. The code i'm using now is as follows:           $("ul.tabsScenario").tabs("div.panes > div");         var tabIndex = $('#ctl00_ContentPlaceHolder1_EnInDeToekomst1_HiddenFieldTabIndex').val();         $("ul.tabsScenario").tabs('select', tabIndex); where the tab index is stored in a hidden field (HiddenFieldTabIndex). The above code works fine in Firefox, Chrome and Safari, but not in IE7 or IE8. I am using a ScriptManager and UpdatePanels, but in an extremely simple website example I can't even get the jquery.tools tabs tool to work. There are some unanswered posts on the Jquery.Tools forum concerning this topic, but yeah, that doesn't help much. I've already determined that the

Retain previous selection in a modal window when it is reopened within same session

Hi ! I have a modal which have a listbox inside it. I am passing the values through a session to the parent page. Suppose, i made few selections on the modal page and i closed it. I want to see the same selection on the modal page once i reopen the modal window Is there any possibility to retain the previous selection in a modal window? I used <body onload="window.focus();" onblur ="this.focus" > but this doesn't work Any idea please?  

retain polygon colour



I have 2 qustions concerning a map I build:

1.I have several polygons in a map- each holding different clinics.

The plygon colour is set according to a score each district (polygon) achieved - red - yellow - green.

I also have a parameter allowing to see a specific district with its affiliated clinics .

Can I retain the polygon colour as showed in the nationwide visualization (first step), to a specific district (polygon) visualization (after a district was selected, from the parameter districts list) ?

Right now it is always red, no matter what the polygon colour was in the initial visualizaion.

2 the clinic's lables overlap each other. Can I make half of the clinic lable visible, and the other half hidden - this way the map will look less "crowded"?

The half that has hidden lable will have a tooltip holding it's name, while the second half will have thier  lable property set to its name.





Trying to Retain Values in a FormView When Validations fails or the SQL Fails on an Insert


To me this should be much easier, but I can't seem to retain the values that are put in the Insert template upon a validation failure or when the sql fails. This will prevent the user from having to retype everything agin in the event of a failure.

As you can see I am using the Sub Insert_Click and not using an insert through the wizard. so the fields are unbound textboxes on the form. There are 2 dropdowns that provide choices for the other fields.

Any help would be appreciated. I pasted in the code using the text only option becuase the format was getting messed up. I porboably need more background on why the fields are blanking out.



See Code below



Protected Sub InsertButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)

' Dim sqlparm As String

Dim con As Data.SqlClient.SqlConnection = Nothing

Dim cmd As Data.SqlClient.SqlCommand = Nothing

Dim dr As Data.SqlClient.SqlDataReader = Nothing

Dim sql As String = ""

Dim x As Integer

' Dim x As Integer



If CType(Me.fvwAppSecurityDetails.FindControl("CorpIDTextBox"), TextBox).Text = "" Then

Me.lblMessage.Text = "CorpID cannot be blank"

Exit Try

Else : Page.Session("CorpID&

Retain partial data in model over the post backs


Hello Everyone,

I have recently started learning ASP.NET with MVC 2 Framework, I am facing difficulties in the following scenarios

In my MVC application I want to retain partial information in Model over post backs.

Following is my scenario,

1.    I initiate "Edit" of main record by clicking date hyperlink from left navigation.
2.    Amend some data.
3.    Save the record.
4.    "Edit" sub record of the saved record by clicking another hyperlink from bottom left navigation panel.

The page is divided in to 6 tabs, the first 5 tabs shows the data for the main record and the 6th tab shows data of sub record.  Wehn we "Edit@ sub record the previous 5 tabs doesn't have any changes noted, that means there is no harm in keeping their details intact in the main model.  So is there a way to access model in the controller on hyper link click action so that I can only load the data for the clicked sub record (I am asking this, because the hyperlink click uses HTTP GET method so no model parameter passed in action method). If no, then how do I retain partial values in the Model over post backs?

Note that each tab data have been kept in individual models, and a main model has a collection member to hold all these individual models together.

How to set a link in Calendar Control and retain text in the control?


Hi Community

    This is my first time in this forum.

    I have a Calendar Control that I added text that show scheduled meetings on certain dates and it works okay.
The problem is that when I click on a date I need to http to another web page or sometimes goto a web page in
the same web site.  The problem is  when the code that  creates the hyperlink runs it replaces the text displaying "meetings"
scheduled for that date instead appending the link to the date and retaining the "meetings" text that was already there.

fyi, e.Day.Date.Day matches any number entered.

Below is how I set that up with the code that adds the meetings followed by the url code that replaces the meetings text: 

public partial class _Default : System.Web.UI.Page


string[,] vholidays = new

How to retain form value in MVC's view after went to another page?


I have a list page that show a list to records base on the search value entered in a form on the top of the page. When I click on one of the record to go to the edit detail page, and then click on "Back" in the browser or the "Cancel" button on the page, it will go back to the list page, but the form on the list page will not retain the value entered earlier.

How to retain form value in MVC's view after went to another page?

Retain querystring values in ReturnURL?


I've got a couple pages in my web app that are used by external applications.  They will link to the pages, and pass in various querystring values to allow my app to do the searching and return the results in the page.  The problem is, if the user is not yet logged into the web app, they are sent to the login page, and the ReturnURL is truncated to include only the first QueryString value.  I lose the rest of the values.  So far I haven't figured out a solution to this.  Here's a quick example:

The external application links the user to:


If the user is not logged in they are sent to the login page, and the current URL looks like this:


Anyone kow how to get around this? 

Thanks for your help!


Unable to retain Global XSLT parameter value on Listview webpart when paging



Hi Gurus,


We are working on SharePoint 2010.


We implemented Pagination for a listview webpart, on which our custom xslt is applied. We achieved it by applying a pagination xslt to the webpart.


However, we want to filter the listitems appearing in the listview webpart using a pagesfilter webpart(our custom developed webpart for filtering values from the list) on the same page.

We enabled the “Enable Asynchronous Update” property of the listview webpart for pagination.


Script Component Doesn't Retain References To DLL

I'm using SQL 2008 Integration Services and I made a reference to an external Dll. I save the changes but when I go back into the script component, the references are gone!!! What happened? How can I make my reference in the VB.Net script portion of the Script Component (not Script Task) stay/persist/stick around?
DJ Baby Anne's Biggest Fan................

BDC filter and web parts to retain selection for entire session



We have a collection of web parts (bdc list, document lists, tasks and others) which all show filtered data according to the selection made by the user via a BDC filter. 

When the user browses around and potentially goes into a parent or sub site we want their choice to be retained so that the next time the come back to the originating page it's contains all the same filtered information. 

Whether by a cookie or a session variable or however it's done it doesn't matter, however we really need it to be really simple and avoid managed code if at all possible - so a configuration/SharePoint Designer solution preferably.

thanks in avance

Retain | (pipe) delimiter in XML Response



I'm calling a web service using HTTPWebRequest and the response XML has a field which a very long sting and that has pipe(|) delimiter part of it. But somehow that pipe delimiter and the characters before that are lost when I check the XML string. Is there any reason why this happens and any suggestion to retain the pipe delimiter. Below is the code I'm using.

HttpWebRequest webRequest = (HttpWebRequest) HttpWebRequest.Create(mUri);

webRequest.Headers.Add(@"SOAPAction", @"""""");
webRequest.Method = "POST";
webRequest.ContentType = "text/xml";
webRequest.ContentLength = (long) request.Length;

Stream reqStream = webRequest.GetRequestStream();
reqStream.Write(request, 0, request.Length);

XmlDocument doc = new XmlDocument();
HttpWebResponse webResponse =

if (webRequest.HaveResponse) {
 Stream stream = webResponse.GetResponseStream();



How I did retain the page layout of a subreport?



I have a master report that contains 3 subreports. I will be exporting to PDF. I have 1 subreport that is 14x8.5 landscape & 2 that are 8.5x11 portrait.

The executives do not want these 3 reports distributed via email separately & pg layout has always had a strict requirement.

After I render to PDF, it appears all subreports adopt the master report layout.

Is it possible to maintain each subreports page layout?

I'm using SQL SSMS/BIDS Visual Studio 2008 & deploy reports to SSRS 2008 R2 with Report Builder v3.0.

Thanks, Jeff

Jeffrey Daley
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend