Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Saturday, 9 July 2016

SSRS - Custom Period Filters

Problem:

Just wondering if the reports published on SQL Server Reporting Services can be customized to have a predefined period filters like Last Week, Last Month, Last Quarter, etc.

By: Anonymous

Solution:

You have few options to work around this, which are given below:

1. Dynamic Parameter

Basically, your underlying query or stored procedure needs the values for the From and To paramteres to apply in the where clause of the query. You can do this by first creating a mutli valued Period parameter, with values like, Last Week, Last Month, etc specified as available values. The From and To parameters can then be set up in such a way that it fetches the default value from a query, which takes the value from the Period parameter and then return the corresponding From and To values respectively. In these, the Period Parameter shall be positioned above the From and To parameters. The query can be as simple as

SELECT 
CASE 
WHEN @Period = 'LW' THEN DATEADD(D,((DATEPART(dw, GETDATE())-1)*-1)-7,GETDATE())
WHEN @PEriod = 'LM' THEN DATEADD(M,-1,DATEADD(D,(DAY(GETDATE())-1)*-1, GETDATE()))
END AS FROM_DATE

for the default values of the From parameter. You may extend this idea and use it different ways to make a parameter dynamically derive a value based on a previous parameter. Note that the order of the parameter is important as the parameters are constructed sequentially and there is nothing like an onChange event that you can think of.

2. Let the SQL Query / Procedure do the work

The second alternative is to put in a logic similar to the above within the Report Query or Stored Procedure, so that the user just selects the period filter and the SQL Server interprets it appropriately and returns the appropriate results. The only difference with this option is that the From and To Filters need not be designed in the report and the user won't see it on screen.

3. Wrap the report within an Application

Just in case, you are rendering the reports within an Application, like a ASP.NET application or a Windows Forms Application, then you can have the complete control on the Filters in the presentation layer of your application. For instance in this case, you accept a Period Filter from the user in your front end application and then transform it to an appropriate From and To dates to the ReportViewer component and get the report rendered accordingly.





Friday, 26 June 2015

SSRS Report Builder 3.0 - How to avoid page breaks in Report Viewer

Problem:

The Report Viewer displays the tabular reports with pagination. This is inconvenient to users as they have to click on the page navigator to browse through the report. Is there a way to have the report viewer display all the rows in one view, so that users will find it convenient to browse through the report by just scrolloing up and down?

By: Muthu Saravanan

Solution:

Use the Interactive Size property of the report to overcome this. This property will not however show up in the Report Properties dialog. This will be available on the Properties Pane, which shows up ususally on the right side of the screen. If it is not showing up, check the options under the View menu. To have all records in single view without pagination, set the Height under Interactive Size to 0 cm.


This setting is effective for display in the report viewer only. Page breaks in print and other export formats will be based on the Page Size rather than the Interactive Size property.

Thursday, 16 January 2014

Essential Skills For an UI Architect

Question:

I have been working on designing and building web applications both for mobile and desktop and am getting exposed to related tools and languages as well. I want to further improve my skills and want to shape myself as an UI Architect in the longer term. I seek your advice and guidance on pursuing my career in that direction.

By: Rajkumar Krishnan

Answer:

Given that you have experience and exposure on UI design, it is natural to aspire for becoming an UI Architect. As you would know, the word Architect has larger significance and calls for certain abilities which go beyond the core UI design. If you take a closer look, UI implementation is one aspect and UI design is another aspect of it. As an UI developer, you would be implementing the designs created by someone else, who is good at visualizing the user experience. It is essential that the UI designer also have sound knowledge on various current and emerging tools and technologies, so as to come up with a design that is implementable. The UI Architect role is much wider which should have the broader skills on every other related aspects of the solution being designed. Here are some of the essential skills an UI Architect should be capable of:

Core Skills: The core skills that an UI Architect should be capable of include but not limited to the following:

  • Ability to comprehend and discover the goals of the target users, motivations, and the work and interaction patterns and come up with a design that is intuitive, responsive and usable.
  • Exposure and ability to comprehend the Product design skills are very essential as UI does not stand alone and it has to be a part of the product that is being built. The UI that the architect comes up with should go well with the product design principles and concepts.
  • Good understanding on the information architecture is also key for a good UI design. Afterall the UI is all about presenting information to the users using different colors, layouts, graphics etc. Without a good understanding of the information and the inter relationships of the underlying data, the UI architect is most likely to end up with a poor design.
  • Great deal of understanding on the behavioral aspects of the users would be key to come up with a usable UI.
  • Testing skills are equally essential without which the design that the UI Architect comes up may not be testable at all.
  • Ability to unlearn is another key skill that every architect should posses. If you are a developer and if you know certain specific tools or technology you will tend to come up with a design that suits the tools or technology that you know but there are quite many other tools and technology out there which can assist to implement even better designs. While it is important that the design is implementable, the Architect should also understand that there is nothing that is impossible and should have wide exposure on various other current and emerging technology out there.
  • Should have sound knowledge on the fundamentals of the multi-media, for instance, in-depth knowledge on the various image formats and attributes, the technical attributes of the screens of differing sizes as used in desktop PC, smartphones, etc.

