45
Sybase DataWindow .NET John Strano [email protected] Technology Evangelist Sybase, Inc.

Sybase DataWindow .NET

  • Upload
    vcotag

  • View
    50

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Sybase DataWindow .NET

Sybase DataWindow .NET

John [email protected] EvangelistSybase, Inc.

Page 2: Sybase DataWindow .NET

Agenda

Overview of DataWindow .NET Windows Forms Demonstration Web Forms Demonstration Q&A Session

Page 3: Sybase DataWindow .NET

Introducing DataWindow .NET

One component for data access and reporting Greatly reduces the amount of code you need to

write in a .NET application Intuitive graphical user interface allows developers to

be productive immediately Patented technology backed up by award-winning

customer support Supports Microsoft® Windows forms, Web forms, and

Microsoft® Windows Mobile-based® Tablet PC applications

Page 4: Sybase DataWindow .NET

DataWindow .NET

Award NominationAward Nomination

Page 5: Sybase DataWindow .NET

What is DataWindow .NET?

DataWindow .NET consists of: A Component that plugs into your .NET development

environment A DataWindow Designer that allows you to graphically

create your data presentation layer A Database Administration Tool to access and graphically

display database information Database drivers to access your RDBMS of choice

Page 6: Sybase DataWindow .NET

What is DataWindow .NET?

At runtime DataWindow .NET consists of: Data entry interfaces Reports Engine that tracks user modifications and dynamically

generates INSERTs, UPDATEs and DELETEs

…all from one tool.

Page 7: Sybase DataWindow .NET

Database Support

Page 8: Sybase DataWindow .NET

Introducing DataWindow .NET

Presentation Styles

Page 9: Sybase DataWindow .NET

Presentation Styles

Page 10: Sybase DataWindow .NET

Report Styles

Page 11: Sybase DataWindow .NET

Freeform Style DataWindow

Page 12: Sybase DataWindow .NET

Tabular Style DataWindow

Page 13: Sybase DataWindow .NET

Grid Style DataWindow

Page 14: Sybase DataWindow .NET

Graph Style DataWindow

Page 15: Sybase DataWindow .NET

Label Style DataWindow

Page 16: Sybase DataWindow .NET

N-Up Style DataWindow

Page 17: Sybase DataWindow .NET

Group Report Style DataWindow

Page 18: Sybase DataWindow .NET

Nested Report Style DataWindow

Page 19: Sybase DataWindow .NET

Composite Report Style DataWindow

Page 20: Sybase DataWindow .NET

Cross Tab Style DataWindow

Page 21: Sybase DataWindow .NET

Introducing DataWindow .NET

Additional Features

Page 22: Sybase DataWindow .NET

Drop Down DataWindows

Think of them as enhanced Combo BoxesThink of them as enhanced Combo Boxes

Page 23: Sybase DataWindow .NET

DataWindow Validation Rules

Validation rule files

Page 24: Sybase DataWindow .NET

Over 1000 properties that can be accessed and manipulated at both design time and runtime

Approximately 200 methods to access and control data and the DataWindow

Lots of events for even greater control ItemChanged, ItemError, SQLPreview,

RowFocusChanged, etc.

DataWindow .NETMore Information

Page 25: Sybase DataWindow .NET

DataWindow .NETMore Information

Edit Masks and formatting Computed Fields for client-side processing Supports SQL, stored procedures and external data

sources Easy printing of DataWindows ( dwc.Print() ) Dynamic creation of DataWindows at runtime And much more!

Page 26: Sybase DataWindow .NET

Reduce CodeExample: Setting the Autosize Height on a Row

public void AutoSizeGrid() { // DataGrid should be bound to a DataTable for this part to // work. int numRows = ((DataTable)gridTasks.DataSource).Rows.Count; Graphics g = Graphics.FromHwnd(gridTasks.Handle); StringFormat sf = new StringFormat(StringFormat.GenericTypographic); SizeF size;

// Since DataGridRows[] is not exposed directly by the DataGrid // we use reflection to hack internally to it.. There is actually // a method get_DataGridRows that returns the collection of rows // that is what we are doing here, and casting it to a System.Array MethodInfo mi = gridTasks.GetType().GetMethod("get_DataGridRows", BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);

System.Array dgra = (System.Array)mi.Invoke(gridTasks,null);

// Convert this to an ArrayList, little bit easier to deal with // that way, plus we can strip out the newrow row. ArrayList DataGridRows = new ArrayList(); foreach (object dgrr in dgra) { if (dgrr.ToString().EndsWith("DataGridRelationshipRow")==true) DataGridRows.Add(dgrr); }

// Now loop through all the rows in the grid for (int i = 0; i < numRows; ++i) { // Here we are telling it that the column width is set to // 400.. so size will contain the Height it needs to be. size = g.MeasureString(gridTasks[i,1].ToString(),gridTasks.Font,400,sf); int h = Convert.ToInt32(size.Height); // Little extra cellpadding space h = h + 8;

// Now we pick that row out of the DataGridRows[] Array // that we have and set its Height property to what we // think it should be. PropertyInfo pi = DataGridRows[i].GetType().GetProperty("Height"); pi.SetValue(DataGridRows[i],h,null);

// I have read here that after you set the Height in this manner that you should // Call the DataGrid Invalidate() method, but I haven't seen any prob with not calling it..

}

g.Dispose(); }

DataGridDataGrid

DataWindoDataWindoww

Page 27: Sybase DataWindow .NET

Reduce CodeExample: Setting a Column Style to Checkbox

