I have a user control that I use to add in one of my sharepoint pages. In that user control I dynamically add a ExcelWebRenderer part as
ewaWebPart.Visible = true;
ewaWebPart.ToolbarStyle = ToolbarVisibilityStyle.None;
ewaWebPart.ChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.None;
ewaWebPart1.WorkbookUri = WorkbookUri;
ewaWebPart.VisibleItem = Constants.TABULAR_NAMED_ITEM; // setting the range name for visible item
this.tdContent.Controls.Add(ewaWebPart); // Adding to table cell
what this code is expected to do is to render the ewaWebPart only showing its visble item ie the mentioned range in the Visible item property but what is happening that some time it shows full workbook and does not show only the visible item (range selected),
but after refreshing the page it works fine i.e. only range item is shown.
Please check what I am doing wrong.
View Complete Post