{"id":759,"date":"2008-01-04T19:58:12","date_gmt":"2008-01-05T02:58:12","guid":{"rendered":"http:\/\/members.crystalreportsbook.com\/crystal-reports-xi\/1910-exporting-to-excel\/"},"modified":"2008-01-04T19:58:12","modified_gmt":"2008-01-05T02:58:12","slug":"1910-exporting-to-excel","status":"publish","type":"post","link":"http:\/\/www.crystalreportsonlinetraining.com\/training\/1910-exporting-to-excel\/","title":{"rendered":"19.10 Exporting to Excel"},"content":{"rendered":"<h2>Formatting for Excel<\/h2>\n<p>Exporting a report to an Excel spreadsheet gives you options to work with the report areas and how the columns are formatted. The columns can be formatted so that they have headers and that they are all the same width. Table 19-8 shows the properties used for setting the Excel formatting.<\/p>\n<p>         <b>Table 19-8. ExcelFormatOptions Properties.<\/b><\/p>\n<table border=\"1\">\n<tr>\n<th>Property<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>ExcelAreaGroupNumber<\/td>\n<td>The base area group number if the area type is group area.<\/td>\n<\/tr>\n<tr>\n<td>ExcelAreaType<\/td>\n<td>The area type if you aren&#8217;t using constant column width.<\/td>\n<\/tr>\n<tr>\n<td>ExcelConstantColumnWidth<\/td>\n<td>The width of each column (if using constant column width).<\/td>\n<\/tr>\n<tr>\n<td>ExcelTabHasColumnHeadings<\/td>\n<td>Boolean that determines if the columns have headings listed.<\/td>\n<\/tr>\n<tr>\n<td>ExcelUseConstantColumnWidth<\/td>\n<td>Boolean that determines if the columns are the same width.<\/td>\n<\/tr>\n<\/table>\n<p>         <caution>Exporting to Excel is similar to Word. The export process automatically inserts a footer at the bottom of each page that shows &#8220;Powered by Crystal&#8221; and the Crystal Decisions logo. If you want a continuous flow of data and you don&#8217;t want these page footers appearing in your spreadsheet, you have to open the spreadsheet afterwards and clean it up manually. There is no way to keep this from happening prior to the export.<\/caution><br \/>\n         <code_Caption>Listing 19-6. Setting the format to be an Excel spreadsheet.<\/code_Caption><br \/>\n         <code>Public Sub SetFormatExcel(ByVal MyReport As CrystalDecisions.CrystalReports.Engine.ReportDocument, ByVal UseConstantColumnWidth As Boolean, ByVal ColumnWidth As Integer, ByVal UseColumnHeadings As Boolean)<\/code><br \/>\n         <code>MyReport.ExportOptions.ExportFormatType = _<\/code><br \/>\n         <code>CrystalDecisions.[Shared].ExportFormatType.Excel<\/code><br \/>\n         <code>Dim Options As CrystalDecisions.Shared.ExcelFormatOptions = _<\/code><br \/>\n         <code>New CrystalDecisions.Shared.ExcelFormatOptions<\/code><br \/>\n         <code>Options.ExcelUseConstantColumnWidth = UseConstantColumnWidth<\/code><br \/>\n         <code>Options.ExcelConstantColumnWidth = ColumnWidth<\/code><br \/>\n         <code>Options.ExcelTabHasColumnHeadings = UseColumnHeadings<\/code><br \/>\n         <code>MyReport.ExportOptions.FormatOptions = Options<\/code><br \/>\n         <code>End Sub<\/code><\/p>\n<p>The listing first sets the format type to Excel. After setting the format type, create an options object and set the properties that determine how to format the columns. This procedure sets the properties for the column width and whether the columns should have headings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Formatting for Excel Exporting a report to an Excel spreadsheet gives you options to work with the report areas and how the columns are formatted. The columns can be formatted so that they have headers and that they are all the same width. Table 19-8 shows the properties used for setting the Excel formatting. Table [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,2],"tags":[],"class_list":["post-759","post","type-post","status-publish","format-standard","hentry","category-chapter-19-exporting-and-deploying-reports","category-crystal-reportsnet-2003","entry"],"_links":{"self":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/comments?post=759"}],"version-history":[{"count":0,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/759\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/media?parent=759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/categories?post=759"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/tags?post=759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}