Programming

Showing category "classes" (Show all posts)

VB.NET - How to Export Data to Excel with Bar Chart

Posted by SunnyWhite on Tuesday, November 29, 2011, In : Export Data 

In MS Excel, we can create charts according to imported data. Actually, a chart likes an image and it can present data more intuitively. Excel provides several chart styles. One of the most frequently used charts is bar chart.

Bar chart is used to show comparison between items. The items are presented by vertical or horizontal bars. There are three elements to draw a bar chart, group number, group width and group limit.

In this post, I want to introduce the method to export data to Exce...


Continue reading ...
 

Access and Export Data to Access with C#

Posted by SunnyWhite on Thursday, November 17, 2011, In : Export Data 

Access

Access, developed by Microsoft, one of Office applications, is a relational database management system (RDBMS).

Access offers seven things to build objects of database system. They are table, query, form, report, page, macro and template. Also, in order to standardize operation to save, query data, design interface and generate report, it provides users with various guides, builders and templates. Access is very convenient and easy to use because users don’t need to write code ...


Continue reading ...
 

VB.NET-Add Text Watermark in Word

Posted by SunnyWhite on Monday, November 7, 2011, In : Word 

Traditionally, watermark is formed when marking paper. It is not printed on the face of paper but in the middle. Therefore, it can present others from forging the paper which watermark has been added.

Gradually, watermark is applied for electronic documents. As is known, along with sharp development of internet, people often share useful material with Word or other documents online. However, some people may steal the documents. So, the original owners need to take measures to protect the...


Continue reading ...
 

C#--Set Word Font and Color

Posted by SunnyWhite on Wednesday, October 26, 2011, In : Word 

Generally speaking, we may set formatting for a Word document to make it be more readable, especially font and color. For example, if there are several sections in the document, we may set different font or color for the section title. Sometimes, in order to highlight key words, we can set it with bigger font size or bright color. With well formatting, readers can learn more clearly about the idea of each part and the layout will be more appealed after printing.

How to set Word font and ...


Continue reading ...
 

