Microsoft Office Tutorials and References
In Depth Information
Xlviewer Customizations
3. Insert the following code into xlEwa.aspx between the opening <html> tag and the opening
<head> tag:
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
try
{
if (Request.QueryString[“RowsToDisplay”] != null)
{
m_excelWebRenderer.RowsToDisplay = Int32.Parse(
Request.QueryString[“RowsToDisplay”]);
}
else
{
m_excelWebRenderer.RowsToDisplay = 50;
}
if (Request.QueryString[“ColumnsToDisplay”] != null)
{
m_excelWebRenderer.ColumnsToDisplay = Int32.Parse(
Request.QueryString[“ColumnsToDisplay”]);
}
else
{
m_excelWebRenderer.ColumnsToDisplay = 30;
}
}
catch (Exception exc)
{
//error handler
}
}
</script>
The xlEwa.aspx file is now a customized alternative to using xlviewer.aspx. This version of xlEwa.aspx
renders the workbook and displays a grid size of 50 rows by 30 columns by default. In contrast, the
xlviewer.aspx always renders a grid size of 75 rows by 20 columns.
In addition, the code you added to the xlEwa.aspx file enables you to input URL parameters and apply
values to both the RowsToDisplay and the ColumnsToDisplay properties.You can now use xlEwa.aspx
as shown in the following URL:
http://TheExcelServer/_layouts/xlEwa.aspx?id=\\fileShare\trustedLocation\work
book.xlsb&RowsToDisplay=77&ColumnsToDisplay=15
Search JabSto ::




Custom Search