eWorld.UI - Matt Hawley

Ramblings of Matt

BlogJet 1.2 BETA Released

November 19, 2004 17:40 by matthaw

Ohh the day has come, hip hip horay! hip hip horay! The folks over at BlogJet have finally released version 1.2 BETA of the ever so popular blogging application, BlogJet. I’ve been waiting for this release for quite some time, and I’m currently using it to post this entry.

The formal, detailed release notes have yet to be launched, but version 1.2 includes the following:

 This version includes long-awaited image resizing, file attachments, extended entries, excerpts and keywords, a brand new code editor with syntax highlighting and better code completion, easier account switching, XML-based drafts, typographic characters and autoreplacement of smilies, full XHTML support.

Can you say, ohhh yeah! The other great thing is that it is a free upgrade to all current customers! So, head over to BlogJet now and get it while its Hot! Hot! Hot!



Categories:
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Unleash It Plugins Taking Off

November 18, 2004 16:20 by matthaw

So its been about a week since Unleash It 2.3 was released, and so far 2 plugins have surfaced. Talk about getting a good feeling when you see other people start creating things against your product with plugins.

The latest plugin that was released, developed by Josh Kewley, also comes with a thorough article on how he developed the plugin. He also gives his advice on how to debug your plugin (which I will be incorporating into the plugin information).

So, if you get a chance, hop on over to the plugins forums and read up on Josh's experiences. Both of which will help you out in the longrun if you need to create your own plugin for Unleash It!



Categories: .NET | Unleash It
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Custom Web App and Reporting Services Integration: Part 2, Reporting Services API

November 18, 2004 00:47 by matthaw

Preface:
The following is a series on integrating your custom web applications with SQL Server Reporting Services. It is intended to provide useful information for other developers posed with the same problem of integrating these two seamlessly.

For the situation and notes, please view Part 1 of this series.

Utilizing Reporting Services API:
In Part 1 of this series we discussed setting up authentication on your custom web application, reporting services, and the Windows server / Active Directory. Part 2 will be discussing how to utilize the Reporting Services API exposed by Web Services. This API is intended for use by developers for integration scenarios just like this, and it is very important to understand how to actually use it. The entire API is very extensive and exhaustive, and in reality, you will only use 5%. For more information on the API, visit the MSDN documentation.

As the documentation states, the Reporting Services API can be accessed via Web Services at the URL http://<SERVER>/ReportServer/ReportService.asmx. Using Visual Studio .NET (or if you prefer the command line WSDL EXE), you should create a proxy for use in your custom web application. If you're using Visual Studio .NET to create the proxy, you should see the listing of all the classes, methods, and properties that it exposes...which I've subtly named "everything under the sun except for the kitchen sink." Just glancing through the listing, you will want to note the most important class of them all "ReportingService." This class exposes everything that you would really want in just a basic application.

So, enough looking, and add that puppy so we can start working!

The most important item that must be done prior to using the Reporting Services API, is that you need to pass credentials with any call to the API. To do this, the class ReportingService inherits a property called Credentials. And, as you guessed it, is where you will add your credentials. So, exactly how do the credentials fit in, and how do I access them? Well, that was the whole idea behind Part 1 of this series, setting your application up properly so that this daunting task is super easy.

Remembering back to Part 1, we're using impersonation of the currently logged in user within the current thread context of the web application when it is running. What this means is that our web application is running as if it my user, thus enabling me to pass the credentials of the web application onto the API. By simply calling a single line of code, we've now setup our instance of the Reporting Services API to be executed as if I were going to it directly via URL:

// create an instance of the reporting service
ReportingService rs = new ReportingService();

// set the URL of our reporting server
rs.Url =
http://rptsrv/ReportServer/ReportingService.asmx

// set the credentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

So, now our credentials are being set - which means that we can now start calling methods to do certain functionality. In the application we built, it was necessary to retrieve the reports dynamically based on the users' role and supply these reports in a drop down list for the user to select and run. To accomplish this task, we needed to look at the method ListChildren which takes in a folder path and boolean value indicating if a recursive search should be performed. This method returns an array of CatalogItem classes that allow us to determine if the item returned was a report, and if it was, the path, name, and other important information. Here's an example of retrieving the reports for a given path:

// retrieve the catalog items for the demo reports folder
ReportingServices.CatalogItem[] items = rs.ListChildren("/Demo Reports", false);

