Guide for C#
Core Document Formats
Windows Forms Viewer
Additional Features

C# Excel - Windows Document Viewer for Excel

Online C# Tutorial for Windows Excel Document Viewer Creation & Customization

Visual C#
VB.NET
Home > .NET Imaging SDK > C# > Create C# Excel Windows Viewer

"This online guide content is Out Dated!
    Please get the latest Create Excel Windows Viewer Developer Guide here.
"

C# Excel Document Windows Viewer - Overview
In addition to Web Document Viewer for Excel, RasterEdge also provides a C#.NET Windows Viewer Solution for Excel (.xlsx) file viewing and processing, named RasterEdge.Imaging.WinformsControl.DocumentViewer.dll. This .NET control is mature enough for various needs in C#.NET programming, like Excel loading, navigating, annotating, converting, saving, etc. Here we list the main features of WinViewer control.
Related .net document control helps:
asp.net dicom document viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net dicom document viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net dicom document viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
  • Perfectly work with Microsoft Visual Studio 2005 and above versions
  • Create high-quality image thumbnails in Windows Document Viewer and automatic navigation from thumbnails to main viewer
  • User-defined Excel (.xlsx) document page viewing by contorlling mouse to fit width, height, or both
  • Easy to view, edit, annotate and save Excel (.xlsx) document at fast speed
Windows Viewer Control APIs for C#.NET Excel Viewing
RasterEdge.Imaging.WinformsControl.DocumentViewer.dll provides C#.NET developers with various APIs. All these APIs can be invoked in C#.NET program for quick Excel document (sheet/page) loading, navigating, viewing, annotating and rotating.
Designed APIs: LoadFromFile(String filePath), SaveFile(String filePath), UpPage, DownPage, ZoomIn, ZoomOut, FitWidth, FitHeight, ShowOneToOne, AddPage, DeletePage, Roate90, Rotate180, Rotate270, DrawText, DrawFreehand, DrawLine, DrawPolygonLines, DrawFilledRectangle, DrawRectangle, DrawHighLight, DrawEllipse, DrawPolygon, DrawRubberStamp, BurnAnnotation, and DeleteAnnotation.
How to Create Windows Viewer for C#.NET Excel Viewing
This part illustrates how to add .NET WinViewer control to your C#.NET project, invoke APIs of this control to open Excel (.xlsx) file from specified path and draw an annotation on Excel spreadsheet.
  1. In C#.NET Windows Forms project, you should firstly add "RasterEdge.XDoc.WindowsViewer.dll" to VS Toolbox: righ-click Toolbox, select "Choose Items...", and browse to find & select WinViewer DLL;
  2. Drag the added WinViewer Control from Toolbox to your C#.NET WinForms application;
  3. Copy the following C# code to design Excel file open dialog. Later, you can directly load an Excel document into C#.NET Windows Viewer Control;
  4. If the Excel file format is not supported by .NET WinViewer control, there will prompt a window "cannot open your file".
If you want to try more functions (design Thumbnail, Navigation, Zoom and so on), please refer to Create Windows Viewer Guide.
public void Form1()
{
	InitializeComponent();
	// Set the windows viewer display options.
	ViewerOptions option = new ViewerOptions();
	// Set the windows viewer height and width. This step is necessary, otherwise will crash.
	option.DocViewerWidth = 400;
	option.DocViewerHeight = 400;
	// Show the thumbnail, true or false.
	option.ShowThumb = true;
	// The location of thumbnail, left, right, top or bottom.
	option.ThumbDock = ThumbDock.Left;
	// Set the thumbnail height
	option.ThumbViewerHeight = 1000;
	// Set whether the document viewer is spread as winViewer
	option.SizeByDocViewer = false;
	// Create windows viewer form.
	winViewer = new WinViewer(option);
	winViewer.Height = 800;
	winViewer.Width = 1000;
	// Add the windows viewer to your own form.
	this.panel1.Controls.Add(winViewer);
}
private void OpenFile_Click(object sender, EventArgse)
{
	OpenFileDialog ofd = new OpenFileDialog();
	ofd.Filter = "(*.*)|*.*";
	ofd.Multiselect = false;
	if (ofd.ShowDialog() == DialogResult.OK)
	{
		this.winViewer1.LoadFromFile(ofd.FileName);
	}
}
  1. Call a single method for each kind of annotation that you want to support in your Windows Excel Document Viewer toolbar button's Onclick events. Resizing, burning, deleting and moving are all built in.
private void HighLight_Click(object sender, EventArgse)
{
this.winViewer1.DrawHighLight();
}

private void Text_Click(object sender, EventArgse)
{
this.winViewer1.DrawText();
}
In the download package of DocImage SDK for .NET, you will find detailed user manual for how to customize Windows Document Viewer Control, like customizing toolbar, annotation style, drop-down list, file saving, etc.


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com