Sunday, May 22, 2005

These questions were received as a private comment in response to my Automatically Printing Crystal Reports in ASP.NET article:

Very useful and interesting article. Thanks a lot. I wanted to use this in a .Net app. Can we determine the number of copies to be printed dynamically using the second method(javascript)? Say If the user clicks on the print button (HTML submit button), the application would pre-determine how many copies can be printed for that user and automatically print them?
Also, the second window was opening in full size for me instead of 0 height and width. Please let me know what I'm doing wrong here?
Again...this is a wonderful article.

To the best of my knowledge, I don't think you can set the number of copies to print through JavaScript.  When printing from a browser, all print settings are handled through the browser's print dialog, and I don't know of any way to script that without getting into ActiveX and trust permissions.

It's tough to tell what's going on in the second question because there are a couple of code snippets that open new windows.  My best guess would be that the script string isn't being renered correctly.  View the source of the parent page, and look for the rendered script string.  Make sure it's correct after it's rendered.

Sunday, May 22, 2005 7:39:41 AM (Eastern Standard Time, UTC-05:00)

Tim Heuer has an interesting post today:

inspired by scott hanselmen's post about What Great .NET Developers Ought to Know, as well as the rush of interviews i've been conducting lately to fill sharepoint positions, i started compiling a list of questions for what a sharepoint consultant ought to know...here it is...

It's a challenging list of questions, check it out: http://timheuer.com/blog/archive/2005/02/24/1691.aspx

(hat tip: many other bloggers)

Sunday, May 22, 2005 7:10:43 AM (Eastern Standard Time, UTC-05:00)

"A Crystal Reports job failed because a free license could not be obtained in the time allocated. More licenses can be purchased direct from Crystal Decisions or through the Crystal Decisions Online Store."

This error can be due to a number of factors.  If you have deployed your application on a server and get this message, it means you possibly entered the wrong keycode when you registered Crystal Reports .NET 2003.  You can follow these instructions from Business Objects to reset the keycode: http://support.businessobjects.com/library/kbase/articles/c2012716.asp.  You will have to register your CR .NET again when you open a report in Visual Studio.

Something else to check is that all the versions of the referenced components are correct.  In my recent case, I was preparing for a demonstration on my laptop.  I had installed CR 10 before installing Visual Studio 2003.  When I created my demo project in Visual Studio, all of the referenced Crystal Decisions components were 9.1.5000.0 except for CrystalDecisions.CrystalReports.Engine.  That component was version 10.0.3300.0.  By deleting this incorrect reference, and adding the correct version, the error was resolved.

Sunday, May 22, 2005 7:09:07 AM (Eastern Standard Time, UTC-05:00)

I see this question quite often in the Crystal Reports forum at ASP.NET.  My advice is always to download the web samples at:

Visual Basic .NET Web Samples

C# .NET Web Sample Applications

Then, follow the Readme file to install the “Discrete Parameters” example.  This has been my guide, and it works great.

Additional help and tutorials are in the CR SDK:

Crystal Reports .NET SDK – Additional Conceptual Documentation and Tutorials

This file contains additional conceptual information and tutorials for using Crystal Reports in Visual Studio .NET (including a developer reference). This documentation applies to Crystal Reports 9 & 10 and Crystal Reports for Visual Studio .NET 2002 & 2003. Sample applications built using these tutorials are available for download (cr_net_sdk_tutorial_samples_en.zip).

Crystal Reports .NET SDK – Sample Applications from Tutorials

This file contains C# and VB .NET Windows and web sample applications. These samples were built using the tutorials provided in the ‘Crystal Reports .NET SDK – Additional Documentation and Tutorials’ (cr_net_sdk_additional_en.zip). These sample applications applies to: Crystal Reports 9 & 10 and Crystal Reports for Visual Studio .NET 2002 & 2003.  

