SpriteHand
Module Border
  Most recent blog entries
Module Border
.NET Developer Group in Syracuse
Andy's Blog By Andy Beaulieu on 6/5/2005 4:22 PM
I am helping to pull together a .NET Developer Group for the Syracuse area. If you are a .NET Developer in Central New York, please check it out.
Comments (1)

While we're waiting for VS.NET 2005 Profiling....
Andy's Blog By Andy Beaulieu on 4/18/2005 10:11 AM

I had been using nprof (http://nprof.sourceforge.net) to do some profiling of a WindowsForms app, but it was hitting some really odd timings on a part of the code that relied on an ActiveX EXE (don't ask).

So while searching for another profiler to get a 2nd opinion from, I found this nice “Community Edition...“ It requires registration, but integrates nicely into the IDE...

http://www.compuware.com/products/devpartner/profiler/default.asp?cid=3019X36&focus=DevPartner&source=Web+%2D+Evaluation+Request&desc=Download+%2D+%27DevPartner+Profiler+Community+Edition%27&offering=DevPartner&sf=1&p=0

Comments (0)

Retrofitting a Website with DotNetNuke
Andy's Blog By Andy Beaulieu on 4/16/2005 7:20 PM

I've used Brinkster for hosting several websites on the cheap... and recently I wanted to take one of those sites and add DotNetNuke (DNN) on top of it, without converting any of the pages to DotNetNuke skins and tab pages.

What I did was rename the current site's Default.aspx to Default_MySite.aspx so that DNN's Default.aspx could take it's place. Then, I added a bit of code in DNN's Default.aspx to take care of rerouting any requests to “MySite”...

If Request.Url.AbsoluteUri.ToLower.IndexOf("mysite") <> -1 Then
     
Response.Redirect("default_mysite.aspx")
End If

After a quick check to be sure that none of DNN's project files had the same name as the existing site, I copied the remaining DotNetNuke files on top of the existing site, built, and released. I also needed to make a request to Brinkster Support to add privileges for the ASPNET Machine account to my webroot and all subdirs (as this is required by DotNetNuke). This retrofit allowed me to quickly add DNN to an existing Brinkster hosted account and still preserve the existing site.

Comments (0)

Dynamic Images in Crystal Reports .NET
Andy's Blog By Andy Beaulieu on 1/27/2005 8:10 PM

You would think this is a simple task: let's say you have a Crystal Report and you want to dynamically change an image in the report by loading an image from disk. Well, as it turns out, this functionality is not available in CR for .NET!

But here is a work-around; Crystal for .NET does support displaying images from a DB. And it does support accepting a disconnected ADO DataSet as a data source. So you can trick Crystal into thinking it loaded an image from disk and presto, you have dynamic images from disk. Here's the process:

(1) Create an XSD file (you'll use this as your report data source in step 2) with a binary column definition like so:

<xs:element name="AnImage" type="xs:base64Binary" minOccurs="0" />

(2) Create your Crystal Report and use an ADO.NET (XML) DataSource as your Crystal Report Data Source.

(3) Fill your DataSet, and then set the binary “image” column to an image file from disk using a MemoryStream like so:

Dim oLogo As System.Drawing.Image
Dim msX As New MemoryStream
Dim dsReportSource As New DataSet
' TODO: Fill your DataSet, dsReportSource, with your Report Data

' Load your image from disk
oLogo = oLogo.FromFile("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue hills.jpg")
' Save the image data to a Memory Stream
oLogo.Save(msX, System.Drawing.Imaging.ImageFormat.Bmp)
' Set the binary "image" column in your DataSet to the image data (note dsReportSource is a typed DS here)
dsReportSource.TestImage(0).AnImage = msX.GetBuffer

(4) Load your Crystal Report and assign the Data Source as usual:

Dim oRpt As New ReportDocument
oRpt.Load("CrystalReport1.rpt")
oRpt.SetDataSource(DsTestImage1)
CrystalReportViewer1.ReportSource = oRpt

Comments (6)

Streaming Crystal Output to a Browser
Andy's Blog By Andy Beaulieu on 12/14/2004 7:19 PM

This is a handy function that accepts an Export Format (i.e. PDF, Word or Excel) and streams a Crystal Report output back to the browser client.

   Private Sub ExportReport(ByVal iFormatType As ExportFormatType)
        Dim sTargetPath As String, sTargetExt As String, sContentType As String
        Dim fs As FileStream
        Dim FileSize As Long
        Dim GenDS As DataSet
        Dim oRD As New ReportDocument()
        Dim crReportObject As ReportObject
        Dim oExO As ExportOptions
        Dim oExDo As New DiskFileDestinationOptions()

        'Build Target Filename
        Select Case iFormatType
            Case ExportFormatType.Excel
                sTargetExt = ".xls"
                sContentType = "application/vnd.ms-excel"
            Case ExportFormatType.PortableDocFormat
                sTargetExt = ".pdf"
                sContentType = "application/pdf"
            Case ExportFormatType.WordForWindows
                sTargetExt = ".doc"
                sContentType = "application/msword"

        End Select

        sTargetPath = Server.MapPath("") & "\Export\" & Session.SessionID & sTargetExt

        oRD = GetReportDocument()
        'Export to PDF
        oExDo.DiskFileName = sTargetPath
        oExO = oRD.ExportOptions
        oExO.ExportDestinationType = ExportDestinationType.DiskFile
        oExO.ExportFormatType = iFormatType
        oExO.DestinationOptions = oExDo
        oRD.Export()
        oRD.Close()

        'Send the file to the user that made the request
        Response.Clear()
        Response.Buffer = True
        Response.AddHeader("Content-Type", sContentType)
        Response.AddHeader("Content-Disposition", "file;filename=" & Left(ViewState("ReportName"), Len(ViewState("ReportName")) - 4) & sTargetExt)
        fs = New FileStream(sTargetPath, FileMode.Open)
        FileSize = fs.Length
        Dim bBuffer(CInt(FileSize)) As Byte
        fs.Read(bBuffer, 0, CInt(FileSize))
        fs.Close()

        Response.BinaryWrite(bBuffer)
        Response.Flush()
        Response.Close()

    End Sub

 

Comments (3)

New Profiler in Whidbey
Andy's Blog By Andy Beaulieu on 12/7/2004 12:41 PM

I've used the .NET CLR Profiling Services to find bottlenecks in code, such as suggested by this article (which includes an implementation of a CLR Profiler):

http://msdn.microsoft.com/msdnmag/issues/01/11/NetProf/

But the nice thing is, Whidbey has a built-in profiler available, with nice graphs and reports built in - check out this article to learn more

http://msdn.microsoft.com/msdnmag/issues/04/12/EnterprisePerformance/default.aspx

Comments (0)

Woohoo
Andy's Blog By Andy Beaulieu on 10/27/2004 7:31 PM

One of my Pocket PC components - AWaveCE - got an award.

http://www.pocketpcmag.com/awards/category_2004.asp?catid=46

I created AWaveCE awhile ago as a simple wrapper for a GPL mikmod port. It's always been free and the source is available on my SpriteHand website - http://www.spritehand.com

 

ASpriteCE was a finalist in the competition - that's a component for creating Pocket PC games, and is actually much more complex than AWaveCE ;-)

Comments (0)

AWaveCE gets award, ASpriteCE finalist
Andy's Blog By Andy Beaulieu on 10/27/2004 1:12 PM
AWaveCE has won a Pocket PC Magazine Best Software Award, and ASpriteCE was a finalist.

The AWaveCE Audio Control makes it easy to add music and buffered sound to your Pocket PC apps. It is an ActiveX Control wrapper for Mikmod, an LGPL library.

The ASpriteCE Game Control is an ActiveX control which allows creation of PocketPC games using eVB and other development tools.
awaveceAward.gif
Comments (0)

Retrieving DB2 Index Info
Andy's Blog By Andy Beaulieu on 10/20/2004 9:09 AM

The Visual Studio.NET add-in for DB2, which is part of the “Stinger“ release, offers a much better implementation of the Server Explorer for DB2 users. But I recently found myself needing Index information from a DB2 database without any good schema exploration tool...

SELECT SYSCOLUMNS.TBNAME, SYSCOLUMNS.TBCREATOR, SYSKEYS.IXNAME, SYSKEYS.COLNAME, SYSKEYS.COLSEQ, SYSCOLUMNS.NAME, SYSCOLUMNS.TBNAME, SYSCOLUMNS.TBCREATOR, SYSCOLUMNS.COLNO, SYSCOLUMNS.COLTYPE, SYSCOLUMNS.LENGTH,SYSCOLUMNS.SCALE, SYSCOLUMNS.NULLS
 FROM SYSIBM.SYSKEYS SYSKEYS ,SYSIBM.SYSCOLUMNS SYSCOLUMNS INNER JOIN SYSIBM.SYSINDEXES SYSINDEXES ON SYSINDEXES.NAME = SYSKEYS.IXNAME
 WHERE SYSKEYS.IXCREATOR = SYSCOLUMNS.TBCREATOR
  AND SYSKEYS.COLNAME = SYSCOLUMNS.NAME
  AND SYSKEYS.COLNO = SYSCOLUMNS.COLNO
  AND SYSKEYS.IXCREATOR = '<CREATOR>'
  AND SYSINDEXES.TBNAME ='<TABLENAME>'
  AND SYSCOLUMNS.TBNAME = SYSINDEXES.TBNAME
  AND SYSINDEXES.CREATOR = '<CREATOR>'
ORDER BY TBNAME,IXNAME,COLSEQ

Comments (0)

Remoting DataSets
Andy's Blog By Andy Beaulieu on 10/15/2004 1:44 PM

I think this is an inside joke with the folks who coded DataSet Serialization and Remoting at Microsoft ;-)

Q: Why did the DataSet cross the Remoting Channel in Binary Format?

A: To get serialized as XML!

(crowd laughs)... When you serialize a DataSet, say through remoting, the DataSet gets serialized as XML. So if you're trying to eek out some performance by using Binary Formatting under Remoting, and you pass a DataSet, (here's the punchline), it gets passed as bloated XML.

