Tuesday, November 22, 2005

nothing like a little Vermont snow to welcome him with...



Don't Forget: www.acehaid.org
Tuesday, November 22, 2005 5:22:44 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

In VB6 with Crystal Reports 8, embedding an image dynamically into a Crystal Reports file was fairly simple. You could merely add a new object to the report on the fly, passing in the path of the image file then drop it into the appropriate section and x/y position on the report.

Dim oleobj As OLEObject
oRpt.Sections(8).AddPictureObject imgfileName, 1920, 1560

In VS.NET 2003 (I haven't looked at how to do this in 2005 yet), it is hardly as easy as this and I needed to do it to solve a serious file bloat problem. I had a 13kb image that I needed to embed as a watermark into the background of the file. You do this by creating a page header section that is the height of the paper and in the formatting options for the section, check "Underlay Following Sections". That way, the section will be a watermark under all of the rest of the sections of the report. However, because of the way Crystal does this underlay, my dlls that contain a report with a watermark were over 2MB when compiled. Without the image, they went back down to 200kb - 350kb depending on other variables.

Embedding the watermark image dynamically was going to help me get rid of this file bloat problem, but it was not as simple as the previous crystal API.

I had some help from tech support and modified the code to suit my needs and will share it here.

The trick is to stream the file into a datatable and then add the datatable as one of the datasource objects of the report. Then the field which represents the image, can be dragged and dropped onto the report surface.

What I did was create a class for extending Crystal call CrystalAddOns. In it I have a shared function that takes in the path of the image file and returns a datatable creating the binary for the image.

Here is the class.

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data
Imports System.IO
Public Class CrystalAddOns

'========================

Public Shared Function ImageTable(ByVal ImageFile As String) As DataTable
' Create a dataTable
  Dim data As New DataTable
' Declare a row object.
 
Dim row As DataRow
 
data.TableName = "Images"
' Add a Byte Array field to the dataset.
 
data.Columns.Add("img", System.Type.GetType("System.Byte[]"))
' Repeat for each image.if you have more than one...
'==================
' Read in the image file.(in VS2005 you can use ReadAllBytes and skip the streaming)
  Dim fs As New FileStream(ImageFile, FileMode.Open)
' Create a new binary reader object.
  Dim br As New BinaryReader(fs)
' Create a new row object.
  row = data.NewRow()
' Stream the image into the row.
  row(0) = br.ReadBytes(br.BaseStream.Length)
' Add the row to the dataset.
  data.Rows.Add(row)
 
br =
Nothing
  fs.Close
  fs = Nothing
'==================
' Run through this line of code the the first time you create the dataset
' To create the schema file. The schema file will be the datasource for the
' subreport that holds the image. Add this to the project and then add it to
' the report in design time. Then you can drag & drop the img field onto the
' report.

 'Dim ds As New DataSet
 'ds.Tables.Add(data)
 
'ds.WriteXmlSchema(System.IO.Directory.GetCurrentDirectory() & "\Image.xsd")

Return data

'don't forget your exceptions!!

End Function
End
Class

Now that you have this class, you can use it easily when instantiating your reports:

rpt.Database.Tables(1).SetDataSource(CrystalAddOns.ImageTable(myfilePath)

This assumes that the schema file was the 2nd datasource in your report.

My class also has additional goo to handle specific watermarks, such as a "draft" watermark. This way my call would ask for CrystalAddOns.DraftImageTable() and the CrystalAddOns class already has the path of the file.

Note that the full blown version of Crystal Reports that can be upgraded to from the one that comes with VS2003 (and the next version that you can upgrade to from VS2005) have a Dynamic Image Location feature (which I have never tried) that supposedly makes this much simpler. My guess is that the Dynamic Image Location does the same thing as my class.

Don't Forget: www.acehaid.org

Tuesday, November 22, 2005 4:41:06 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I think my head has been under the rock as far as vs2005 WinForms UI design stuff is concerened. I was fiddling wtih Winforms the other day and wanted to put a line on the form and realized I still can't do it the old VB6 way. I just dropped a panel on instead and put the "below the line" stuff inside the panel. I want the line there at design time, so the GDI+ way wasn't my cup of tea.



Don't Forget: www.acehaid.org
Tuesday, November 22, 2005 1:33:56 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Northwestern Vermonters, I received this today:

Our client, a growing national wholesale distributor, is currently seeking an IT Analyst. 
 
The IT Analyst is responsible for writing programs in Visual Basic, maintaining their Windows 2000 network, performing EDI functions and providing user support.   This individual must be flexible to cross over work in other IT areas from developing, administrative, EDI, or support. 
 
The ideal candidate will possess:
 
-3+ years of experience in Visual Basic, SQL and Windows administration
-knowledge of EDI
-great communication skills
 
A Bachelor's degree is preferred, however, additional experience in lieu of education is acceptable.
 

This is an excellent opportunity offering a base salary commensurate with experience and a comprehensive benefits package.  First round interviews will take place in our office on Wednesday,  November 30 starting at 10:00 AM.

 

If you are both interested and qualified in the above-mentioned opportunity, please contact either David A. Coryer or Melissa Moore at ETS, Inc; 518-562-4673 or toll-free 877-303-7737  We can also be reached via email at dcoryer@etsjobs.com or mmoore@etsjobs.com.  We look forward to hearing from you!

 

ETS, Inc., upstate New York’s premier supplier of temporary and direct-hire recruiting for the past twenty-four years, specializes in the placement of high quality individuals in upstate New York, New England and along the Eastern Seaboard.



Don't Forget: www.acehaid.org
Tuesday, November 22, 2005 12:18:34 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, November 21, 2005

How cool. I am now reliving one of my favorite sessions at PDC - Shy Cohen's Reliable Messaging session (COM307: Windows Communications Foundation (“Indigo”): Writing Reliable and Transacted Distributed Applications)

I am really looking forward to virtually attending the many sessions I was unable to get to!

 



Don't Forget: www.acehaid.org
Monday, November 21, 2005 2:52:47 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Sunday, November 20, 2005

Microsoft slaps the "TDD" stamp on their own development process and the agile community is going nuts.... read more

[A DevLife post]



Don't Forget: www.acehaid.org
Sunday, November 20, 2005 5:31:47 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Now that WSE 3.0 is released, the next step is WCF, so I'm happy to see that Mark Fussell has moved from Program Manager of the WSE team onto the WCF team and is working on WCF security.



Don't Forget: www.acehaid.org
WSE
Sunday, November 20, 2005 2:14:08 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

For those of you who have used WSE 2.0 or all of the pre-RTM bits of WSE 3.0, we are used to having a folder with the sample certificates inside of the WSE 3.0 program folder. Not finding this with the RTM bits, I did find out where the certs were in the MSDN forums. Mark Fussell says:

The sample certificates were removed from the product and replaced with a setup.bat file in the \Samples directory. This setup file uses MakeCert.exe to generate named certificates, installs them into the correct certificate stores and set the appropriate priviledges when run. This was done to ease the installation on the samples and enable you to get started with the samples sooner

If you want to install certificates by manually you can follow the instructions either in the readme.htm in the samples directory or at the end of the Hands on labs. You can use MakeCert.exe to generate the same certificates as used to be shipped in WSE 2.0.

Now that I know where to look, I see that this information is in the readme document in the samples folder.



Don't Forget: www.acehaid.org
WSE
Sunday, November 20, 2005 2:09:47 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, November 19, 2005

As I sit in my office this morning, I have been watching pickup trucks drive slooooowly up my road all morning looking for someplace to hunt. They get to the end of our road, realizing there is no open land up here and turn around. It's a public road, so I can't whine about them driving back and forth all day, but I wish I had a right to put a sign at the bottom of the road that says "no place up here to hunt - don't bother..."  It's the norm for hunting season, but a little aggravating.

There have already been 2 accidental deaths in Vermont (one right in my town). One was with two young guys out hunting. They had separated and one shot and killed the other, his friend. It's the most common type of hunting accident - pulling the trigger before you identify your target. The 2nd was a mother who shot her son in the foot while they were hunting. There is no excuse for these accidents. I know a lot of very responsible and respectful hunters. Early in the season, though, it is sadly not uncommon for some trigger happy idiots to just shoot at whatever is moving -  your friend, your son, whatever...

When I lived in Dutchess County (NY State) there was one season with two awful accidents. One was, again, two friends hunting together. One had a great plan for hunting!. He dressed like a deer so the deer wouldn't be afraid of him. He wore carhartt overalls (tan colored) and a white scarf. He was shot by his friend. Before he died, he made a statement to be try to ensure that his friend did not get charged with his death - something like "stupid me, I was dressed like a deer".

The other was much more criminal. Two men without legal status to be in the U.S. that had drive up from NYC were hunting on private property, without permission and with some kind of big guns that are totally illegal for hunting. So that's a pretty bad setup. To top it off, one of them accidentally shot and killed the land owner, who was also out hunting on his property.

When I moved out of NYC in 1999, I had to get used to hunting as it was common where I lived. I even ended up dating two men who hunted and really learned a lot about it and changed my attitude about hunting. I even learned to make a fantastic venison stew from The New Basics Cookbook (lucky me with a juniper bush by my house!). So don't misunderstand my rants - it is not against hunters or hunting, just against dangerous idiots.

One thing we love about hunting season is the Hunter's Breakfast from 5-10am Saturdays and Sundays for weeks and weeks at the local church. By 8am it's just our friends and neighbors all going (the hunters are already up in their tree stands) and very sociable and fun. But this year, it's too sad to go because one very beloved young man in our town, Luke Palmer, died in a car accident right in the middle of the village on Wednesday. He is always there at the breakfasts with his parents and also at Spaghetti suppers, etc. Luke is autistic, but very high functioning, very loving and challenges us to percieve our world a little differently. I have been getting to know him since we moved here and have always looked forward to learning more about his world from him. Here is his obit, which says a lot about him and how he affected so many people's lives.



Don't Forget: www.acehaid.org
Saturday, November 19, 2005 12:26:33 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I am copying this lovely obituary from the Burlington Free Press (11/18/05) so that it doesn't get lost forever. With love to Luke, Onnie & Andy.

11/18/2005 LUKE HUNTINGTON PALMER — Luke Huntington Palmer, of Huntington, died tragically and unexpectedly in a car accident on Nov. 16, 2005. Born to Onnie and Andy Palmer and brother Tony on April 23, 1987, Luke was a dynamic presence in the lives of his family and friends and will be terribly missed. Luke lived life with great enthusiasm - big plans, a big heart, a great sense of humor. Whether baking bread, snapping photographs, or emailing his many friends, Luke's approach to all he did took us places we never knew existed. A recent show of his photographs is only one expression of his keen eye. He cooked and baked wonderful food on his own from an age when most kids would not be allowed near the stove. He was most recently working on a hearthstone oven in Martha's Vineyard with plans for a bakery and “really long baguettes.“ Each of us who knew Luke knows something exciting and unexpected about what we foolishly thought was mundane or boring. No one will ever forget Mrs. Harris, darling. Luke is survived by his parents, Onnie and Andy Palmer, of Huntington, his brother Tony Palmer of Chilmark, Mass., his grandparents, Bill and Betty (Eddy) Lidgerwood of Chilmark, and Melissa Palmer of Slingerlands, N.Y.; his aunts and uncles, David Palmer of Albany, N.Y., Laurie Palmer and Debbie Gould of Chicago, Ill., Frank and Sarah Slingerland of Glenmont, N.Y., Erick McCandles of Altamont, N.Y., Trina McCandles of Groton, Conn., Lisa and Peter White of Tunbridge, Susie Eddy of Chilmark, Bill Eddy and Eileen Walsh of Waquoit, Mass., Carolyn Eddy and Vineyard Haven, Mass., Bruce Adrews of Burlington; his cousins, Dinah and Marcella Andrews, Liza Eddy and her husband, Tim Schaub, Beach White, Erika and Emily Slingerland, Patrick and Lizzie Walsh; Godparents Steve Fischer, Paul Southerland, and Corliss McClean Weston; and many, many special friends and animals from Brewster Pierce Memorial School, Camels Hump Middle School, Mount Mansfield Union High School, Burlington Technical Center, and Vermont and Martha's Vineyard, Mass. A memorial service for family will be held this week in Chilmark, Mass. A memorial service for Luke's friends and community will be held in Huntington at a later date. In lieu of flowers, contributions to the Huntington Library Building Fund (c/o Colleen Dychton, Library Trustee, 1275 East St., Huntington, Vt. 05462) may be made in Luke's memory. Local arrangements are in the care of Gifford Funeral Service, 22 Depot St., Richmond.

Saturday, November 19, 2005 12:24:45 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Man, I am so fallling behind on blogs  and miss lots of good news! This is over a month old! But congrats, Dave!!

Don't Forget: www.acehaid.org
Saturday, November 19, 2005 10:19:48 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Oh, as soon as I get past my current non-Indigo related commitments, I am very excited to grab this and keep going down the path. For those of you who have time now, here's the link!



Don't Forget: www.acehaid.org
Saturday, November 19, 2005 10:15:09 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Friday, November 18, 2005
I have had to grok and also explain Service Broker as part of my work and presentations on Query Notification. I kind of get it on the surface but do not get it deeper down and will probably never write t-sql to work with it anyway. I was very happy in talking with a SQL Server guru recently who also thought Service Broker was really hard to understand. If it's hard for a SQL Server whiz, then I'm not going to beat myself up about it anymore - until of course, I need it more directly than just through Query Notification (via ASP.Net or ADO.Net).

Don't Forget: www.acehaid.org
Friday, November 18, 2005 4:42:37 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Jon Hassel was the technical editor of Sahil's new book and is obviously very pleased to have participated on such a great book!

Don't Forget: www.acehaid.org
Friday, November 18, 2005 1:39:46 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Yeah - so I printed the eval forms just before I left my house and left them sitting in the printer! Attendees of last night's meeting can get the form from the Vermont.NET home page (top of page). Please email them back to me after you fill them out. Filling out the forms is what assures that I get reimbursed for last night's pizza and soda!!

Don't Forget: www.acehaid.org
Friday, November 18, 2005 10:14:03 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Mike Gunderloy has advice for developers just looking at VS2005 for the first time.



Don't Forget: www.acehaid.org
Friday, November 18, 2005 9:43:37 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

In February ('05) we had Rob Howard scheduled to speak at VTdotNET as an INETA speaker, and we were very excited. Even with a snowstorm, there were a lot of people planning to come. Unfortunately, the snowstorm prevented Rob from getting to Vermont .... he got stuck in Chicago at the airport waiting for his flight to take him to Vermont. The plane was delayed so many hours that we finally decided to cancel the meeting and Rob got on a plane back home to Texas. The Vermont bound plane did not arrive in Burlington until after 8:00 pm.

But he still wanted to come (and we still wanted him to!), so we scheduled Rob again and that meeting was last night - and it was worth the wait!

Rob did a presentation on ASP.NET 2.0 Tips & Tricks. He had a list of 10 cool things you can do with ASP.NET 2.0, but also talked about others that he was using in the code samples, such as master pages and the fact that VS no longer boggles your HTML formatting. Talks like these are great. Sure I can find the info elsewhere, but I am busy and focusing on many things at once, so having this stuff spoon fed to me is almost a necessity. One thing that makes a session great is not just showing how, but also explaining why, which Rob did regarding each of his 10.

Of the list, the one item that is the most intriguing to me is the cross page postback. I have had to do an enormous amount of trickery to move inkdata around in a web application as the ink data is client side data and I want to do things with it on the server side and have to do things like expose it in a hidden field, grab it in the server side code of another page from the page.request object then stuff it into a session and have my way with it. Pre-RTM,  I was having problems with ink on the web in VS2005, but will now be able to explore the possibility of simplifying moving the data around with the cross page postback. I still have the problem of the ink data being on the client side, not the server side, but with some additional tools at my disposal, I may be able to come up with a better solution.

Rob's talk was great. As he said, he was only able to skip a stone across the surface of the goodies in ASP.NET 2.0, but it's a fantastic start for people to be able to take advantage of the new release. The power of getting this information out in front of people is expressed well by Dave Burke, who said in a blog post this morning "because of Rob's presentation the fear of potential problems in migrating my primary development machine from Beta 2.0 to the RTM has been lessened by the anticipation of using VS2005 exclusively."



Don't Forget: www.acehaid.org
Friday, November 18, 2005 9:40:32 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Friday, November 18, 2005 9:13:37 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Thursday, November 17, 2005

Here's a market for someone to figure out how to capture. While I was in South Africa, I was talking with Microsoft S.A.'s Lillian Serobatse about buying clothes on the internet, trying them on at home and shipping the rejects back. This works well when you live in the boonies and retailers like Patagonia have their big annual sales online! Lillian was surprised. "You bought clothes on the internet?" I was surprised (at her question). "Don't you?" I asked.

Lillian explained to me that e-commerce has not really taken off in South Africa. One of the reasons, she tells me, is that like many South Africans, she LOVES to shop. The shopping trip itself is a good part of the fun - as it is for many here in the U.S. I personally hate shopping. I only go when I have to find something very specific. I don't like wandering around from store to store just looking at stuff and maybe buying something I didn't really need.

I imagine that purchasing stuff from outside of S.A. is cost prohibitive - think of the shipping! So it would be South African retailers that would benefit from this more than anyone. Perhaps a retailer in Jo'burg that does not want to open a storefront in Capetown or Durban (or visa-versa).



Don't Forget: www.acehaid.org
Thursday, November 17, 2005 2:40:16 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |