Tip: Get report parameters as text from Crystal Reports in C#

I am starting a new set of posts presenting small code snippets in C# you could use when working with Crystal Reports in Visual Studio. And the first one is “GetReportParamsAsText“. Very simple but very handy function which allows to include report parameters values in your ASP.Net page without actually displaying the report. This version works only with Discrete Value parameters.  /// Function returns list of paramaters descriptions with /// associated values for specified report public string GetReportParamsAsText(ReportDocument reportDocument) {     if (reportDocument == null) return "Report not specified";     string result = "";     string description;     string valueText;     ParameterDiscreteValue value;     foreach (ParameterFieldDefinition prm                   in reportDocument.DataDefinition.ParameterFields)     {         try    Read more

How to deploy Crystal Reports 2008 project – part 2

Introduction

From part 1 of this article, you got list of steps in order to deploy Crystal Reports 2008 project created in Visual Studio 2008.

Next step is to choose deployment strategy, prepare installation script and then install it on IIS server.
There is enough written about deployment process from within Visual Studio so let’s give some people credit for their work – for example, please check this article – I am going to use it as a base.

All things considered there is still a variation to that process specific to Crystal Reports.

Note: Make sure you have latest runtime available for you – visit SAP download page – as of 10/19/2009 runtime version available is 12.2 .

(more…)

Populate TreeView from table in ASP.Net

I was asked today to help with code which would populate the TreeView control from database table in ASP.Net page. Since it is not a first time around and appear to be very common situation with dynamic pages, I thought it may be useful to write about it once and then just refer to this post later. We have a table with the following structure: ID ParentID Name We also have a stored procedure usp_GetGroupList which would return data from table above. And on our ASP page we have a TreeView control called myTreeView Few things we are trying to achieve: Small code Minimum of database access Well, code would not be too complex after all: private void PopulateTree() { Read more

Menalto’s Gallery 2.3 has been released

If you ever visited my photo gallery, you  may noticed that it runs on Menalto’s Gallery 2 engine. With recent release of 2.3 version, I have updated my installation as well. Few bug fixes may not worth mentioning, but noticeable change is in slide show plug-in. Starting this version slide show uses Cooliris’s PicLens. You can see a sample here. Why would I want to mention it? Aside from being nice piece of software, CoolIris was a place where Danny Thorpe was working for some time. “Was” because Danny is back at Microsoft (see some notes in his blog above).

TIP: HTML “File Download” dialog customization

NOTE: This only applies to Internet Explorer 6 with XP SP2 and later. Once in a while you would like to become a tyrant when it comes to what your site’s visitors can do with the content, file links in particular. OK, not a tyrant per se, but you want to limit operations for some file types. Can user open a file from IE after download? Can user save a file from IE after download? “Why would I want to do that?” – you may ask. There is a small example for you: Opening of CSV file in Excel and saving it after would actually adjust file structure since Excel treats some of the values differently which otherwise present in Read more

How to deploy Crystal Reports 2008 project – part 1

Crystal Reports Deployment strategy This is a first part of the discussion about what it takes to deploy Crystal Reports 2008 based project created in Visual Studio. Dependencies When you develop something which involves Crystal Reports you need to deploy CR 2008 run-time along with your project. As you know by now, Visual Studio 2008 comes with Crystal Reports 2008 Basic included, which is really a CR v. 10. But if you have Crystal Reports 2008 installed on-top of it, you need to worry about CR v.12. IMPORTANT. Do not confuse two! When you deploy your Visual Studio 2008 project you need to use appropriate MSI – either one included with VS or an updated CR 2008 run-time provided by Read more

Mobile devices support

After adding support for iPod/iPhone, I have decided to go a little bit further and add automatic support for mobile phones. Initial test passed using the following validator. Windows Mobile may be still in question. I’ll test it tonight. From the code it should not break added earlier support for iPhone, but if it does, please let me know.