Friday, February 12, 2010

VS2008 Win Form - Calling Crystal report

Dim objRPT As New rptmatchstats

Dim objfrmRPTViewer As New frmreportviewer

'Note: The form has to be shown first, other wise report parameters are prompted
objfrmRPTViewer.CRPTViewer.Visible = False
objfrmRPTViewer.MdiParent = Me.MdiParent
objfrmRPTViewer.WindowState = FormWindowState.Maximized
objfrmRPTViewer.Show()

objRPT.PrintOptions.PaperSize = CrystalDecisions.[Shared].PaperSize.PaperLetter

oConn.applyLogonInfo(objRPT)

'Set Parameters
oConn.assignParameterValueToReport(objRPT, "@id", 10)

objfrmRPTViewer.CRPTViewer.ReportSource = objRPT

objfrmRPTViewer.CRPTViewer.ParameterFieldInfo.Clear()

objfrmRPTViewer.CRPTViewer.ParameterFieldInfo = objRPT.ParameterFields

objfrmRPTViewer.CRPTViewer.Visible = True

Sunday, December 13, 2009

VB.Net Draw String Center of Point location

Private Sub DrawStringCenterOfPoint(ByRef gr As Graphics, _
ByVal txt As String, ByVal txtfont As Font, _
ByVal txtcolor As Brush, ByVal location As PointF)

' Mark the center for debugging
Dim x as Single = location.X
Dim y as Single = location.Y
gr.DrawLine(New Pen(Color.Red, 2), x - 10, y, x + 10, y)

' Make a StringFormat object that centers
Dim sf As New StringFormat
sf.LineAlignment = StringAlignment.Center
sf.Alignment = StringAlignment.Center

' Draw the text.
Dim StringSize As New SizeF
StringSize = gr.MeasureString(txt, txtfont)

gr.DrawString(txt, txtfont, txtcolor, x, y, sf)
sf.Dispose()

End Sub

VB.Net Find Center of a Polygon

Private Function CenterOfPolygon(ByRef _pointf() As PointF) As PointF
CenterOfPolygon = New Point(0, 0)

Dim total_points As Integer = _pointf.Length
Dim x_total As Single = 0, y_total As Single = 0
For Each _point As PointF In _pointf
x_total = x_total + _point.X
y_total = y_total + _point.Y
Next

CenterOfPolygon.X = x_total / total_points
CenterOfPolygon.Y = y_total / total_points

End Function

Tuesday, June 30, 2009

Application Architecture Guide 2.0

The purpose of the Application Architecture Guide 2.0 is to improve your effectiveness when building applications on the Microsoft platform. The primary audience for this guide is solution architects and development leads.
The guide provides design-level guidance for the architecture and design of applications built on the Microsoft .NET platform. It focuses on the most common types of applications and on partitioning application functionality into layers, components, and services, and also walks through their key design characteristics.
The guidance is task-based and presented in parts that correspond to major architecture and design focus points. It is designed to be used as a reference resource, or it can be read from beginning to end. The guide is divided into the following four parts:

• Part I, “Fundamentals,” provides you with the fundamentals you will need in order to understand architecture design techniques and strategies.
• Part II, “Design,” provides overarching design guidelines and practices that can be applied to any application type or application layer, including guidelines on how to design a communications solution and plan for services.
• Part III, “Layers,” provides architecture and design approaches, as well as practices for each layer, including the presentation, business, service, and data access layers.
• Part IV, “Archetypes,” provides patterns and design frames for each application archetype; including service applications, Web applications, rich client applications, rich Internet applications (RIA), and mobile applications.


Application Types:Architecture Styles:Architecture Frame:
- Mobile
- RIA
- Rich Client
- Services
- Web Applications
- Client Server
- Component Based
- Layered Architecture
- Message Bus
- MVC Architecture
- N-Tier
- Object Oriented
- SOA
- Caching
- Communication
- Concurrency and Transactions
- Configuration Management
- Coupling and Cohesion
- Data Access
- Exception Management
- Layering
- Logging and Instrumentation
- State Management
- Structure
- Validation
- Workflow


Reference:
http://www.codeplex.com/AppArchGuide