HarborObjects

C# 4.0 concepts

by RezaMadani 28. July 2011 20:45

Attached please find the slide deck for my C# 4.0 new concepts and features presentation.

CSharpConcepts.pdf (140.59 kb)

Tags:

TFS

Windows Phone 7 Unleashed Event Code & Slide Decks

by RezaMadani 4. June 2011 23:50

Attached please find the slide decks for all three sessions along with the accompanying completed code.

 HOL_Finished_Code.zip (1.69 mb)

 WP7Unleashed_Session1.pdf (2.66 mb)

 WP7Unleashed_Session2.pdf (1.17 mb)

 WP7Unleashed_Session3.pdf (2.09 mb)

Tags: ,

Windows Phone 7

Windows Phone 7 Unleashed Event Hand Outs

by RezaMadani 3. June 2011 23:23

For those of you attending my WP7 all day event, the required course material is attached here.

assets, images and Word docs:

 WP7_Hands_On_Lab_Documents.zip (4.13 mb)

PDF version of docs:

 WP7_Hands_On_Lab_Documents_pdf.zip (2.19 mb)

Demo sample code presented:

 WP7_Sample_Code.zip (3.85 mb)

Tags: ,

Windows Phone 7

WPF animation techniques and SQL Server 2008 features

by RezaMadani 5. May 2011 04:34

I have two presentations coming at Cal State Fullerton Code Camp on January 25th.
One is an overview of animation techniques in WPF and Silverlight. This is one of my better presentations. It provides a good overview of animation capabilities of WPF. Find out more details here.
The other is an overview of the new cool capabilities of SQL server 2008 one can benefit from immediately. This is intended for developers and DBAs. Find out more details here.

Tags: , ,

Reporting Services Tips

by RezaMadani 5. April 2011 04:02

We recently converted 100’s of Crystal Reports to SQL Server Reporting Services.  I have noticed a few issues that Crystal developers frequently either run into or try to do incorrectly.  Even if you are developing SSRS reports a few key principals must be kept in mind.  Here they are:

  • One inch is 1140 pixels in Crystal and 72 Points in SSRS
  • Interactive Size and Print size are two different settings.  A setting of InterActiveSize=0 renders the entire report in one long page.  I strongly suggest having your interactive width match your print version.  Having wider margins in interactive mode will print blank pages and guaranteed to make your users upset!
  • You can change the default rendering format, which is html to Excel or PDF by simply adding a URL parameter to the end of your request (e.g. &rs:Format=PDF)
  • Make sure to define global data sources and have all reports use the same data source reference.  Doing so, will make the DBA’s job a lot simpler when moving reports from environment to environment.  He can do this without any developer involvement and through SSRS backend administration.
  • Try to use stored procedures to retrieve your data at all times.  Make sure to use unique column names when returning data.  SSRS will bark at you with a strange error message if you don’t do so.
  • It is always best to create a core report template you frequently use and save it in
    Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject. 
    For future use.  Typical things saved in a template are print page size (e.g. 8.5 x 11), preferred margins, header and footer items such as logos, page numbers and copyright notice.  Next time when you start a new Report, you can select this report as your start up.
  • Exporting to Excel 2003 and prior versions has a limit of 65K rows.  Attempting to do so will generate a runtime error.  It is best to have a check-enable option to paginate the report based on a conditional group, which in turn exports each 65K chunk in individual Excel sheets.  Make sure this is an optional grouping as adding groups increases your processing time that is really not necessary when viewing a report.  A typical conditional grouping at the highest level could use a formula such as =Int((RowNumber(Nothing) - 1) / 65000).
  • Clicking in a row selector of a Tablix does NOT display its properties!  It simply shows the common properties of all the cells embedded on the row!  To change the properties of a static row in a Tablix you should turn on the Advance Mode from the bottom right menu and click on the static row in the lower left pane.
  • Never ever use global level Code in SSRS to calculate totals.  The code and it associated values are reset every time a new page is rendered.  Don’t bother tagging you variables or code as shared.  This will cause you even more headaches.  Use standard Tablix summary and total rows for any aggregation processing.
  • The default rendering parameters for PDF and Excel rendering extensions can be changed in the RSReportServer.config file.  A typical usage is not to have report headers and footers exported to Excel.  Note that this setting doesn’t have any impact in Visual Studio environment.  It can only be tested on the SSRS server. The config file is located at
    \Program Files\Microsoft SQL Server\<instance name, e.g. MSRS10_50.MSSQLSERVER>\Reporting Services\ReportServer

Tags: ,

SQL Server | SSRS | SQL Server Reporting Services

SSRS Tips and Tricks Presentation

by RezaMadani 10. December 2010 04:35

