 |
|
 |
|
|
SpriteHand controls nominated for Awards |
|
Andy's Blog
|
By Andy Beaulieu on
7/28/2005 8:19 AM
|
|
|
Several of my SpriteHand controls have been nominated for Pocket PC Magazine "Best Software Awards 2005!"
ASprite.NET has been nominated for a 2005 Best Software Award in the ".NET Utility Libraries and Controls" category
AWaveCE has been nominated for a 2005 Best Software Award in the "Native Audio Libraries and Controls" category
ASpriteCE has been nominated for a 2005 Best Software Award in the "Native Graphic Libraries and Controls" category |
 |
|
 |
|
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 (9)
|
|
|
|
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)
|
|
|
|
|
|
|
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)
|
|
|
|
|
 |
|
 |
|
|