Erika Ehrli - Adventures with Office Products & Technologies
MSDN & TechNet: Releasing Office, SharePoint, Exchange & Lync Centers and content for developers and IT professionals.

The official name: 2007 Microsoft® Office system

The official name: 2007 Microsoft® Office system

  • Comments 10

Finally, I am able to spell the real name for the next version of Office: 2007 Microsoft® Office system.

For those of you who have not seen the press passes and want to catch-up here is a list with some of them:

See the 2007 Microsoft Office System Pricing and the 2007 Microsoft Office System Packaging.

Maybe you have heard that this is the biggest release of the decade, and I can tell you that this version of Office has great potential as a development platform. Lots of features/enhancements were announced on Beta 1 and for Beta 2 there are more cool surprises waiting to be announced.

My latest experiment with 2007 Microsoft® Office :) is exporting an ASP.NET 2.0 GridView to Excel 2007. If you use the following code snippet, you will be able to export the content of a SqlDataSource (used to DataBind a GridView) to Excel (without automation):

   protected void ExportToExcel() {
        Response.Clear()
;
        
Response.Buffer = true;
        
Response.ContentType "application/vnd.ms-excel";
        
Response.Charset "";
        this
.EnableViewState = false;

        
System.IO.StringWriter sw = new System.IO.StringWriter();
        
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);

        
GridView grid = new GridView();
        
grid.DataSource SqlDataSource1.Select(DataSourceSelectArguments.Empty);
        
grid.AutoGenerateColumns = true;
        
grid.DataBind();
        
grid.RenderControl(htw);

        
Response.Write(sw.ToString());
        
Response.End();
    
}

We built a Web based application for MSDN content management, and we export reports to Excel 2003 using the previous snippet of code. One thing that we don't like is that we lose all formatting, so we have the data, but then we have to make it pretty again.

I ran the same process on a machine where I have the last build of 2007 Microsoft® Office and Excel 2007 is smart enough to keep my formatting. Another cool enhancement. For those of you who have Beta 1, please give it a try.

Leave a Comment
  • Please add 5 and 5 and type the answer here:
  • Post
  • Well, not quite "Office 2007" -- "2007 Microsoft Office System."  Whoever decided to put the 2007 first should get a stern talking-to.
  • Hi All,

    I had to edit this blog entry to comply with the naming conventions. So here's the thing:

    As a system, the real name is 2007 Microsoft® Office system.

    The suite product names are: Microsoft® Office <Edition> 2007. See the 2007 Microsoft Office System Packaging.

    Finally, each program can be called <Program> 2007.

    For more details see:
    http://www.microsoft.com/office/preview/suites.mspx
  • This still doesnt work for me. It worked in Excel 97 but in Excel 2007 I keep getting the error

    The file you are trying to open, <filename>, is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? <Yes> <No> <help>

    The only difference in code is that - I was also doing

    Response.AddHeader("content-disposition", "attachment;filename=somename.xls");

  • Hi,

    I an experiencing the same problem... It looks like Office 2007 issue (doesn't seem to me to be fixed :-()

    http://office.microsoft.com/en-us/products/FX101517941033.aspx

  • http://office.microsoft.com/en-us/products/FX101633871033.aspx#9

    Looks like this will not be fixed in the final release version.

  • Hi! The above codes will produce a prompt box asking me whether I would like to "Open", "Save As", or "Cancel", can you suggest how can I go about avoiding the propmt box? Thank you!

  • Rename the export file to .xlsx and your problem is solved.

    Sandeep

  • But I don't know whether my clients will have Office 2003 or Office 2007 installed.  If I just name the file ".xlsx" then my downloads won't work for many clients.  Is there any way to have the client machine check which verison of MS Office is opening up and determine the file extension on the fly based on that?

  • I'm with Shira. That's not much help at all.

Page 1 of 1 (10 items)