Assert is your friend… not an end-user’s

As a long time Delphi and C# programmer one become used to some features of the language and may not go deep into “philosophical” thinking about such features. This often happen with Asserts… What is Assert or Assertion? By its definition Assert: state categorically affirm: to declare or affirm solemnly and formally as true insist: assert to be true In Computing (wiki): “an assert is a predicate (i.e., a true–false statement) placed in a program to indicate that the developer thinks that the predicate is always true at that place” In general, using assert in the code proven to be useful in many situations because it “checks for a condition and outputs the call stack if the condition is false” Read more

SQL Server 2008: moving forward

SQL Server 2008 has been available since Aug 6, 2008. This does not include CTP (Feb 2008) time-frame. We are close to the year milestone now. To my surprise there are still questions around if moving to a new version is necessary. This is especially difficult question to discuss/suggest when SQL Server 2005 adoption cycle is just about being complete. We all know about “have to wait until first SP is out” rule. What is good about it to justify spending another chunk of IT budget? To answer first question, there is a cumulative update 1 available since Nov, 2008. One could count it as SP1. To answer second question could be more difficult. There is Product Overview White Paper available along with Data sheet where main Read more

Visual Studio 2008 and IIS 7

Deploying ASP.Net applications is always fun when it comes to packages which are more complex then usual and require additional actions taken and this one is not an exception. I think this topic run into the ground, but it seems to come back again and again. I guess the reason for that is “default” state set for the environment… After upgrade of operating system to Vista IIS 7 would be installed. This brings some “inconveniences” into usual development process. Aside from worrying about disabling UAC, few other things usually breaks. One of them is that setup package for ASP.Net application created in Visual Studio starts to fail with the error that installer session closed improperly and process has to be Read more

Crystal Reports 2008 : hacking datetime parameter format – reloaded

Few weeks ago I have wrote on how to hack Crystal Reports 2008 ASP.Net Viewer control to suppress time part in the parameter calendar control. With release of Service Pack 1 for Crystal Reports 2008, suggested solution no longer works since structure of the files has been changed. So I went digging around again. Forgot to mention last time, but in situations like this, scripting debugging supported in Visual Studio really helps (if you are not familiar with JS debugging check following links [1] [2] for more info. Note. It is interesting to observe how code is changing over time. And after some analisys, I would say that SAP development team is one click away from adding ability to suppress time Read more

Crystal Reports 2008, ASP.Net and impersonation

We have created our perfect reporting solution using Crystal Reports 2008 viewer control, tested everything, and  deployed it into production environment… and it is working… until Friday night… 🙁 Information below is provided for both IIS 6 and IIS 7 along with 32 and 64 bit Windows environment. Make sure that proper reference is used. For some strange reasons, things usually happen when nobody anticipate it anymore (usually about a week after an initial deployment). In addition, Project creep situation may occurs: after usual management meeting, requirements are changed and some security measures are to be introduced. Easy! <IMPERSONATE> option of ASP.Net… and this is where it become interesting. There is slight small issue, locally developer is usually an administrator of the Read more

Crystal Reports 2008 : hacking datetime parameter format

One would think that this should be a no-brainer : ability to specify an edit format for date/time parameter in Crystal Reports. Not so fast…

Problem is as following:

ASP.Net Web client with Crystal Reports Viewer control is used.

When our report is based of some stored procedure which uses datetime parameter, it will inherit it as is and when report parameter entry form is displayed we would be asked to enter both date and time portion.

While, in general, it is OK, some reports are really interested only in date part being entered and time should be always set to 00:00:00. So we are forced to type time every time because if it is not provided calendar control would try to set time part initially to current time.

After some research off the Internet, visiting SAP forums, it is appear to be engine limitation. But we would want to overcome it somehow.

DISCLAIMER: solution below could only be used as a last resort and only if your business logic requires using date only params. And while it is only applies to calendar control, it is not per se a generic solution. This is a first “rough” attempt of achieving desired result and may lack some features otherwise expected.

It has been reported that solution above only works for current month. Since we are now using Crystal Reports 2008 with SP1, I would address this issue in my new post below.

IMPORTANT! With release of Service Pack 1 for Crystal Reports 2008, method blow is no longer applicable since structure of the files has changed. Please refer to this new post for more information.

Otherwise, Where there is a will, there is a way…

Fortunately we have access to internals behind the parameter handlers in Crystal Report Viewer web control.

Navigate to one of following locations:

  • C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers12\
  • C:\windows\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\crystalreportviewers12\
  • C:\Program Files\Business Objects\Common\4.0\crystalreportviewers12\

and locate the file called allInOne.js – this is our victim. This file contains all JS code behind for CRV control which would be used by your web-site.

IMPORTANT: always create a backup copy before making any modifications.

(more…)