如何在C#中从数据库打印我的事务结果 [英] How to print my result of transaction from database in C#

查看:139
本文介绍了如何在C#中从数据库打印我的事务结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在医院建立了一些关于交易的项目...

但我不知道如何建立账单交易的结果。

结果包含这样的:



NANY HOSPITAL

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

2012年10月2日



Medic编号:000900009

患者姓名:Nurwina

地址:西爪哇省No.33 Indramayu ST。





无列表ACT BILL

1 VB 20000

2 JX 30000

================ +

总计= 50000



没有名单药物条例草案

1 PARACETAMOL 7000

2 DEXAM 8000

================ +

TOTAL = 15000

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

推荐答案

通过查询包含各个数据的下层表来构建结果g加入主键和外键。



完全有可能您需要至少2个查询,一个用于主,一个用于详细信息您的报告。
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.


答案是使用以下代码打印表单面板:

The answer is print the panel of form using this code:
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);
        }


这篇关于如何在C#中从数据库打印我的事务结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