Other Skills: The following are some of the other related skills that an UI Architect should have:

  • Should be open minded without bias and should be able to sketch the visual UIs on paper or on appropriate drawing tools.
  • Should have reasonable business skills which will help in enhancing the ability to understand the interactions between the product and the human users, the motivation and goals of the end users, etc.
  • Should have very good communication and language skills. Needless to say that the UI Architect should have the documentation and presentation skills as well.
  • Other soft skills that are relatively important for any role are active listening, interviewing, observation, collaboration and inter-personal team skills, etc.
  • Know the art of trade-off. i.e. in any design there will be conflicting attributes and the architect should be good at trading off one for the other. For example, if response time is a key attribute for you, you cannot afford to use fat image in your design. You should be able to balance and trade off certain attributes for the other.

You may work towards sharpening your skills in the above areas you can eventually look at becoming an UI / UX Architect in the longer term. Good luck with your career aspiration.

Saturday, 8 June 2013

Image Capture Component for Web Applications

Question:

I am working on a project, which requires acquiring images from scanners in a web browser. I am curious to know if HTML5 / CSS3 in any way help accomplishing this feature or if there are any javascript libraries out there so that the implementation can work across all browsers. Or else, you may suggest various other options available for me to meet this need.

By: Anonymous

Response:

The HTML5 and CSS3 specifications are all about presentation and thus will be able to detect output devices like print, tv, handheld devices, etc, but there isn't any support for input devices like image scanner or camera. Interacting with such devices can however be achieved using javascript and browser specific ActiveX, Browser Plugin or an Applet. There are many third party libraries with varying capabilities and support for a multitude of programming languages, which can be wrapped within an appropriate component and then use Javascript to interact with it.

I have personally used the EZTwain Library for the windows platform by building a Visual Basic based ActiveX component earlier on and later using VB.NET based library and used it within IE successfully. This library however has support for very many programming languages including C++ and Java. Its usage can be extended across various other browsers by wrapping it within an appropriate component. EZ Twain seems to be reasonably priced and comes with royalty free runtime distribution.

If you are a hardcore programmer, this Code Project Article is worth a look, where the author demonstrates building a C++ wrapper using the TWAIN_32.DLL which used to be distributed by Microsoft in earlier versions of Windows. In later versions of Windows (Windows XP SP1 and later), Microsoft has Windows Image Acquisition Automation Layer, which is worth exploring.

ByteScout Scan SDK is another free (FreeBSD License) library for .NET based applications which can also be explored for its extensibility into other environments. Dynamsoft has an image capture suite with pre-built and ready to consume components for various browsers, but carries a hefty price tag though.

The following are few other Tool kits that are worth exploring.

LeadTools Twain SDK
Acusoft's ImageGear for .NET
Victor Image Processing Library

Almost all of the solutions above are targeted at Windows platform. If you are expecting your solution to work on Non windows platform, you should look for similar libraries and build similar wrapper components for the target browser / platform combination.

Sunday, 14 April 2013

How to Integrate a POS device in a .NET Windows Forms Application

Question:

One of our recent project requires integrating our Windows Forms application with point of sale devices like barcode scanner, check reader etc. I could find out that there is a POS.NET library that can be used for the purpose, but it seems to have been built for .NET 1.12 and no updates after that. Can you suggest me if there is any other .NET libraries that can be used for the purpose. You may also help me by sharing your thoughts and ideas.

Question by Selvamurugan N.

Answer:

Answering your first part of the question - Why there are n't any updates to this library? - I can only guess the answer for this and that I feel is due to the fact the device manufacturers lag behind in updating the communication protocols, which is more so because typically these devices are built for a low cost specific purpose operating environments. For instance, the POS terminals don't have to be on a Windows 7, it would just be enough for them to be on Windows XP or even older operating system. That probably is the reason, why the Library continues to be based on COM components and does not need an update.

On using the POS.NET library, yes, you can still use it in the later frameworks of .NET, but be aware of some of the constraints or issues as described in this blog post. The blog author calls out issues with 64 bit environment and also with .NET Framework 4.0. Don't miss out the comments, as there are some valid opinions and observations in the form of comments. You may also want to check out the Microsoft's publication on using the POS.NET titled as Creating a Proof of Concept POS Application.

If that does not suit you, then go ahead and learn to access and work with USB devices using HID (Human Interface Device), but you need to know the communication protocols and the data structures as specified by the device manufacturer. This will for sure will give you a better control over your integration, but you would be re-inventing the wheel. Here is a nice introduction to working with USB devices in .NET.

My recommendation is that check out if the device vendor provides you a .NET or a COM Library and if yes, using that will be the best option as some device manufacturers may have built certain proprietary protocols, which would work best with their own drivers. If that is not the case, then evaluate POS.NET whether it fits your use cases. Most of the times it should be fine, unless you meet up with some of the constraints when using with later versions of .NET Framework. If left with no choice, use HID interface to have your requirements met. You may also want to check out this msdn article on using Alternate Input Devices.