Luckily, there are a couple of work-arounds presented in these articles ---

http://support.microsoft.com/?id=829740

http://msdn.microsoft.com/msdnmag/issues/02/12/cuttingedge/

Comments (0)

Module Border Module Border
Module Border
  Blog_List
Module Border
Module Border Module Border
Module Border
  Subscribe
Module Border

RSS

Module Border Module Border
Module Border
  Diversions
Module Border

DESTROY ALL INVADERS
A scrolling shooter game where the objective is to destroy the invading UFO's flying over a neighborhood of your choosing. Imagery provided by Microsoft Virtual Earth. Created using Silverlight 2.
PLAY IT

INFO AND CODE



SORT THE FOOBARS
A game where you need to sort the good foobars from the bad ones. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



POLYGON PHYSICS DEMO
A demo showing polygon physics where the user draws physics objects with the mouse. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



SILVERLIGHT ROCKS!
Destroy the asteroids before they destroy your ship! Created using Silverlight 2.
PLAY IT

INFO AND CODE



FISH GAME
A simple game of harpoon-the-fish. Written using the AJAX Sprite Toolkit.
PLAY IT

INFO AND CODE

Module Border Module Border
Module Border
  Search_Blog
Module Border
Module Border Module Border
Module Border
  Blog_Archive
Module Border
Module Border Module Border
Copyright (c) 2008 andy.beaulieu.com - Login