Author Topic: BindingType if no Excel is installed  (Read 8143 times)

0 Members and 1 Guest are viewing this topic.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: BindingType if no Excel is installed
« Reply #15 on: March 04, 2011, 02:58:42 PM »
It could be as easy as System.Data.DataTable.WriteXml(yourFileName).

Hi mohnston, to do this, I must build up the xml content at first. For Excel and OpenOffice the code for content and formatting already exists.
...
Ah, the formatting would be an issue since WriteXML just writes the data to an XML file.
When you open it in a program (Excel or ?) you get just the basic data, columns and rows.


Which is why you provide pre-processing instructions that point to an XSL, as such:
Code: [Select]
<?xml-stylesheet type="text/xsl" href="weld report format (BETA1).xsl"?>
When Excel opens the file, it asks the user which stylesheet to use and lists the provided one as a default.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Jeff H

  • Needs a day job
  • Posts: 6151
Re: BindingType if no Excel is installed
« Reply #16 on: March 04, 2011, 05:30:15 PM »

Care to expand on that statement? (Surely you don't mean that one can omit Void parameters in VB.)

Just meant
C# dynamics are like vb objects with option strict off.

Thanks for the hint.

Let's Scott Hanselman http://www.hanselman.com/blog/BackToBasicsVarDim.aspx do the talking here. He makes the point that C# 3.0 isn't well suited for late-bound, COM-interop, Office Automation work, and has a VB.NET version with and one without Reflection.

On the other hand I think that Option Strict Off is throwing the baby out with the bathwater. You will get a different language with different semantics, which obviously isn't the case with C# 4.0 dynamics. All in all, that's not sufficient to make me want to install VB.NET.

Regards, Thorsten

Sorry I thought I read was not able to use 4.0

Fred Tomke

  • Newt
  • Posts: 38
  • [ Mr. Bad Guy ]
Re: BindingType if no Excel is installed
« Reply #17 on: March 04, 2011, 10:44:12 PM »
You don't need to build up much of anything in XML...

Sounds interesting - but I still don't have any idea about the data you send via WriteXML.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Jeff H

  • Needs a day job
  • Posts: 6151
Re: BindingType if no Excel is installed
« Reply #18 on: March 05, 2011, 05:30:59 AM »
On the other hand I think that Option Strict Off is throwing the baby out with the bathwater. You will get a different language with different semantics, which obviously isn't the case with C# 4.0 dynamics. All in all, that's not sufficient to make me want to install VB.NET.

Regards, Thorsten
Sure you know but to throw it out there
C# 4.0 added optional and named parameters that also simplifies interacting with COM