Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I work in an office where we have to design a month's attendance register using excel sheet by marking days and holidays and typing employee names. I need to design an A3 size document or a picturebox using vb.net to simplify this process. I don't need to work with data as the sheet will be printed and employees will sign it everyday in hardcopy. I just need to design the page easily by just entering month & year and all employee names. I need it in A3 size too. Any Help? I will code it myself . I just need some advice. TY. NB: I am a beginner in .net. (I used to code in vb6)

What I have tried:

I have tried using Excel but now I need to do it easily by program.
Posted
Updated 31-Oct-17 21:12pm
Comments
Richard MacCutchan 1-Nov-17 5:13am    
Why not just use Excel which can do the job in no time?

1 solution

We can't give you the "full details" - it's a whole app, and would need more than we can provide in a little textbox like this!

But printing is relatively simple: use the PrintDocument Class (System.Drawing.Printing)[^] and you have full control over what happens.
In the PrintPage event handler, you can use DrawLine and DrawString to draw boxes and text to "fill in the blanks" as you need. Provided you have an A3 printer, you will have full control over the size and location of everything you want to print.
(The link includes a very basic example, but you can find much more comprehensive ones with Google.)

If you get stuck at a specific point, then please ask about that and we will do our best to help. But we can't do it all for you!
 
Share this answer
 
Comments
lionkings 1-Nov-17 6:04am    
Thank You for replying. I don't need all details like you think. I just need a way for doing that like, Use a picturebox, draw a month calendar, print that etc (which is what I have in mind)
OriginalGriff 1-Nov-17 6:22am    
Don't use a picturebox! Think about it: at print resolution of 300dpi, A3 is 3508 x 4961 pixels: so the memory required is 69.6MB, which is a damn huge picture! Your app would move like a stunned slug on Mogadons... :laugh:

You don't need a "month calendar": you need a "month planner". The difference being that each month starts on the left with day 1, rather than a calendar which always starts with Sunday (or Monday on some) on the left.

Literally all you need to do is create a PrintDocument, define rectangular areas to fit employee names, then divide the remaining space into 28, 29, 30, or 31 "days" and print heading text and dividing lines.
That's no more complicated in .NET (VB or C#) that it would have been in VB6 - indeed possibly easier in many ways!

A print document allows you to directly draw lines, text, images, etc., directly onto a "canvas" which is the sheet of paper that will come out of the printer. Have a look at the link - it's not as complicated as you think!
lionkings 1-Nov-17 7:09am    
You were very helpful!. Going to check out printdocument ..
OriginalGriff 1-Nov-17 7:38am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900