A number of methods out there use the CrystalReportViewer control to set parameters.  That's great unless you need to export your report to PDF (or XLS or RTF).  This is a code snippet I use, which sets parameter values directly on the Report Document object:

  rptCount = New ReportDocument
  rptCount.Load(Server.MapPath("reportname.rpt"))

  ''Get the collection of parameters from the report
  crParameterFieldDefinitions = rptCount.DataDefinition.ParameterFields
  ''Access the specified parameter from the collection
  crParameter1 = crParameterFieldDefinitions.Item("Param1")
  crParameter2 = crParameterFieldDefinitions.Item(“Param2")

  ''Get the current values from the parameter field.  At this point
  ''there are zero values set.
  crParameter1Values = crParameter1.CurrentValues
  crParameter2Values = crParameter2.CurrentValues

  ''Set the current values for the parameter field
  crDiscrete1Value = New ParameterDiscreteValue
  crDiscrete1Value.Value = Request.Form(“param1value“)

  crDiscrete2Value = New ParameterDiscreteValue
  crDiscrete2Value.Value = Request.Form(“param2value“)

  ''Add the first current value for the parameter field
  crParameter1Values.Add(crDiscrete1Value)
  crParameter2Values.Add(crDiscrete2Value)

  ''All current parameter values must be applied for the parameter field.
  crParameter1.ApplyCurrentValues(crParameter1Values)
  crParameter2.ApplyCurrentValues(crParameter2Values)

Once you get used to working with parameters, you can “automagically” display them on your web pages.  This series of articles shows you how to get a list of parameters from your report file, and display them on your web form, where you can prompt for inputs:

Automagically displaying a Crystal Reports Parameters - Part I
Automagically displaying a Crystal Reports Parameters - Part II
Automagically displaying a Crystal Reports Parameters - Part III

If you're new to Crystal Reports .NET, get this book:

Crystal Reports .NET Programming

It is both an introduction to Crystal Reports .NET, as well as a object model programming guide/reference.  Examples are in both VB.NET and C#.

Sunday, May 22, 2005 7:05:21 AM (Eastern Standard Time, UTC-05:00)

They do exist!  For some reason, the Issue Tracker Starter Kit download page was reverted to an older version.  Alex Lowe was kind enough to post the links in the Issue Tracker Starter Kit forum:

http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=832749

Sunday, May 22, 2005 7:03:54 AM (Eastern Standard Time, UTC-05:00)
 Saturday, May 21, 2005

I needed something better than the Notes that came with my Pocket Outlook 2003, so I tried several journal applications.  This was my favorite!  I use both the desktop and pocket versions.  Great for keeping track of what you do for what client, phone conversations, and notes for the next ASP Alliance article!  This is not a plug-in for Pocket Outlook, but it can integrate with the Task and e-mail functions.

Some of the best features include having multiple journal files, with multiple journals in each file, password protection, easy navigation and time stamping.  I use this on a Dell Axim X5 running Windows Mobile 2003.

Journal Pro w/ Desktop Bundle! by DSRTech, Inc.

Journal Pro is the definitive application for journal/diary keeping on the Pocket PC platform! And now it's even better than ever...

With the addition of Journal Pro Desktop Edition you're always ready to record your thoughts whether at home, the office, or on the road. And you'll rest easy knowing that your files will always be in sync!

Version 2.6 contains version 2.5 of the desktop application and version 2.6 of the pocket pc application.

Features Include:

  • Seamless Integration with Journal Pro Desktop Edition!
  • Voice Recording
  • File Encryption
  • Skinning of the pocket pc application
  • Lightening Fast Journal Access!
  • Password Protection
  • Categories Within Your Journal
  • Full Text Searching
  • Calendar Navigation and "Quick Nav"
  • Skip Over Days With No Entry
  • Pocket Outlook Task and Email Integration
  • Font and Color Selection
  • Text Export
  • Auto-exit after inactivity timeout
  • Purge Data When No Longer Needed
  • Completely File Based
  • Compatible with the new Pocket PC 2002 Operating System
Saturday, May 21, 2005 9:32:47 PM (Eastern Standard Time, UTC-05:00)

My mother, patroness of the arts, would be so proud!

Great collections of Great Impressionist Artist Claude Monet's works, the artistic themes for your today screen included the famous painting series:-
·Water Lily 1914
·London Parliament in Dusk 1904
·The Parc Monceau 1878
·Lilacs Overcast Weather 1872

Monet1 by Mediasofts By Paul

And another one (part of a 4-part series)

Claude Monet Today Themes Pack 3 by Natural Installer Inc.

Saturday, May 21, 2005 9:30:46 PM (Eastern Standard Time, UTC-05:00)
 Friday, May 20, 2005

I have a love/hate relationship with those CAPTCHA tests on websites.  I understand why, and am fascinated at just how good the human mind is at pattern resolution.  Yet, they're additional typing.  Anything to foil a spambot I guess.

I was looking into adding a test into a project of my own, and I came across these references.  Examples of the first article are shown beneath it.

15 Seconds : Fighting Spambots with .NET and AI

This article explains how intelligent applications from Carnegie Mellon University and Berkeley researchers counter auto registration spam programs and how to build your own using ASP.NET & XML Web services.

 

A Generic CAPTCHA Image Tester

What's unique here is my implementation - it's generic enough to use in a classic ASP page, or in an ASP.NET page, it does NOT require the use of Session State, and that's what makes it more useful. The key here is that we use an aspx page to generate the image, and we simply make our image tag's src property point to this page.

The Code Project - CAPTCHA Image - ASP.NET

This article demonstrates how to create such an image and employ it within an ASP.NET web form.

The CAPTCHA Project Website - CMU School of Computer Science

CAPTCHA.NET is the homepage of CMU's CAPTCHA Project

Formshield is a free .NET CAPTCHA control available at http://dotnetfreak.co.uk/blog/archive/2004/11/06/166.aspx.

Many thanks to Kevin Gearing!  There are some samples as well--very cool.

FormShield started out as a simple project with just one aim - to prevent automated form submission using dynamically generated images.

Not exactly a new idea - dynamically generated images requiring the user to enter the text found on the image have been around for quite a while (see http://www.captcha.net/), preventing automated sign-ups to free e-mail services such as HotMail and Yahoo, and automated whois lookups on domain names on sites such as Network Solutions.

Whilst some code exists on Code Project (http://www.codeproject.com/aspnet/CaptchaImage.asp), there didn't however seem to be a free, easy-to-use and customisable control for ASP.NET with full designer integration that could generate the relevant images. So, looking for an excuse to delve into GDI+, FormShield was born and my idea of a 'simple' control was dropped...

Friday, May 20, 2005 8:35:51 PM (Eastern Standard Time, UTC-05:00)

This has been dragging on for a couple of years, and I'm glad to see the USPTO has come to its senses somewhat.  I'm no lawyer, but I would think having your patent overturned due to “obviousness” would sort of put a damper on all those IP lawsuits you've been filing:

Patent Office issues initial rejection of patent claims in PanIP suit

Following a reexamination, the U.S. Patent and Trademark Office has issued an initial rejection of claims in a patent it had earlier granted to technology developer Pangea Intellectual Property on payment processing technology used at e-commerce sites. It is one of two patents held by PanIP whose validity is being challenged by a group of 15 e-retailers PanIP had in a separate action sued, claiming it was due licensing fees. PanIP has since settled with those retailers. A second patent on which the retailer group, the PanIP Group Defense Fund, also is challenging PanIP still is under review by the Patent Office.

PanIP has two months to respond to the Patent Office’s Action document, says Jonathan Hangartner of Sheppard Mullin Richter & Hampton LLP, the retailer group’s attorney, who terms the preliminary findings “a critical first step.” However, overcoming the initial findings will be “very difficult for PanIP. The Office Action is very well reasoned and strong,” he says.

Hangartner notes that nine of the 10 individual claims in the patent were rejected on the basis of “anticipation” in “prior art.” That essentially means that the Patent Office examiner determined that every element that the patent holder claimed to originate actually predated the patent and could be found in a single reference, such as an article, according to Hangartner. The remaining claim in the patent was rejected on the basis of “obviousness,” meaning that most elements of the claim existed in prior art and that the remaining elements would have been obvious to someone skilled in the art.

“The Patent Office has rejected the 10 claims that we challenged. That means that if that rejection holds throughout the process, the result will be the patent itself is invalid,” Hangartner says. The attorney representing PanIP, Kathleen Walker, said that while the action is ongoing, PanIP would have no comment. “We have 60 days to respond and we’ll make the appropriate responses,” she said.

The group of e-retailers formed a defense fund at http://www.youmaybenext.com.

Update 2005-08-19: YouMayBeNect.com has not been active for a while, apparently, and the retail group has disbanded after their victory.  No peep from PanIP yet. 

Friday, May 20, 2005 8:29:24 PM (Eastern Standard Time, UTC-05:00)

As good as ASP.NET's adaptive rendering is, I sometimes find myself needing to do some fairly substantial client-side scripting.  I used to sniff browsers, but that was getting tedious, and most common scripts are written upside down anyway.

The best method I've seen is to use 'object sniffing'--testing browsers for support of different objects and methods.  This saves a considerable amount of time, since all browsers will fall into 3-4 categories of object support, and you don't have to parse out a zillion different browser types and subtypes and still run the risk of excluding one that may work on your site.

My guide was http://developer.apple.com/internet/webcontent/objectdetection.html.  The article is a couple of years old, but it's still useful to me today.

The pace of new browser releases may be slower than it was in the early days, but developers must still confront a bemusing array of browser versions and brands that support some JavaScript features but not others. To combat the problem, scripters commonly provide two or more code branches so that a browser follows an execution path containing statements that it supports. Browser sniffing — the task of inspecting navigator object properties for version information — has become largely unmanageable given the browser version permutations available today. This article presents details on an alternative solution — object detection — that frees JavaScript developers from most of this versioning mess.

I haven't played around with custom server controls, so I don't know how applicable this is for that purpose.

Friday, May 20, 2005 8:25:57 PM (Eastern Standard Time, UTC-05:00)

This article came up on the news today: Allowing Only Numbers in ASP.NET Textboxes.  In this article, Bipin uses a custom validator to enforce input.  I usually like Bipin's ideas, but this one seems to be a little more difficult than it needs to be.

I think there's a better way to do this--use a regular expression validator.  To test this, create a page, and add a textbox, regular expression validator, and a button.  For the validation expression, enter the following:

^[0-9]+$

Compile your page and test with some diffrerent inputs.

A quick explanation of the expression:
^ indicates the start of the input
[0-9] indicates a range of allowable characters.  You could do [0,1,2,3,4,5,6,7,8,9], but that's not lazy.
+ indicates 'match preceeding one or more times'
$ indicates the end of input

If you wanted to enforce a length of input, you could do something like:

^[0-9]{6,12}$

which would enforce a minimum of 6 characters and a max of 12.

I think regular expressions are too often overlooked, but they're very powerful and simple once you work with them a little bit.  For a good basic overview of regular expressions, check out

The Web Professional's Handbook

 

 

And a more in-depth RegEx reference in:

Pure JavaScript: 2nd Ed. (an absolute steal if you buy it used)

 

 

Regular Expressions with .NET [DOWNLOAD: PDF]

Downloadable e-bok in PDF format, from Amazon.

 

 

 

Mastering Regular Expressions, Second Edition (The Owl Book)

 

<edit>

Thinking about Joseph's comments below, one could extend Bipin's idea and use a regular expression instead of parsing the string and checking to see if each character is numberic or a period.  You could also add in a check to see if the field was blank, and save on the second validator.

</edit>

Friday, May 20, 2005 8:21:23 PM (Eastern Standard Time, UTC-05:00)
 Thursday, May 19, 2005

Using XP Pro on two different computers (Dell Dimension and Sony Vaio).  After installing a series of MS patches, my system hangs when I right-click on a file or shortcut.  I ripped all the patches off both computers, and right-click worked again (uninstalled them--forgot to set system restore point).  Put the patches back on the Dell, right click hangs the system.  Taking them off one at a time will be time consuming, but I'm about to start.

Anyone had similar problem that figured out which patch caused this, or how to fix the problem?  Taking them off one at a time will be time consuming, but I'll do it if I have to.  I used Windows Update on both systems.

Microsoft Workaround Fixes Problem!

After much Googling, I found two articles covering the issue (Windows XP right click gobbles up CPU time and Microsoft confirms XP right click memory hog problem) and the Microsoft KB Article Temporary Decline in Performance Occurs When You Right-Click a File or Folder in Windows Explorer.  Running a couple tests confirmed I was experiencing the same problem.  And, after following the workaround in the KB article, I can right-click again.

Thursday, May 19, 2005 9:23:11 PM (Eastern Standard Time, UTC-05:00)

Well, bummer.  I checked with Sierra Wireless today about installing Windows Mobile 5 on my Voq A11 SmartPhone, and here's their sad response:

The Windows Mobile 2003 Second edition is built in the phone, and it is not possible to upgrade the phone to Windows Mobile 5.0.

That's a real bummer.  This is one thing I dislike about devices with embedded OSs.  My Axim can't be upgraded to Mobile 2003, and now my SmartPhone can't be upgraded to Mobile 5.  But, the cost of the hardware is so high that it's impractical for me to buy a new device every couple of years.

Thursday, May 19, 2005 9:11:09 PM (Eastern Standard Time, UTC-05:00)

When my neighbors saw me mowing my lawn and listening to my iPod, I usually get asked which version is the best.  I have a feeling iPods are going to be popular Mother's Day and graduation gifts this year.  Anyhow, I ask a few questions about how the device is going to be used and make a recommendation based on that.  This is for my neighbors so I can get the yard done before dark.

(note: updated version at http://www.rjdudley.com/blog/Which+IPod+Is+Best+2005+Edition.aspx).

iPod Shuffle
This is the smallest iPod--roughly the size of a pack of gum--and comes in 512K (approx. 120 songs) and 1GB (approx. 240 songs) versions.  It's miniscule size and small capacity make this version practical only for working out or short commutes, IMHO.  Although 240 songs is enough for a full workday, and either model could store an audiobook or two, you won't have much variety from day to day, and the lack of a display makes choosing a specific song next to impossible.  Rearranging the songs on your device every day or so to provide workday variety kind of defeats the purpose of having a large capacity player, and I think the love of the device will be greatly reduced having to do so.  For a spinning class or even tae-bo session, this is the perfect model.  This model is flash-memory based, so there are no moving parts to damage during a high impact workout.

 

iPod Mini
For an average music collection, this is the iPod to get.  It's 2 in wide by 3.5 in tall, so it's very compact, and holds 4GB, or roughly 1000 songs.  1000 sings is far in excess of the playlist of any commercial radio station these days.  Because it's so small, this player can easily be used for a low impact workout, and it's larger capacity makes it practical for all-day use at the office and longer commutes.  This model has a display, so you can quickly navigate to the specific song, artist or playlist you want.  A number of audiobooks can fit on here for plane trips or long commutes, and still have room for a day's worth of music.  This player is hard drive based, so it's not a good idea to wear for high-impact workouts, since you could damage the drive platters.

20 GB iPod
If you have a large music collection, or love audiobooks, this is the model to get.  This version holds approx. 5000 songs, so there's plenty of room for large CD collections and audio books.  It's about the size of a deck of cards, so it could still be used while on a treadmill or a spinning class, but just a little large and heavy for other workouts.  Currently, the 20GB is the only original iPod offered--for larger capacities, you'll need to get an iPod Photo.  Although this is tagged as an “original“ iPod, it's actually a fourth generation (4G) iPod, which is the latest version.  There are plenty of other capacities in older versions available which will work just as well as the current version, but I definately don't recommend a used one.

 

60 GB iPod Photo
The 60 GB version holds approx. 15,000 songs or 25,000 photos (or some combination) and is also available in a 30 GB model (approx. 7500 songs or 25,000 photos, or some combination), although there are still some other capacities of slightly older models available.  The major difference is larger capacity and a color screen on which you can display photos.  Yawn.  If you have an absolutely gigantic audio collection, this is your model for capacity reasons only.  However, if you take a lof of digital photos, you can connect this iPod directly to your camera, and download photos right onto the device.  Very handy if you need a lot of storage when away from your computer.  The tiny screen is very sharp, but you're still looking at photos on something the size of a matchbook.  You can hook it up to a TV and show your vacation photos to your friends, but that's so last century--real men photoblog.  There is a rumor of a video-compatible iPod with Tivo-like capabilities.  If you want to watch stuff on your iPod, wait for that version.  There is a very good chance that the 60 GB model has a larger hard drive than your computer, so you'll be unable to store your complete music or photo collection on your computer, which is where you need to put it in order to get the stuff onto your iPod.  Even the 30 GB model probably exceeds the free space on your hard drive.  Unless you absolutely need the photo capabilities or larger capacity, I think th 20 GB original (above) is your better option.

No matter what version you buy, I definately recommend a protective case of some sort.  You're about to drop at least a couple hundred bucks, and you don't want butterfingers to destroy that purchase.

Thursday, May 19, 2005 9:06:37 PM (Eastern Standard Time, UTC-05:00)