Here is the slide deck and code samples for my SSRS Tips & Tricks presentation.  To run the demos you need the following environment:
- Visual Studio 2008 (VS2010 still doesn’t support BI Templates ? ) or BIDS 08 if you just have SQL server installed
- SQL Server 2008 (Preferably with R2 update)
- AdventureWorks 08 OLTP database (again R2 version if possible), which you can get from CodePlex (http://msftdbprodsamples.codeplex.com).
Once ready, add the following stored procedure to your database.  It simply gets a dataset containing products and their associated categories and subcategories. 
Enjoy.  Don’t hesitate to drop me an email if you have any questions or comments.

SsrsStoredProc.zip (912.00 bytes)

SsrsTipsCode.zip (374.26 kb)

SsrsTipsSlideDeck.zip (111.66 kb)

Tags: , ,

SQL Server | SSRS | SQL Server Reporting Services

Windows Phone 7 Hands On Lab

by RezaMadani 17. September 2010 04:19

The first official Mobile Phone 7 Hands-On-Lab in Southern California was held at QuickStart Office in Irvine, CA this past Saturday September 11th.  I was lucky enough to be one of the presenters along with Mark Rosenberg.  Chad Boyer was one of the proctors helping out quite a bit with people’s questions.  I have to admit I expected a positive response but not to this extend.  We literally ran out of seats and there was physically no room to sit about an hour into the presentations.

If you are interested in learning about WP7, this 12-hour day is for you.  The labs and lectures are skillfully created and narrated by Daniel Egan from Microsoft.  They cover all the key features of the phone.  At the end of the day you get to take the fully completed version of the lab with you home.

There were two questions asked frequently during the labs that I’d like to shed some light on:

-          Missing ApplicationBar icons

When you pick an icon to display on your application bar, you will notice that an ugly X is displayed instead when you run the application in the emulator. This is due to the fact that the ‘Build Action’ of Images added to the application is set to ‘Resource’.  To view this setting simply right mouse click on one of the images in Images\Icons fodler and select Properties.  Switch this setting to ‘Content’ and make sure ‘Copy to Output Directory’ is set to ‘Copy Always’.  This is due to the fact that your image files are added to the xap package as separate files and not resources.  To prove this to yourself, navigate to the bin\Debug directory of the application, change the extension of the xap file to zip and double click it.  You will see that the images are included as separate files in the target compressed xap file.  To refer to this kind of file, your ‘Build Action’ must be set to ‘Content’.

 

-          Global definition of an ApplicationBar

You can move the definition for an applicationBar to your app.xml where application wide resources are defined:

xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

 

   <shell:ApplicationBar x:Key="GlobalAppMenuBar"

                              IsVisible="True" IsMenuEnabled="True"

                              BackgroundColor="#FF0000" Opacity="1.0" >

         <shell:ApplicationBarIconButton

  <shell:ApplicationBarIconButton

 

        </shell:ApplicationBar>

 

App.xml entries are simply name/value pairs in a hash table.  You refer to them from any xml page of your application using their Key.  From now on whenever you add a new Windows Phone 7 Page (either Portrait or Landscape), you should notice that all pages are of type phone:PhoneApplicationPage. These pages have a property called ApplicationBar similar to FontSize or DesignHeight properties.  Simply set it to your global definition using the following syntax:

ApplicationBar="{StaticResource GlobalAppMenuBar}"

 

As a result whenever you update your global definition of the ApplicationBar all pages get updated automatically.

Btw, the last three hours of the day are allotted for implementing something on your own and present it at the end.  Your application will be judged with the first place winner taking a $500 gift card, the second place winner a $200 card and the third place winner a $100 one.  The first place winner on September 11th blew my mind.  He had an almost fully functional XNA shooting game to blow up spaceships – very impressive.

Let me summarize WP7 programming for you.  If you know Silverlight or XNA programming, you are 95% there.  The rest is simply getting to know the specific phone features such as GPS, Accelerometer and their associated APIs.  I anticipate hundreds of applications readily available as soon as the phone is released. 

The next two HOL sessions are on September 25th (QuickStart, San Diego) and September 26th (QuickStart, Irvine). Enjoy.

Tags:

Silverlight | Windows Phone 7

Silverlight Tips & Tricks

by RezaMadani 10. August 2010 04:41

Here is the slide deck and code samples for my presentation at the LA .NET user Group.
1- To Load the demos, you need the following:
  - Visual Studio 2010
  - Silverlight 4 tool kit (from msdn)
  - AdventureWorks 2008 database, preferably 2008 R2 (from Codeplex) - the data warehouse is not necessary for these demos
2- Once you open the project in VS2010, Create the Stored Procedure called getProductsByCatSubcat in your AdventureWorks database (attached)
3- Change the AdventureWorks2008R2ConnectionString password, db name etc. in web.config
4- To bring up each sample, change the startup page in Application_Startup method of app.xaml.cs file.
5- I have hardcoded the web server port number as 54931 in WCFBasicConsumer.xaml.cs.  Make sure to change it to whatever yours is.  Technically this should be passed in from a config file in a real production environment.

Have fun and as always let me know if you have any questions.

 getProductsByCatSubcat.sql (1.20 kb)

Silverlight Tips & Tricks- LA UG.pdf (124.60 kb)

SilverlightTipsTricks.zip (121.49 kb)

Tags:

Silverlight

Silverlight 3.0 MSDN Broadcast

by RezaMadani 15. May 2009 04:26

For those of you who attended my MSND broadcast on Silverlight 3.0 ‘simple but effective animation techniques’ on Channel9, I have just uploaded the code for both version 2.0 and 3.0 of Silverlight.  The 3.0 version has one additional demo focusing on the new cool effects you can apply to UI elements.  The demo specifically shows the shadow effect.  This feature has been available in WPF and it is now available in Silvelight.  The rest of the demos are identical.

SilverlightEffectiveAnimation20.zip (40.95 kb)

SilverlightEffectiveAnimation30.zip (45.63 kb)

Tags:

Silverlight

WPF and Silverlight Styles and Templates

by RezaMadani 24. April 2009 04:21

I have posted the slide deck and code samples for my most recent presentation on WPF and Silverlight resources, styles and templates.  I have received many positive comments on this presentation, which btw was very nice Wink  It covers just about all key concepts you need to know about the fundemantals of styling your UI and/or crreating your own custom templates in the WPF world.

WpfStylesAndTemplates-042409.zip (136.49 kb)

Tags:

Windows Presentation Foundation | WPF