Author Archives: Yuriy

Are you a real dope audiophil?

Amazon.com sells this amazing 1.5 meters (59 inches) cable for $500. People who used it claim to have seen GOD. Here is one and not the most incredible story from a satisfied customer:

This cable literally saved my life. Someone broke into my house and they threatened me with a gun. When I said that I could prove that using better copper for a digital connection makes the audio sent over it sound better they didn’t beleive me.  I made a deal with them to spare my life if it was true.

Read more here and prepare to be astounded!

Dynamic number of fields in a query for SSRS 2005

I’ve encountered a problem using SQL Server Reporting Services 2005 (I am using SSRS from an ASP.NET application). Underlying stored procedure can return different number of fields depending on one of the parameter. I.e. if that parameter is NULL the fields returned are

A B C

if that parameter is “1”, the fields returned are:

A B C D_1

if that parameter is “1,2”, the fields returned are:

A B C D_1 D_2

etc. And I need to be able to use those fields with the report (in particular – I need to group on them).  But report’s dataset has a fixed number of fields based on original query and new dynamic fields are inaccessable.

The solution is to modify report definition. I am already doing it to insert custom groups in the report, and reports dataset is exposed via definition as well.  The definition can be downloaded via GetReportDefinition of SSRS Webservice and serialized into a class  (See Tutorial: Updating Reports Using Classes Generated from the RDL Schema for more details). The DataSet in that definition contains array of fields that can easily be resized in code to accomodite for new fields. This way the fields in the definition will match fields returned by the query and can be accessed within the report.

removeChild, SSL and Infragistics WebHtmlEditor

I was working with Infragistics WebHtmlEditor control, and on client side it was being moved around by appendChild, removeChild DOM methods. All worked fine until I tried it over SSL connection. Immediatly removeChild method cause Secure/Unsecure waring.  Digging a bit I found that it was an IE bug. According to Microsoft this problem occurs if the Web page script calls the removeChild method to delete a DIV element that references a background image, and they suggest either to set outerHTML of the DIV to an emtpy string (which I think is dumb if you still need to use element you removed), but their second solution to move background-image declaration into an external CSS class actually works. In reality this problem occurs not only with DIVs but with any HTML element with background image in its inline style. In my case WebHtmlEditor rendered itself as an HTML table and its cells had background-image specified. The control itself didn’t have corresponding images set, but its UseDefaultStyles property was set to BackrgoundImages – which resulted in rendered styles with background images. To apply modified Microsoft’s solution I set this property to None, then segregated background image into a separate class:

.HTML_EDITOR {
   background-image: URL(ig_common/images/htmleditor/backimagerow.gif)
}

and used that class in Toolbar and TabStrip CSSClass properties. Worked like a charm.

SQL SELECT: Large Row Size (“cannot sort a row of size …”)

Had a weird error today in my MS SQL Query that had worked for months.

Cannot sort a row of size 8304, which is greater than the allowable maximum of 8094

The only difference – a few text fields the query returned had larger amount of data than usual. What saved my day is ROBUST PLAN hint, when I added OPTION(ROBUST PLAN)  to my ORDER BY clause – the query ran perfectly.  So if you ever experience similar problem (usually it happens when you join several tables with large sets of data)  try this approach.

For detailed explanation of ROBUST PLAN and other hints visit Microsoft Tech Net

DHTML JavaScript Graphics – draw without flash

This JavaScript VectorGraphics library provides graphics capabilities for JavaScript: functions to draw circles, ellipses (ovals), oblique lines, polylines and polygons (for instance triangles, rectangles) dynamically into a webpage. Usage of this Vector Graphics library should be easy even if you don’t have JavaScript experience
This is very cool. This javascript graphics libary allows you to draw pretty much any shape, image or text directly into HTML without 3rd party plug-ins like Flash. Speed is amazing and it’s cross-browser compatable too. Get it at  http://www.walterzorn.de