C#打印收据,pdf格式 [英] C# print receipt in pdf
问题描述
我申请了医院。
我的所有输入都已完成。
付款接收窗口也完成了。
收据我有两张桌子
1.从哪里我们可以获得测试详情。
2.从哪里我们可以获得所有其他细节。
表1(从此我想得到的只是测试细节和测试价格)
CREATE TABLE [dbo]。[tblReportData](
[ReportId] [int] IDENTITY(1,1)NOT NULL,
[PatientID] [int] NOT NULL,
[ TestId] [int] NOT NULL,
[ProductID] [int] NOT NULL,
[TestName] [nvarchar](100)NOT NULL,
[TestPrice] [nvarchar](100) NULL,
[ReferenceDr] [nvarchar](100)NOT NULL,
[备注] [nvarchar](max)NULL,
[Date] [date] NOT NULL,
[EnteredBy] [nvarchar](50)NOT NULL,
CONSTRAINT [PK_tblReportData] PRIMARY KEY CLUSTERED
表2(来自这个收据,patientid,日期,病人姓名,refdr)
CREATE TABLE [dbo]。[tblReceiptDetails](
[ReceiptId] [bigint] IDENTITY(1,1)NOT NULL,
[PatientID] [int] NULL,
[PatientName] [nvarchar](200)NULL,
[TestDone] [nvarchar](max)NULL,
[TotalDue] [float] NULL,
[ReceivedAmt] [float] NULL,
[Discount] [float] NULL,
[PendingAmt] [float] NULL,
[PaymentType] [nvarchar](50)NULL,
[PaymentStatus] [nvarchar]( 50)NULL,
[备注] [nvarchar](最大)NULL,
[日期] [日期] NULL,
[EnteredBy] [nvarchar](50)NULL,
CONSTRAINT [PK_tblReceiptDetails] PRIMARY KEY CLUSTERED
有人可以帮助我摆脱这个吗?
非常感谢提前。
我已经为此完成了存储过程但是如何输入软件。
我是代码新手。
请帮忙。
我尝试了什么:
我尝试使用Microsoft报告查看器但没有用。
我认为您需要执行以下查询才能正确获取ReportData。
SELECT tblReportData.TestName ,tblReportData.TestPrice,tblReportData.ReferenceDr,tblReportData.Remarks,tblReportData.EnterBy,tblReceiptDetails.TestDone,tblReceiptDetails.PatientName,tblReceiptDetails.Remark
FROM tblReceiptDetails INNER JOIN
tblReportData ON tblReceiptDetails。 PatientID = tblReportData.PatientID
以及其他一切只需要PatientID并将其反转如下所示。
SELECT tblReportData.TestName,tblReportData.TestPrice,tblReportData.ReferenceDr,tblReportData.Remarks,tblReportData.EnterBy ,tblReceiptDetails.PatientName,tblReportData。 Date ,tblR eceiptDetails.PaymentStatus,
tblReceiptDetails.PaymentType,tblReceiptDetails.ReceivedAmt,tblReceiptDetails.TotalDue,tblReceiptDetails.TestDone
FROM tblReceiptDetails INNER JOIN
tblReportData ON tblReceiptDetails.PatientID = tblReportData.PatientID
我认为最好的办法是使用SQL查询设计器并检查测试数据,看看你想要实现的目标。
Hi,
I made application for hospital.
My all input are done.
Payment receive window also done.
For receipt I have two tables
1. from where we can get test details.
2. from where we can get all other details.
Table 1 (from this I want to get only test details & test price)
CREATE TABLE [dbo].[tblReportData]( [ReportId] [int] IDENTITY(1,1) NOT NULL, [PatientID] [int] NOT NULL, [TestId] [int] NOT NULL, [ProductID] [int] NOT NULL, [TestName] [nvarchar](100) NOT NULL, [TestPrice] [nvarchar](100) NULL, [ReferenceDr] [nvarchar](100) NOT NULL, [Remarks] [nvarchar](max) NULL, [Date] [date] NOT NULL, [EnteredBy] [nvarchar](50) NOT NULL, CONSTRAINT [PK_tblReportData] PRIMARY KEY CLUSTERED
Table 2 (from this receiptid, patientid, date, patient name, refdr)
CREATE TABLE [dbo].[tblReceiptDetails]( [ReceiptId] [bigint] IDENTITY(1,1) NOT NULL, [PatientID] [int] NULL, [PatientName] [nvarchar](200) NULL, [TestDone] [nvarchar](max) NULL, [TotalDue] [float] NULL, [ReceivedAmt] [float] NULL, [Discount] [float] NULL, [PendingAmt] [float] NULL, [PaymentType] [nvarchar](50) NULL, [PaymentStatus] [nvarchar](50) NULL, [Remark] [nvarchar](max) NULL, [Date] [date] NULL, [EnteredBy] [nvarchar](50) NULL, CONSTRAINT [PK_tblReceiptDetails] PRIMARY KEY CLUSTERED Can someone please help me to get out of this? Many thanks in advance. I have done stored procedure for this but how can I put in software. I am new in code. Please help. What I have tried: I tried with Microsoft report viewer but no avail.
I think you need to do following query to get ReportData correctly.
SELECT tblReportData.TestName, tblReportData.TestPrice, tblReportData.ReferenceDr, tblReportData.Remarks, tblReportData.EnterBy, tblReceiptDetails.TestDone, tblReceiptDetails.PatientName, tblReceiptDetails.Remark FROM tblReceiptDetails INNER JOIN tblReportData ON tblReceiptDetails.PatientID = tblReportData.PatientID
and for everything else just required PatientID and reverse it as given below.
SELECT tblReportData.TestName, tblReportData.TestPrice, tblReportData.ReferenceDr, tblReportData.Remarks, tblReportData.EnterBy, tblReceiptDetails.PatientName, tblReportData.Date, tblReceiptDetails.PaymentStatus, tblReceiptDetails.PaymentType, tblReceiptDetails.ReceivedAmt, tblReceiptDetails.TotalDue, tblReceiptDetails.TestDone FROM tblReceiptDetails INNER JOIN tblReportData ON tblReceiptDetails.PatientID = tblReportData.PatientID
I think best bet is use SQL Query designer and check with your test data and see what exactly you want to achieve.
这篇关于C#打印收据,pdf格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!