Showing posts with label DotNet. Show all posts
Showing posts with label DotNet. Show all posts

Wednesday, November 19, 2014

Step by Step guide to create First PDF report with ADOBE Pro and iTextSharp -- .NET

Recently I had to work on a reporting module for Mobile application. I used iTextSharp to write wrapper class which was responsible for creating PDF files on the fly. The plan was to create PDF forms from Adbobe Acrobat Pro and generate PDF reports using the iTextSharp and my wraper class. My wrapper class takes PDF Template path, Simple Modal object (Just having values to print on PDF) and the output PDF path as input and generate PDF report. Let us see in more detail.

First Install NuGet Package, iTextSharp

Create PDF form 

First create a mock up of a report in the word document,


Reflection: Dynamically reading Object Properties and Calling Methods -- .NET


Introduction

In the .NET Framework, every program is compiled into an assembly containing metadata which has information of assembly behavior and structure. Reflection in .NET is used to observe and change the behavior of any object which means you can read read metadata of an object through reflection.

Current sample is going to describe following features of Reflection,
  1. Object properties and their datatypes.
  2. Call object methods dynamically. 
The first thing to use reflection in your project is, include the reflection namespace,

using System.Reflection;

Monday, May 5, 2014

The assembly 'DevExpress ...' is not registered for COM Interop. Please register it with regasm.exe /tlb.

Last week i was stuck in to a problem for registering the DevExpress library. I received following error while compiling the project,

"The assembly 'DevExpress.Utils.v13.2, Version=13.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' is not registered for COM Interop. 
Please register it with regasm.exe /tlb."

Solution:
1- Open command prompt with administrator privileges and navigate to folder,
C:\Program Files (x86)\DevExpress 13.2\Components\Bin\Framework

2- Run following command,
RegAsm.exe "C:\Program Files (x86)\DevExpress 13.2\Components\Bin\Framework\DevExpress.Utils.v13.2.dll"


Friday, February 21, 2014

Adding Recursive Folders to TFS using C#


Add reference to two dlls

Microsoft.TeamFoundation.Client.dll
Microsoft.TeamFoundation.VersionControl.Client.dll

Include following assemblies,

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;


Authenticating TFS

// Providing URL, UserName and Password
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(tfsURL), new                          System.Net.NetworkCredential(userName,password));

// Checking Authentication
tpc.EnsureAuthenticated();

// Getting Version Control instance
VersionControlServer versionControl = tpc.GetService<VersionControlServer>();