// cycle through the items returned and add them to the drop down list if it is a report
foreach(CatalogItem item in items) {
    if(item.Type == ItemTypeEnum.Report) {
        ddlReports.Items.Add(new ListItem(item.Name, item.Path));
    }
}

So, now we have a listing of reports in the Demo Reports folder. Pretty simple right? You betcha. It's now time to take a selected report and view that report in a separate browser window (code which you can figure out!). So, in a button's OnClick method, we open a new window and supply a URL to the reporting server that will automatically display the report. Sounds simple enough right? Well, kinda - it takes some know-how on how to construct the URL properly.

The great thing is that you can pass just about everything in the URL by Query String parameters to control how the report will be rendered to the user. If you're familiar with viewing the reports currently, you'll remember that there are two toolbar items. One being the Toolbar that displays the paging and export interface, and the other being the toolbar containing all custom report properties that can be searched on. By passing just a few parameters in the querystring, you can control if those are displayed or not. Another very important query string parameter handles how the report will be rendered (HTML, PDF, CSV, etc.) when first accessed. So, what exactly are these parameters?

  • rs:Toolbar - The toolbar for the paging / export functionality. It is a boolean value indicating if it is visible or not. Supplying True, Default, or leaving it off will commonly display it.
  • rs:Parameters - The toolbar displaying the report parameters. It, like the above, is a boolean value indicating if it is visible or not. Supplying True, Default, or leaving it off will commonly display it. In general, we'll be passing the report parameters values by querystring from our application, so I suggest setting this parameter to False.
  • rs:Format - The format the report will originally be rendered as when first viewed. If left off, the report will be rendered as HTML. Other values include PDF, HTML4.0, etc. More information on the allowed values can be retrieved from the documentation.

A caveat I found out is that Gecko based browsers (yes, this includes Firefox, Mozilla, and Netscape) don't like to render the Toolbar / Parameter bar properly, basically rendering it useless. So, when developing your URL, I advise that you check to see if it is a Gecko based browser, and render it as PDF. Sure, you loose a lot of functionality of the report (drill downs, etc), but my guess is that these wouldn't have worked in the first place with the Gecko based browser.

Previously, I mentioned that commonly we'll be supplying our own user interface for parameter selection rather than relying on the rudimentary parameter selection interface from Reporting Services. To pass these values, you need only to add additional query string parameters. The name of the parameter being the name of which field it should map to in the report and obviously, the value being what you want to pass. So, that's enough talking about building the URL, I guess you're probably getting ants-y and wanting to see how to do it:

string url = "http://rptsrv/ReportServer/?" + ddlReports.SelectedValue;

if(Request.UserAgent.IndexOf("Gecko") >= 0)
   
// this is a gecko based browser, render the report as PDF
    url += "&rs:Command=Render&rs:Format=PDF&rc:Toolbar=False&rc:Parameters=False";
else
    // this is a browser that is supported for paging / exporting, render as HTML
    url += "&rs:Command=Render&rc:Parameters=False";

// add any custom parameters
url += "&year=2004";

// redirect to the report
Response.Redirect(url);

Okay, so assuming you're on a single server environment or using Active Directory as your authentication, you should (upon submitting the form to view the report) be seamlessly passed directly to the rendered report.

Other Rendering Capabilities:
There are other methods of rendering using the Reporting Services API, however these are outside of the scope of this article. If you would like more information on using these methods of rendering, I'd suggest reading this great article on 15 Seconds, as well as checking out the Render method of the API. In a nutshell, the afformentioned method will allow you to stream the report and save / display it in any manner you wish, which could be very beneficial in creating custom reporting solutions for windows applications.

