Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have build some project about transaction in a hospital...
but i don't know how to build the result of the bill transaction.
the result contain like this:

NANY HOSPITAL
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
October 02, 2012

Medic No. : 000900009
PATIENT NAME: Nurwina
ADDRESS : Indramayu ST, No.33 West Java.


NO LIST ACT BILL
1 VB 20000
2 JX 30000
================ +
TOTAL = 50000

NO LIST DRUGS BILL
1 PARACETAMOL 7000
2 DEXAM 8000
================ +
TOTAL = 15000
Posted
Updated 1-Oct-12 18:30pm
v2
Comments
adesusan 7-Oct-12 7:56am    
I like your answer, but could you give an example about that... I have no Idea about 2 queries in one and of them is details for another.

You build the result by querying the underling tables which hold the respective pieces of data using joins on primary and foreign keys.

It is entirely possible that you may require at least 2 queries, one for the "master" and one for the "details" of your report.
 
Share this answer
 
The answer is print the panel of form using this code:
C#
void PrintImage(object o, PrintPageEventArgs e)
        {
            Bitmap img = new Bitmap(panel3.Width, panel3.Height);
            InvertZOrderOfControls(panel3.Controls);
            panel3.DrawToBitmap(img, new Rectangle(new Point(), panel3.Size));
            InvertZOrderOfControls(panel3.Controls);
            Point p = new Point(0, 0);
            e.Graphics.DrawImage(img, p);
        }
 
Share this answer
 

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