Solved

integrating barcode to crystal report using asp.net

Posted on 2015-02-03
9
836 Views
Last Modified: 2015-03-05
Dear,
I am design an web application for school in ASP.Net using Visual Studio 2010, For reporting i have used crystal report.
I have generated Marksheet report for each student which is to be printed at the end of each examination. I want to make it bit more secure, so want to integrate Barcode to it, so that i can autheticate the marksheet by scanning if some duplication printing of the same is done.

What i plan to do is, i want to generate a unique code for each student which remains the same till he is in school. Then i will generate barcode by combining that unique student code and semester and want to generate a barcode for each semester.

I dont have any idea of integrating barcode. Please guide which control/tool/script to be used to implement such functionality.

Note : I want to generate barcode runtime, dont want to store borcode image to any location once and then use that image everytime.

Also suggest what option is best. Expert feedback and suggestions are also welcomed if any..
thanks
0
Comment
Question by:ronipats
  • 4
  • 2
9 Comments
 
LVL 13

Expert Comment

by:frankhelk
ID: 40588062
How about simply using some barcode font ?

There are even some free barcode fonts around ...
0
 
LVL 13

Expert Comment

by:frankhelk
ID: 40588105
Hmmm - thining about it, I would recommend another strategy.

Even a not so bright student would be able to just read out / generate such a barcode himself - the effort to tweak would IMHO quite low.

I would try to do some sophisticated algorithm on the data on the form to generate a complex checksum. That checksum would be a signature of the data, and it could be verified by just repeating the algorithm. I wouldn't be necessary to print it as barcode, because it is intrinsic safe even if easy readable.

Here's an example algorithm approach how to do such a checksum:

Convert each answer result into a string representation, i.e. "09-05-T" for the 9th question in a multiple choice test, ticked answer 5 which was correct (T for true). Or "13-01-F" for question 13, ticked answer 1, failed (F for false). Code Student name, date of bith, semester, date and time of the test etc. (anything which is on the form) together into another String. Concatenate that together with the results to a long string and end it with a non disclosed signature to make hacking less simple, like

Smith*John*Sem03*1998-12-13*2015-02-04*01-03-T*02-05-T*03-01-F* .... *38-04-T*RESULT089*C3FCD3D76192E4007DFB496CCA67E13B

Open in new window


Calculate a MD5 checksum (see here for an explanation) of that string (here's an example how to do that in C#, but there's a lot more examples on the net) and print it onto your form in a not too prominent place. You might fool the hacker guys by obfuscating the code a bit, i.e. by programmatically shuffling the 32 charaters around a bit, possibly enclose it in some random junk and grouping them in a fancy way like

C3FCD3D76192E4007DFB496CCA67E13B

  represented as

A7-S3FF-7DFB-496C/CA67-E1-3B-GZ-C3F/CD3D-76-192E#400-RG-99-XX

(exchanged first and second half of the checksum string, added 5 useless random characters to the start and 6 at the end, and finally inserted fancy (and even meaning-free) separators ). The obfuscation is easily reversible with a program if it follows rules ...

By the way, the signature mentioned above has the format of an MD5 checksum, too. You might i.e. generate it from a part of the "string w/o signature, i.e. the first n characters or as much charaters as the day in the birthdate reads, or, or, or ...

The trick is that if in doubt you enter the form content into some program that just uses the code that generated the checksum. If everything is correct, the generated checksum is the same. Otherwise the form was tweaked. And the checksum generation is too complex to be easily hacked (and if somebody manages to hack the thing, he deserves a computing degree already :-).
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40588426
Are you using Crystal to generate the bar code?

If not, how is Crystal related to this question?

mlmcc
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:ronipats
ID: 40588447
I am using crystal report generating report..... not for generating barcode.

how to place barcode image gnerated runtime in crystal report. do i need any third party control/dll/api. or can i do directly.

thanks
0
 
LVL 13

Expert Comment

by:frankhelk
ID: 40588635
If you insist on the barcode, you'll just have to use the barcode font for the data. That way the data is automatic formatted as barcode. No control, no dll, no API. Just insert a text field and format it to be diplayed with the barcode font.

I presume the report to be displayed as PDF, so the barcode font only needs to be installed on the machine with the CR on it (where the reports are being generated). Maybe you have to set up CR to embed the font into the pdf.

Nevertheless I would use some algorithm as I've pointed out before.
0
 
LVL 13

Assisted Solution

by:frankhelk
frankhelk earned 250 total points
ID: 40588671
Just an addition:
If you want to simplify the authenticity check, you might as well generate the checksum I've mentioned as barcode ... and if you'll drive it to the maximum of usabilty, you could encode the basic data for the checksum generation as well as the checksum itself into a barcode.

Unfortunately most simple (font) barcodes consume much space, so you'll be restricted to put only a small bit of data into the code - the recommended MD% checksum would be suitable for that ... just 32 characters (non-obfuscated). A QR code would be a nice thing to store some more data, and it can be read out with a smart phone. There's some implementation for the gerenation of QR codes here.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 40588719
I use the Free 3 of 9 fonts with Crystal.  They include a barcode font.

http://www.fonts2u.com/free-3-of-9-regular.font

You may have to use a formula for the field and append a * to the front and back of the data.

Example

'*' & {YourField} & '*'

Put the formula on the report and set the font to one of the barcode fonts.
You will have to set the width/height so the full barcode can show.


mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now