(C#) Convert Word to Tiff Image

Posted by SunnyWhite on Friday, October 14, 2011, In : Word 

Tiff is one kind of image format to save photo and art pictures. This format is flexible and adaptable. It can deal with several images and data in one file through “tag” in file header. Tag can indicate size of image and define how to arrange image data.

Actually, Tiff is the most complicated bitmap file format. One tiff image can occupy large space because it saves lots of contents. At present, it is widely applied to saving and changing images which has high picture quality.

So...


Continue reading ...
 

Use Mail Merge to Generate Files with C# in Word

Posted by SunnyWhite on Wednesday, September 28, 2011, In : Word 

Mail Merge is very useful for generating template file in bulk, such as transcript, questionnaire, invoice and so on.

How to use mail merge in MS Office? Firstly, we need to create a template, which is used to generate frame and main contents of file. Then, we need to have data source. Generally speaking, we can export data from database or create a new Excel file with essential data information. Secondly, set mail merge type and link to data source. Finally, generate mail merge files an...


Continue reading ...
 

The Method to Import Data to Excel from DataTable and Export Excel Data

Posted by SunnyWhite on Friday, September 16, 2011, In : Excel 

Microsoft Excel is an essential tool for office workers. It is very powerful on managing and calculating data. For example, if there are some data about sales information, we can use Excel to calculate average sales and total sales within one quarter. Also, it is convenient for printing if the data in Excel is well formatted.

Actually, if we want to display and operate data, we must import data to Excelfirstly. Where can we get the data? Sometimes, we can type data in Excel, but most of ...


Continue reading ...
 

Method Write and Read Excel Image with C#

Posted by SunnyWhite on Monday, September 5, 2011, In : Excel 

We can find that the blog post with images is more attractive than plain text post. Therefore, people may insert some appropriate images in their posts or documents. Generally speaking, the images are related to contents. For example, if your document has mentioned a series of data, you can insert one image, like analysis chart to make reader be clearer about the data information.

Although we can display data information with chart, sometimes we may need to insert image which shows data ...


Continue reading ...
 

How to Draw Image in PDF with C#

Posted by SunnyWhite on Thursday, August 4, 2011, In : PDF 

It is necessary to have some images in one document to show information more intuitively. Also, the beautiful images with words are more appealed to readers than text only.

Generally speaking, we can insert images in documents directly. And then adjust images’ size or direction according to the requirements. But sometimes, there are not appropriate images for contents so that we may need to draw one. For example, if there must be a chart in a document, we should draw one based on the d...


Continue reading ...
 

How to Create PDF Template Document with C#

Posted by SunnyWhite on Thursday, July 21, 2011, In : PDF 

Template is offered to people who don’t know how to set format for one document or table. Users can fill with contents according to the template or modify it to get better format.

Generally speaking, one template document may include font style and color, spacing and alignment. If the document has several pages, the template may include page number, header and footer of each page.

PDF is one of the most frequently used formats. Therefore, I want to talk something about PDF template,...


Continue reading ...
 

How to Draw Shape in PDF with C#

Posted by SunnyWhite on Monday, July 11, 2011, In : PDF 

At present, more and more e-books and e-magazines are created with PDF because people can insert beautiful images, flash or some other attractive elements in PDF, which make the e-books or e-magazines be more appealed for readers.

Besides inserting images or flash, sometimes, people may draw shapes or tables in PDF document according to the document contents. For example, if one paragraph has shown much data information, the author may create a data table to make reader learn clearly abo...


Continue reading ...
 

How to Paginate PDF with C#

Posted by SunnyWhite on Tuesday, June 28, 2011, In : PDF 

As is known, one book includes cover, back cover, category and contents. Therefore, if we want to create an electronic book, the above elements are needed to be contained. And firstly we should learn how to paginate.

Generally speaking, the electronic books are PDF books. So, in this article, I want to talk how to create PDF pagination.

It is common to use Adobe Acrobat to edit the PDF book. Open it and count pages. Then click advanced. Select document Operation and then choose Pagina...


Continue reading ...
 

How to Protect Excel by Using MS and C#

Posted by SunnyWhite on Wednesday, June 15, 2011, In : Excel 

Generally speaking, people may protect one important document or file by giving a password for it, especially some important or secret files. For office workers, they often record important data in Excel. Therefore, they need to know clearly about how to protect Excel file.

There are several methods to protect Excel file. We can lock the whole worksheet to prevent others from opening or editing it. Also, we can just protect specified Excel rangeor cells.

Firstly, I want to talk somethi...


Continue reading ...
 

Add Word Header and Footer with C#

Posted by SunnyWhite on Wednesday, June 1, 2011, In : Word 

If a word document has many pages, people may add header or footer to show the page number. Sometimes, the header or footer may be symbols which are the topic of the document talk about or the owner of the document.

It is simple to insert add header and footer. Open a Word document. Then click Header and footer on File menu. Type the text or use the format Word provides.

Then, I want to show something about how to add Word header and footer with C#.  

Using the code:

#region add W...


Continue reading ...
 

How to Convert Image to PDF and the Program with C#

Posted by SunnyWhite on Thursday, May 19, 2011, In : PDF 

In PDF, we can insert image to make the contents be colorful and attractive. And it is possible that one image is one PDF document, especially in PDF form. Therefore, we may need to convert image to PDF sometimes.

Except Adobe Acrobat, which is the professional tool to manipulate PDF, there are lots of converters which specialize in converting image to PDF online. The tools are easy to use and the developers will show the guide about how to use the converters. Choose the image you want to...


Continue reading ...
 

How to Set Excel Text Alignment

Posted by SunnyWhite on Friday, March 11, 2011, In : Excel 

Introduction

We often format an Excel worksheet to make it be convenient for reading. Usually, we complete Excel formatting through setting cells styles. For example, if the text in one cell is the title of one column or row, we may set its size to be larger than other cells. Also, we may give a color for text in one cell to show that i...


Continue reading ...
 

How to Decrypt Word Document

Posted by SunnyWhite on Friday, March 11, 2011, In : Word 
In order to make sure that the important information can't be revealed, we may encrypt a Word document by giving it a complicated password. The Word protection function is very powerful that it is difficult to get the encrypted document without password. However, sometimes, we may forget the password if it is too complex or we can't use the protected Word document for a long time.

How to Decrypt Word Document by Using Spire.Doc

In Spire.Doc, you can simply use document.LoadFromFile method to de...

Continue reading ...
 

How to Convert Word to PDF

Posted by SunnyWhite on Tuesday, February 15, 2011, In : Word 

What is PDF

PDF (Portable Document Format) is one kind of electronic document format. PDF is the ideal document format to publish electronic document and deliver digital information on internet for it has nothing to do with operation system. PDF file format can package font, format, color and image in a file. Also, it can include hyperl...


Continue reading ...
 

How to Add a Formula for Excel

Posted by SunnyWhite on Tuesday, February 15, 2011, In : Excel 

Introduction

In an Excel Worksheet, we may import a great deal of data. Sometimes, we need to calculate the data to get another numbers we need. Formula is the mail tool to calculate...


Continue reading ...
 

How to Convert Word Document to XML

Posted by SunnyWhite on Monday, January 10, 2011, In : Word 

Basic Knowledge about XML

When talking about XML, we may think of HTML. Actually, XML is similar to HTML are tag-based languages. The difference between XML and HTML is that the tags which XML uses are not predefined. If we want to create own tags within XML, we need to follow a few rules.

Firstly, only one root element is contained in XML document. The root element is often taken as document element and appears after the prolog section. Besides, all the XML elements should contain end ...


Continue reading ...
 

How to Encrypt Word Document with C#/VB.NET

Posted by SunnyWhite on Monday, January 10, 2011, In : Word 

We may set one password for a file if we don't want others to open it, especially the secrete document. Generally speaking, we are used to writing articles or papers in Microsoft Word. And we may need to encrypt Word document if it is very important for security. Also, when we operate Word by using C#/VB.NET, to encrypt Word document is ...


Continue reading ...
 

How to Use C# to Set Excel Font

Posted by SunnyWhite on Wednesday, January 5, 2011, In : Excel 

In order to show a good-looking Excel file or emphasize one part of Excel, different font styles for cells, which include characters, are needed. Generally speaking, the frequently used styles contain font type, size and color.

Also, developers need to set Excel Font Style in C# during the process to operate Excel, the Excel file is com...


Continue reading ...
 

Method to Use C#.Net to Set Excel Font

Posted by SunnyWhite on Tuesday, January 4, 2011, In : Excel 

When I use Microsoft Word to write an article or paper, I would like to set the font style, for example, setting characters size, color and so on. Generally, I will make the title be larger than other part or give the keywords a specified color to make it be obvious. As the same, we also need to set Excel font for the formatted Excel file ...


Continue reading ...
 

Using C# Excel Interop Class

Posted by SunnyWhite on Tuesday, December 28, 2010, In : Excel 

Sometimes we need to control c# .net excel class in our program in order to make the Microsoft Office c# excel interop assembly working properly. The application program must process a batch of spreadsheets and deal with excel worksheets. Here I would like to offer some tips on c# excel interop performance and introduce you some fundamen...


Continue reading ...
 

Excel Worksheet Object in .Net

Posted by SunnyWhite on Monday, December 27, 2010, In : Excel 

Excel object plays an important role when we operate Excel in .Net for we often need to use Excel object in .Net to realize Excel automation. There are four Excel object classes frequently used, Application, Workbook, Worksheet and Range. I want to discuss something about Worksheet of Excel object.

As one class of Excel object, Workshee...


Continue reading ...
 

C# .Net Used in Excel

Posted by SunnyWhite on Wednesday, December 22, 2010, In : Excel 
We often use Excel during working to record or deal with data for it has a powerful function to calculate data. Usually, we export or update data to Excel manually. It will be a big project if there is thousand of information needed to deal with. VBA macro helps users to realize Excel automation by using object and offers kinds a large number of methods and properties of each object class to control Excel. However, it is also a trouble when we want to get data from outside source even if usin...

Continue reading ...
 

Way to Save Workbook by SaveAs Method in C#

Posted by SunnyWhite on Thursday, December 16, 2010,

We save an Excel file after creating it. We have many methods to save an Excel file, which is often called workbook. Generally, workbook will be saved in the current folder with the name it was given when it was created if we don’t save it by specifying a path. Also, we can save a copy of the workbook without modifying the open workbook in memory.

The first way is to save a workbook without changing the path associated with a document-level customization.

Call the Save method of the This...


Continue reading ...
 

Way to Save Workbook by SaveAs Method in C#

Posted by SunnyWhite on Thursday, December 16, 2010,

We save an Excel file after creating it. We have many methods to save an Excel file, which is often called workbook. Generally, workbook will be saved in the current folder with the name it was given when it was created if we don’t save it by specifying a path. Also, we can save a copy of the workbook without modifying the open workbook in memory.

The first way is to save a workbook without changing the path associated with a document-level customization.

Call the Save method of the This...


Continue reading ...
 

Import Excel Data by Integration

Posted by SunnyWhite on Friday, December 10, 2010,
Data is very important when we create a useful Excel workbook. How do the data come from? Usually, every company has a system database which is used to store a great deal of data, such as finance, staff information and so on. Developers research so much on importing Excel data to make everything become easier. One of the ways to import Excel data is to use Integration service.
There is a good tool to import Excel data which is called SQL Server Integration Service, known as SSIS. Through Excel...
Continue reading ...
 
 

About Me


Recent Posts