Creating a PDF with ASP.NET. A PDF solution that many can use
Working for a staffing firm, I have written all of our front-end software to run over the Internet so we can share common databases with our smaller branch offices. The biggest problem we faced, however, was reporting. How do we get live documents (applications, etc.) to generate themselves when an applicant sits down at the kiosk and fills out their on-line employment application? While we’re doing a great job of capturing the data, we still need an applicant to sign the application.
I tried a number of things, but the limits seem to be:
If I could produce it fast, it was an HTML form derivative and looked terrible when printed.
If I could produce it looking right, it was clunky and slow.
Remember, we are not talking about tabular data or an spreadsheet. We want the application with our logo to be processed.
Finally, I settled on Adobe PDF. The formatting looks good and the files are thin. Most users have it on their system, and all my users do. So I searched for ways to pass data from HTML page to PDF files. I wanted to pass data directly from my HTML form to a database while generating the field data into the PDF file for display or printing.
I found PDF Duo .NET component. It converts HTML to PDF. It is native .NET component coded with pure C#. Also PDF Duo .NET does not require any additional software.
www.duodimension.com/html_pdf_asp.net/component_html_pdf.aspx
This is the link to the home page of PDF Duo .NET component.
Step 1.
Download the component and add reference to PDF Duo .NET in your project.
Step 2.
Create the HTML form. Save data to database if it is needed. Create the PDF using main class HTML to PDF. Instead of API functions for generation a PDF, use HTML syntax:
DuoDimension.HtmlToPdf conv = new DuoDimension.HtmlToPdf();
conv.BasePath = MapPath(“~/”);
conv.PageFormat = DuoDimension.ePageFormat.A4;
conv.PageOrientation = DuoDimension.ePageOrientation.Portrait;
conv.OpenHTML(“Create HTML string using tags for text formatting”); conv.SavePDF(MapPath(“~/pdf/”) + “report.pdf”);
preport.InnerText = “The report has been created.”;
Save your work to wherever you want on your Web server.
Also the PDF Duo .NET component can show resulted PDF without saving it on the disk.
So without having to be an expert at PDF, this is my answer for the moment.
Our goal is to provide high-quality components for converting between file formats. We develop tools that convert formats such as PDF, HTML, DOC, XLS, RTF, XML. Our long-term vision is to continually create new and innovative solutions featuring greater ease of use and higher quality than the competition.
Article from articlesbase.com
Find More ASP.NET Articles
Creating Sql Database Connection in Asp.net Web Application Through C#
1: Open visual studio 2005 and from FILE select NEW-> WebSite, then from pop-menu select asp.net website (Note: Language must be C#) , then press OK.
2: Now create three textboxes from the toolbox , to remove ambiguity I am using default name for that textboxes and that should be textbox1,textbox2 & textbox3. And also drag & drop the button to the asp.net application.
3: Meanwhile, Open SQL SERVER Management studio 2005 and open adventureworks(or you can create your own database by the Sql command CREATE DATABASE database_name), but here I am using AdventureWorks database.
4: Then create table by clicking right mouse button and form three column, Name them according to your requirement , for your information only I used EID,name,Address. And click save button, then you’ll get a pop up menu where you have to enter the Table Name, for this example I used students.
5: Now Come Back to Visual studio Application and write the following code in the button_click event
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection myConn = new SqlConnection();
myConn.ConnectionString = “Connection string(See Below for this — )COPY PASTE HERE“;
myConn.Open();
string strqry = “Insert into students values (” + TextBox1.Text +
“,’” + TextBox2.Text + “‘,’” + TextBox3.Text + “‘)”;
SqlCommand myCom = new SqlCommand(strqry, myConn);
int numrow = myCom.ExecuteNonQuery();
myConn.Close();
}
Kindly note down the connectionString Syntax, to obtain this string do the following steps :
Step 1 : Go to toolbox and from data section drag & drop SqlDataSource.
Step 2: Then on left clicking the mouse on SqlDataSource , you will get configureDataSource link, Slect this.
Step 3: NewConnection String -> Provide Server Name then select or write database name , i.e. AdventureWorks.
Step 4: TestConnection and then Press OK.
Step 5 : Now you will again redirect to the page that you actually see in the step 2, but this time click + sign before the connection string and from the drop drown hierarchy you will receive the connection string.
Step 6: Just copy and paste this string to the place of connectionstring.
Now debug & run Your application and check it’s effect on the table.
If still you face any problem feel free to ask.
Hope this explanation help you to understand the basics of database connectivity.
If you like this please comment it !
Thanks,
Anuj
Anuj Tripathi
Success comes to those who dares
I am a Computer Engineer, right now I am working as a software Engineer
Article from articlesbase.com
Categories: ASP.NET Tags: application, ASP.NET, Connection, Creating, Database, Through
Creating a Simple Ajax Control in Asp.net 2.0 and C#
A Simple AJAX control in ASP.NET 2.0 and C#
Introduction
In this article I will explain how you can easily create an AJAX enabled web site within Visual Studio 2005 utilizing C# and how to utilize the AJAX framework to add a simple control from the list of controls available in the AJAX Control Toolkit.
The AJAX control we will be working with in this article is the “PasswordStrength” control. As mentioned above this control is in the AJAX Control Toolkit we installed in the previous article of this series. We will also learn that the PasswordStrength control can easily secure passwords as they are being entered and notify the user real time as to what else they need to add to their password in order for it to meet your requirements.
In the previous article we learned the following about AJAX and what you can with it?
“ASP.NET AJAX is a free framework for quickly creating efficient and interactive Web applications that work across all popular browsers.”
ASP.NET AJAX:
Create interfaces with AJAX components that can be reused.
Upgrade your existing pages with AJAX controls.
AJAX comes with support for all modern browsers
AJAX comes as part of Visual Studio 2008 and does not need to be downloaded and installed as in Visual Studio 2005.
What we will learn in this article:
How to Create an AJAX enabled Web Site
How to utilize the PasswordStrength control
Please Note:
AJAX functionality is integrated in ASP.NET 3.5 and does not require any additional downloads. If you are using ASP.NET 3.5 this article does not apply to you.
Getting Started with our AJAX Application
Before we begin coding we will need to download the AJAX framework and install it onto our system in order to have the framework available for us to create our first AJAX web project.
In our previous article titled “Getting Started with AJAX, ASP.NET 2.0 and C#“ we went through the steps involved to install AJAX and how to AJAX enable Visual Studio. We explained where to go to find out about AJAX and that you could download step by step tutorials that will guide you through using every control within the AJAX Control Toolkit.
Here is the AJAX web site for you to add to your bookmarks in your favorite browser:
http://www.asp.net/
Configure Visual Studio 2005
Please Visit Programminghelp.com For the full article and Pictorial tutorial.
http://www.programminghelp.com/web-development/ajax/creating-a-simple-ajax-control-in-asp-net-2-0-and-c/
Programming Help is a community collaboration for programming resources, tutorials, articles, forums, and help. Offering articles written by programmers and developers with years of experience. ProgrammingHelp.com strives to develop and create context and articles in which the beginning and most advanced level programmers/coders can use in everyday methods of development. We welcome you to come join us with your questions and knowledge to help us create an excelled programming community and open forum.
Article from articlesbase.com
Creating Linq to Sql Entities in C#
This tutorial was created with Visual Studio .NET 2008, but can be recreated in 2005, after downloading and installing Microsoft’s LINQ Community Technology Preview release, which can be downloaded from here.
Visual Studio.NET 2008 makes it very easy for us to create LINQ to SQL Entities using the Object Relational Designer. What it does is creates classes and methods that relate to the database columns and tables. This makes it possible for us to communicate with the data using LINQ (Language Integrated Query).
This tutorial will show how we can bypass the Designer and write the class ourselves, so that we get a better understanding of what’s going on. For this example, we will be using a SQL database with one table and three columns – id, name, and city.
Once we have our database set up, we will create a new class to represent the database table structure. It should look something like this:
using System;
using System.Data.Linq.Mapping;
[Table(Name="tblPeople")]
public class people
{
[Column(IsPrimaryKey=true, IsDbGenerated=true)]
public int Id { get; set; }
[Column(CanBeNull=true)]
public string name { get; set; }
[Column(CanBeNull=true)]
public string city { get; set; }
public people()
{
}
}
It is advised to always include the table name in the class, although it is not really required if the class is named the same as the table in the SQL database. You should always declare the Primary Key, especially if you are planning on making changes to the database. IsDbGenerated is also used where the database will auto-generate the values upon insert.
In the class, we need to define a [Column] for each in the database table, and then the name of the column should be represented by the public string (or int, etc.)
Next, we are going to display the data with a GridView, and we will also add a textbox and button to the page to allow searching of the database.
Our ASPX page will look something like this:
For the full article please visit LinqHelp.com. Happy Coding!
Article from articlesbase.com
Creating Linq to Sql Entities in Vb.net
This tutorial was created with Visual Studio .NET 2008, but can be recreated in 2005, after downloading and installing Microsoft’s LINQ Community Technology Preview release, which can be downloaded from here.
Visual Studio.NET 2008 makes it very easy for us to create LINQ to SQL Entities using the Object Relational Designer. What it does is creates classes and methods that relate to the database columns and tables. This makes it possible for us to communicate with the data using LINQ (Language Integrated Query).
This tutorial will show how we can bypass the Designer and write the class ourselves, so that we get a better understanding of what’s going on. For this example, we will be using a SQL database with one table and three columns – id, name, and city.
Once we have our database set up, we will create a new class to represent the database table structure. It should look something like this:
Imports System
Imports System.Data.Linq.Mapping
_
Public Class people
Private _Id As Integer
Private _name As String
Private _city As String
_
Public Property Id() As Integer
Get
Return _Id
End Get
Set(ByVal value As Integer)
_Id = value
End Set
End Property
_
Public Property name() As String
Get
Return _name
End Get
Set(ByVal value As String)
_name = value
End Set
End Property
_
Public Property city() As String
Get
Return _city
End Get
Set(ByVal value As String)
_city = value
End Set
End Property
End Class
It is advised to always include the table name in the class, although it is not really required if the class is named the same as the table in the SQL database. You should always declare the Primary Key, especially if you are planning on making changes to the database. IsDbGenerated is also used where the database will auto-generate the values upon insert.
In the class, we need to define a [Column] for each in the database table, and then the name of the column should be represented by the public string (or int, etc.)
Next, we are going to display the data with a GridView, and we will also add a textbox and button to the page to allow searching of the database.
Our ASPX page will look something like this:
For the full article please visit LinQhelp.com. Thanks and happy coding!
http://www.linqhelp.com
Article from articlesbase.com
Find More LINQ Articles
Creating an Artistic Blog Header with CSS Sprites
In this fourth part of a seven-part series, I build the header section of a sample blog site. It will use another set of CSS sprites — or, in other words, a different background image — to decorate the sections comprising its navigation bar.
If you think that building engaging navigation bars using CSS sprites is a hard-to-master process that can be tackled only by seasoned web designers with vast experience, then this group of articles will hopefully change your mind.
Welcome to the fourth part of a series on building CSS sprite-based navigation bars. With numerous code samples and complementary images, this series shows you in a step-by-step fashion how to develop a pair of eye-catching links bars that take advantage of the functionality provided by CSS sprites to decorate the different states of their sections.
And now that you’ve been introduced to the main subject of this series, it
View the Original article
Categories: Programming Tags: Artistic, briefly about c# and c# tools, c sharp compiler download, c# compilers, C# keywords classified, Creating, develop in c# in windows98, download C# compiler for windows xp, download different Types Of Compilers in C#, explain briefly about c# and c# tools, Header, multiform application in C#.Net, Sprites