Secondly, apart of the Reporting Services samples installed on your development machine (which oddly enough I didn't install), is a compiled assembly called "ReportViewer.dll" that is a ASP.NET Custom Control for rendering reports directly within a webpage. If you visit the previously mentioned 15 Seconds article (In part 2) they describe how you can utilize that control. After playing with it though, I realized that it generated an IFrame, which as most of you know is BAD BAD BAD! Thats why I went the alternate route and did the redirection.

So, this currently ends my 2 part series on integrating Custom Web Applications and Reporting Services. I hope you found both parts extremely beneficial, and hope that they provided you with as much information that I lacked when trying to figure this out. Lastly, I did want to give props to my good buddy Ryan Rinaldi who helped me figure some of the authentication issues!



Categories: .NET
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Custom Web App and Reporting Services Integration: Part 1, Authentication

November 17, 2004 23:27 by matthaw

Preface:
The following will be a series on integrating your custom web applications with SQL Server Reporting Services. It is intended to provide useful information for other developers posed with the same problem of integrating these two seamlessly.

Situation:
A new project came up at work, where we had to develop our own custom web application where users will be prompted to easily select reports, their parameters, and view them seamlessly all from one interface. This means, that we couldn't just direct the users to the interface provided by Microsoft and assume they'd know what to do. Also, due to requirements by the client, the reports should be available to only certain users with authentication resorting back to Windows / Active Directory.

Notes:
In part 1, I will discuss the method we took to integrate these two applications seamlessly by only being prompted once for windows credentials, or no prompt at all (using your signed on domain credentials). In our situation, the client is still running Novell, so Active Directory integration was out of question, so windows authentication will need to be handled by the reporting / web server.

An important item to note is when integrating the two items on different servers and not using active directory, seamless integration is not possible unless you manage to keep the users / groups in sync with each server (a challenge upon its own). Therefore, due to this requirement, the rest of the article will be based on single server or Active Directory authentication.

Authentication Methodology:
When developing your application, it is best to use windows groups to control authorization to the various reports and different sections of your web application. In our instance, we needed two different groups - Users and Admins. Users in the Admins group would have access in our application the ability to enter new information, while users in both groups had the ability to view all the reports.

Our first step was to create our groups and add the various users to the appropriate groups through the standard windows management console. Once our groups were setup, configuration of Reporting Services to allow the two groups access to view reports only was our next step (Note, this entry will not describe the methods for doing this as there are lots of resources to help you). Now that we're all ready to go, and the authorization to the reports have been tested properly using the Microsoft user interface in Reporting Services, its now onto configuring our custom web application to use windows authentication (again, we will not go into too much detail, but examples will be shown).

Okay, so open your Web.Config file for your custom web application, and add the following entries under your system.web node:

<authentication mode="Windows" />
<authorization>
    <allow roles="<SERVER_NAME or DOMAIN>\Users" />
    <allow roles="<SERVER_NAME or DOMAIN>\Admins" />
    <deny users="*" />
</authorization>
<identity impersonate="true" />

For any subdirectories that you wish to have different authorization on, follow the same template listed above, but leaving out the "authentication" and "identity" elements. In our instance, we needed a subdirectory called "Administration" that only users in the Admins group can gain access. So, after creating the sub directory, we created another Web.Config file in that subdirectory and added the following to the system.web node (Note that there are other methods of doing this type of configuration using a single Web.Config however for ease of example two Web.Configs are used):

<authorization>
    <allow roles="<SERVER_NAME or DOMAIN>\Admins" />
    <deny users="*" />
</authorization>

To briefly explain what we've done for authentication is told our web application to use the Windows mode of authentication. We then authorized only users in the Users and Admins roles access, and denied everyone else. Lastly, the application will impersonate the user that is currently logged in. This is a key concept since we'll be using credentials in part 2 and sending them with the Reporting Services API.

So, now our custom web application is setup - however there are still some settings within IIS that we need to set. The following settings were those that I found to work with our single server setup with no Active Directory verification, so you may need to fiddle with these if using Active Directory. To set the IIS permissions properly, open up IIS, find your Web Application, and view the properties. Click on the "Directory Security" tab, and hit the "Edit..." button for Authentication control. Once the new dialog has opened, uncheck "Anonymous access", ensure "Basic authentication" is checked, and "Integrated Windows authentication" is checked.

Launch your favorite flavor of an internet browser, go to your custom web application and see the magic work. You should immediately be prompted (unless using Active Directory & Digest mode, in which case if your currently logged onto the domain will pass directly through) for your username and password. After typing your credentials, you should be able to log in successfully to your web application. So, go ahead, take a deep breath and pat yourself on your back.

Part 2 will discuss using the Reporting Services API and your custom web application to provide that seamless look to your application.



Categories: .NET
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Microsoft is using MY Controls

November 15, 2004 18:56 by matthaw
I was working with one of our engineers getting our company information completed after we just passed an ISV competency test through Microsoft, and while I was filling out the page, I noticed there's a Calendar control on it. So I clicked it, and hey - it looks like mine. Examining the source of the page reveals that it IS mine. Woah, talk about cool...Microsoft is using MY calendar popup control and MY numeric textbox. That gave me a high for the day, and its only 10AM.

Find in Firefox

November 12, 2004 22:55 by matthaw

Everytime I need to find something in a wepage, I hit Ctrl-F. Most applications have a dialog that opens up and allows you to search for the word, phrase etc. However, Firefox took an old feature and made it awesome. See what I mean by opening up Firefox and clicking Ctrl-F ... don't see anything? Well, look towards the bottom of the browser. A new toolbar opens up allowing you type your search phrase. The really awesome part is that as soon as you start typing, it starts finding all instances and brings your browser to the first instance. Cool man cool.

BTW - clicking enter will "Find Next" and clicking Shift-Enter will "Find Previous".



Categories: General
Actions: E-mail | Permalink | Comments (9) | Comment RSSRSS comment feed

Framework Oddity

November 12, 2004 17:38 by matthaw
Can someone explain to me why the choice was taken to have SqlDbType under System.Data instead of System.Data.SqlClient like OleDbType is under System.Data.OleDb, or vice versa? Anyone ever notice this oddity?

Categories: .NET
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Updated Utility: Unleash It 2.3 - Now with Plugins!

November 8, 2004 19:11 by matthaw

Exactly 1 month from the last release, Unleash It 2.3 is now officially released with the gold stamp of approval. This release has some more major improvements in the application, however the biggest announcement for this release is the introduction of plugin support. Now, you have a way of writing managed code to do custom processes before, during, and after a deployment. With this release, I've also built and supplied the source code for 4 plugins:

  • File Exclusion Plugin - supply a file name to exclude during a deployment.
  • Visual Source Safe retrieval - retrieve VSS files prior to a deployment.
  • Vault retrieval - retrieve Vault 2.x files prior to a deployment
  • NAnt Execution - execute NAnt scripts prior to a deployment.

The installer also includes a PDF document outlining the plugin creation process, however feel free to start discussing anything in the forums. I've also created a new forum for posting your own plugins for others to download, discuss, and supply comments towards them.

So, here's the changelog for things that have changed:

  • Added: Ability to have N number of multiple deployment profiles.
  • Added: Tooltips for most controls on the main user interface.
  • Added: Ability to multi-select profiles to move in the multiple deployment.
  • Added: Ability to specify which build actions are to be included for VS.NET deployment. Configured in Tools->Options.
  • Added: Plugin functionality for deployments, with ability to disable plugins via Tools->Options.
  • Added: Ability to force the saving of selected file / folder masks via Tools->Options.
  • Added: Ability to globally remove file and folder masks.
  • Added: Ability to define command line parameters for pre/post commands.
  • Added: GUI now aware of the location when it was shut down and restores that.
  • Added: Splash Screen on startup.
  • Fixed: Invalid characters in VS.NET project files were throwing exceptions.
  • Fixed: Progress bar did not increment properly for UNC deployments.
  • Fixed: Logfile for UNC deployment showed the same path for both source and destination.
  • Fixed: Profile name was not being updated on form and on the combo box through quick editing of profile.
  • Fixed: File / Folder masks have to be clicked twice in the configuration to check them.
  • Changed: Updated VisualStyles component to 1.5.3
  • Changed: Files / Folders to be Deployed dialogs are now resizable.

To update your version of Unleash It (or just plain download it and try it out), go to http://www.eworldui.net/UnleashIt and grab your copy now. Enjoy all!



Categories: Unleash It
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Are You Sure?

November 5, 2004 00:44 by matthaw

So, here's the oddity of the day for me:

Now, I didn't go to C:\Windows and press delete, I noticed my recycle bin was full. So, Right Click -> "Empty". Boy its a good thing I don't want to delete that... "No".

Opening the Recycle Bin shows absolutely no files or directories. Could this be a message to switch to Linux? Gosh I hope not, I couldn't do any programming with VS.NET anymore.

Update: It seems to have fixed itself. Now I can successfully empty my recycle bin. Still a little leary about rebooting though.



Categories: General
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Managing Version Information in VS.NET

November 4, 2004 22:32 by matthaw

I was reading this weeks Code Project newsletter, when I came across an updated article named Versioning Controlled Build. The description so eloquently puts it: "A Visual Studio add-in that automates AssemblyVersion control."

One word, AWESOME! I downloaded the installer from the article, installed it, and launched VS.NET. Talk about an easy way of updating your version numbers for X number of projects. I know this is a daunting task for any developer that has more than 1 project that the version number needs to get updated.

Truly a great Add-In that will come handy for everyone!



Categories: .NET
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed


Copyright © 2000 - 2025 , Excentrics World