Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
csharp
csharp
titleC#


            PowerPointTemplate pptt = new PowerPointTemplate();
            pptt.Open(@"C:\DataBinding\ArrayBindingTemplate.pptx");

            string[] values = {"Hello World", "subtitle"};
            string[] colNames = {"header", "subtitle"};
            DataBindingProperties DataProps = pptt.CreateDataBindingProperties();

            pptt.BindData(values, colNames, "DataSource1", DataProps);
            pptt.Process();
            pptt.Save(Page.Response,
               "ArrayBinding.pptx",
               false);


Code Block
vbnet
vbnet
titlevb.net
        Dim pptt As New PowerPointTemplate()
        pptt.Open("C:\DataBinding\ArrayBindingTemplate.pptx")


        Dim values = New String() {"Hello World", "subtitle"}
        Dim colNames = New String() {"header", "subtitle"}
        Dim DataProps As DataBindingProperites = pptt.CreateDataBindingProperties();

        pptt.BindData(values, colNames, "DataSource1", DataProps);

...

Code Block
csharpcsharp
titleC#
        pptt.Process()
   PowerPointTemplate pptt = new PowerPointTemplate();
 pptt.Save(Page.Response, _
         pptt.Open(@"C:\DataBinding\ArrayBindingTemplate.pptx");
     "ArrayBinding.pptx", _
               False)

Two dimensional array:

Example

Code Block
csharp
csharp
titleC#


          string[][] twodim = {
               new string[]{"Watertown", "MA", "02472"},
               new string[]{"Washington", "DC", "20500"}
               };
          string[] names = {"City", "State", "Zip"};
          pptt.BindData(twodim,
               names,
               "TwoDimArray",
               pptt.CreateDataBindingProperties());
          pptt.PreserveStrings = true;
          pptt.Process();
          pptt.Save(Page.Response,
               "ArrayBinding.pptx",
               false);
        
Code Block
vb.netvb.netvbnet
vbnet
titlevb.net

          Dim pptt As New PowerPointTemplate()
          pptt.Open("C:\DataBinding\ArrayBindingTemplate.pptx")
          Dim twodim()() As String = New String()() { _
               New String(){"Watertown", "MA", "02472"}, _
               New String(){"Washington", "DC", "20500"}, _
               }
          Dim names As String() = {"City", "State", "Zip"}
          pptt.BindData(twodim, _
               names, _
               "TwoDimArray", _
               pptt.CreateDataBindingProperties())
          pptt.PreserveStrings = True
          pptt.Process()
          pptt.Save(Page.Response, _
              "ArrayBinding.pptx", _
               False)
        

...