// code assumes you have a DataSet named myDataSet, a table named "EastCoastSales" and a DataGrid myDataGrid //STEP 1: Create a DataTable style object and set properties if required.      DataGridTableStyle ts1 = new DataGridTableStyle();

     //specify the table from dataset (required step)      ts1.MappingName = "EastCoastSales";            // Set other properties (optional step)      ts1.AlternatingBackColor = Color.LightBlue;

//STEP 2: Create a string column and add it to the tablestyle      DataGridColumnStyle TextCol = new DataGridTextBoxColumn();      TextCol.MappingName = "custName"; //from dataset table      TextCol.HeaderText = "Customer Name";      TextCol.Width = 250;      ts1.GridColumnStyles.Add(TextCol);

//STEP 3: Create an int column style and add it to the tablestyle      //this requires setting the format for the column through its property descriptor      PropertyDescriptorCollection pdc = this.BindingContext            [myDataSet, "EastCoastSales"].GetItemProperties();

     //now created a formated column using the pdc      DataGridDigitsTextBoxColumn csIDInt =            new DataGridDigitsTextBoxColumn(pdc["CustID"], "i", true);      csIDInt.MappingName = "CustID";      csIDInt.HeaderText = "CustID";      csIDInt.Width = 100;      ts1.GridColumnStyles.Add(csIDInt);

//STEP 4: Add the checkbox      DataGridColumnStyle boolCol = new DataGridBoolColumn();      boolCol.MappingName = "Current";      boolCol.HeaderText = "Info Current";

//uncomment this line to get a two-state checkbox      //((DataGridBoolColumn)boolCol).AllowNull = false;

     boolCol.Width = 150;      ts1.GridColumnStyles.Add(boolCol);

//STEP 5: Add the tablestyle to your datagrid's tablestlye collection      myDataGrid.TableStyles.Add(ts1);

DataGridDataGrid

DataWindowDataWindow

Page 28: Sybase DataWindow .NET

Reduce CodeExample: Adding a Combo Box

     // Step 1. Derive a custom column style from DataGridTextBoxColumn      //     a) add a ComboBox member      // b) track when the combobox has focus in Enter and Leave events      // c) override Edit to allow the ComboBox to replace the TextBox      // d) override Commit to save the changed data

     // Step 2 - Use the combo column style      // Add 1 col with combo style      DataGridComboBoxColumn ComboTextCol = new DataGridComboBoxColumn();      ComboTextCol.MappingName = "custCity";      ComboTextCol.HeaderText = "Customer Address";      ComboTextCol.Width = 100;      ts1.GridColumnStyles.Add(ComboTextCol);

     // Step 3 - Additional setup for Combo style      // a) make the row height a little larger to handle minimum combo height      ts1.PreferredRowHeight = ComboTextCol.ColumnComboBox.Height + 3;      // b) Populate the combobox somehow. It is a normal combobox, so whatever...      ComboTextCol.ColumnComboBox.Items.Clear();      ComboTextCol.ColumnComboBox.Items.Add("Chicago");      ComboTextCol.ColumnComboBox.Items.Add("Corvallis");      ComboTextCol.ColumnComboBox.Items.Add("Denver");      ComboTextCol.ColumnComboBox.Items.Add("Great Falls");      ComboTextCol.ColumnComboBox.Items.Add("Kansas City");      ComboTextCol.ColumnComboBox.Items.Add("Los Angeles");      ComboTextCol.ColumnComboBox.Items.Add("Raleigh");      ComboTextCol.ColumnComboBox.Items.Add("Washington");

     // c) set the dropdown style of the combo...      ComboTextCol.ColumnComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

DataGridDataGrid DataWindowDataWindow

Note: For data from a database even more code would be required!Note: For data from a database even more code would be required!

Page 29: Sybase DataWindow .NET

Demonstration OneWindows Forms

Page 30: Sybase DataWindow .NET

Demonstration TwoWeb Forms

Page 31: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 32: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 33: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 34: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 35: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 36: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 37: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 38: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 39: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 40: Sybase DataWindow .NET

What’s Possibledw-eXtreme.com

Page 41: Sybase DataWindow .NET

Demonstration Fourdw-eXtreme.com “Planner”

Page 42: Sybase DataWindow .NET

Session Summary

Provided an overview of DataWindow .NET features

Demonstrated how DataWindow .NET can be used in .NET Windows Forms applications

Demonstrated how DataWindow .NET can be used in ASP.NET applications

Page 43: Sybase DataWindow .NET

Roadmap for DataWindow .NET

DataWindow .NET 1.5 WebForms and ASP .NET Direct access to DataWindow object properties using the

DataWindow .NET object model Ink Edit and Ink Picture Controls General availability April 8, 2005

DataWindow .NET 2.0 Support for .NET Datasets and DataTables Additional ADO .NET support Integrate DataWindow Designer into the Microsoft® Visual Studio® IDE Support for Microsoft® .NET Framework 2.0 and ASP .NET 2.0 Release planned for late 2005

Page 44: Sybase DataWindow .NET

DataWindow .NETResources

Newsgroup: Forums.sybase.com – sybase.public.datawindow.net http://www.sybase.com/support/newsgroups

Blogs: http://www.teamsybase.net/blogs

Code Examples: http://datawindownet.codexchange.sybase.com

Product Information and Evaluation Copy: http://www.sybase.com/datawindow.net

Replay of MSDN live webcast: http://www.microsoft.com/events/webcasts/library/200503.mspx

DataWindow .NET 1.5 Evaluation Download http://response.sybase.com/forms/dwnet15eval

Page 45: Sybase DataWindow .NET

Questions and Answers

Q&A

[email protected]