Tuesday, October 19, 2010

Print specific ASP.Net control from a Web Page

I ran into a requirement, where i had to print only asp.net grid. And this had to work on all browsers. I had similar requirement to print a SSRS report on non IE browser.
So, I came up with this solution(rather, i would call it as workaround). Approach is to select the inner html of the control and print only this area. To do so, i am selecting the inner html  from the control and setting it as a HTML source of an IFRAME which is of size 0x0 and printing it immediately.
Following is the Javascript from the aspx page to this. I have taken reportviewer control for now.








If you are using this for reportviewer, just keep in mind that you are only printing the current page instead of all the visible pages.



I still need to work on getting the styles from the parent page and applying it on the IFRAME so that we dont miss any style information.

Friday, October 15, 2010

Error:Microsoft.ReportingServices.Diagnostics.Utilities.SecureConnectionRequiredException: The operation you are attempting requires a secure connection (HTTPS)

I had this problem from long time and was in such a urgency that i started working with HTTPS. But finally i had to move my machine out of the domain, and left with only option of fixing it.

First step i did was went to “C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles”, which you have already figured out i guess. At the latest log file, you will see this error listed. Which means that RS is configured only for HTTPS and not for HTTP.

To resolve… lets change it.

For not using SSL you need to modify following section in reportserver.config file, at C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer and change

<Add Key="SecureConnectionLevel" Value="2"/>




entry with value from 2 to “0”

Monday, July 5, 2010

How to change Win 7 logon screen

Windows 7 OS enables OEMs to set their own Log-on screen. So if you want to customize yours, you can make use of this registry setting.

  • First you need to enable the custom wallpaper flag in registry. To do so, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background

image 

  • Now set the DWORD value OEMackground to 1, by default it will be 0.
  • Now you have enabled the custom background feature, to select the defaultbackground navigate to c:\Windows\System32\oobe\
  • Create a new folder here called info then one more inside called backgrounds
  • Copy a JPG file to this folder now and  call it backgroundDefault.JPG. Final structure should look something like this…
  • image 

Win + L, now you see it!!!

Friday, June 25, 2010

Why live writer is better than MS Word for blogs

Well this is the first article, as well as the test article for using Windows Live Writer for blogger. At first glance I found following advantages

  • Its WYSIWYG – Yeah, it uses your blog theme, CSS, font… everything
  • You have a preview and option to edit the source code
  • Finally a neat HTML, doesn’t crap like Word does
  • Support for publish scheduling
  • Easy way to publish photos – still testing… Smile ( tested, working fine)

image

  • Loads faster and doesn’t have many unwanted options.
  • easy to load previous entries and edit
  • Easy to label articles

Anyway I strongly recommend downloading and using Windows Live Essentials

Monday, June 21, 2010

Hosting Silverlight Application on Facebook

Objective is to create a game using Silverlight which will utilize Facebook platform and publish on facebook application directory. Following are the features which we will target to deliver
  1. You can compare your score with friends
  2. You can invite your friends on Facebook
  3. You can post your score and events like beating a friend on to your wall
  4. List top 100 scores
  5. List your friends top score along with their profile pictures
In simple words, we are going to walk through the creation of ittiGator Game on Facebook. Take a break now, have a good look at it and come back. Here you go… http://apps.facebook.com/ittigator
Creating game using Silverlight
I will not go into details, its left to your creativity and coding to create a working model. Make sure you make it modular, and lets make a module called ScoreCard and place a control called ScoreCardControl. Here we will list out 6 users including the player , ordered by scores. What you would need from Facebook will be friends list, and friend’s photo. Scores we will be maintained in our SQL Server DBs

To be continued...

Saturday, June 12, 2010

Displaying FBJS dialog on top of Plug-in content

You cannot display any HTML Content on top of a plugin content. This is because of different window message loops running for browser and the plugin content. If you are working with Silverlight there is an option to specify to Silverlight to use browser windows message loops for paint messages. Set windowless=true to make use of this.

However this is not recommended as it will drastically slowdown your Silverlight application. Well, there is no point in using a slow Silverlight application.

If you have realized the limitations by now, lets work on the workaround. I have an application called ittiGator( a facebook game http://apps.facebook.com/ittigator ) where we are prompting with a publish dialog on completing the game.


What we will do is, we will create two DIVs sitting one top of other. We will host our Silverlight in one and publish button in other.
DIV – Publish button with some background.
DIV – Silverlight Content

Do you want to share your High Score with your friends?
We will call a JavaScript method called publish from Silverlight using
HtmlPage.Window.Invoke("publishScore", new string[] { UserScore.Text, UserName.Text });
In this publishscore method we will increase the height of ShowCase div to amount that is enough to push the plugin content just below the visible screen area.

function publishscore (score, usrname) 
{
document.getElementById("Showcase").style.height = '800px';
}
Reset the height on the publish dialog call back function
FB.Connect.streamPublish('', g_attachment, g_action_links, null, 'Post your high score and let the world follow you!', stream_callback_resizetheDiv);

This should work if you work with flash based application or even if you have an activex control embedded.

Leave a comment if you need any assistance in implementing this.

Thursday, June 10, 2010

Publishing your Product/Corporate website

If you are a startup and don’t want to spend much time in getting your website out, here we have a solution.

http://www.drupalgardens.com/ can get your website ready in 15 mins!!! To be practical, you can have your full blown website ready in a day. If you say that you have other providers who can do this, believe me they can’t. I strongly recommend you to run through the video and think again. I tried their beta and I am a fan of Drupal garden now!




What it is?

It’s a Drupal based hosting, with a great pluggin added for customization. With this admin plug-in you can

1) Chose templates
2) Chose themes
3) Chose color schemes( this is too good)
4) See workflows
5) Provide your custom CSS etc



Even though they are prized lil high, I think its worth if you are a start-up and focus on your product than the overheads.