生成发票报告 [英] generate invoice report

查看:87
本文介绍了生成发票报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用报告或任何其他方式生成这样的发票账单请查看图像链接......



http://www.codeproject.com/KB/cs/PrintInvoice_CS/Img027.JPG [ ^ ]



i从DatagridView获取产品详细信息并添加到listView

id>>产品名称>>数量>>价格

1>> abc>> 1>> 12

2>> abc>> 5>> 15

这个所有信息都存储在listView中,如上所述。现在告诉我这个listview数据如何显示在我的发票中。





这是我的打印视图代码

how i generate invoice bill like this using report or any other way please see link for image ......

http://www.codeproject.com/KB/cs/PrintInvoice_CS/Img027.JPG[^]

i take products details form DatagridView and add to the listView
id>> product name>> quantity >> price
1 >> abc >> 1 >> 12
2 >> abc >> 5 >> 15
this all info i store in listView like above. now tell me how this listview data show in my invoice .


this is my print view code

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
       {
           e.Graphics.DrawString("Invoice No: " + txtInvoiceNo.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 180));

          // e.Graphics.DrawString("Invoice Date: " + dtpInvoiceDate.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 200));
           e.Graphics.DrawString("Invoice Date: " + DateTime.Now, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 220));


           e.Graphics.DrawString(label1.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 250));

           e.Graphics.DrawString("Item No", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 280));
           e.Graphics.DrawString("Product Name", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(180, 280));
           e.Graphics.DrawString("Quantity", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(400, 280));
           e.Graphics.DrawString("Unit Price", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(550, 280));
           e.Graphics.DrawString("Total Amount", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(670, 280));
           e.Graphics.DrawString(label1.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 300));



           e.Graphics.DrawString("Total:", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(550, 400));
           e.Graphics.DrawString("Rs." + txtSubTotal.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(670, 400));
           e.Graphics.DrawString(label1.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(25, 380));

       }

推荐答案

嗨raajaakhan,



请通过reportviewer / crystalreports控件。这将解决您的所有问题,并且它们也很容易使用..
Hi raajaakhan,

Please go through reportviewer/crystalreports controls. this will solve all your problem and they are easy to use too..


在.NET中有多种方法可以完成这项工作,您可以使用已有的内置解决方案来创建发票您的软件或您可以使用WPF或Win Forms控件来创建自己的界面。在问题中添加图像并不能解释问题。



在该发票中,他使用的是顶部的图像,然后是一堆TextBlock,一行,一些TextBlock,一行,然后一个表到包含其每一行中的所有产品。



然后在最后一段(事情中)他将所选产品的详细信息加起来并显示它们的结果。现在,这取决于您使用C ++的Win32,C#的Win Forms或WPF应用程序开发软件的方法。在某些情况下,您可以通过 MSDN [ ^ ]文档。
There are multiple ways of doing this job in .NET, you can use already built-in solutions to create invoices for your softwares or you can use WPF or Win Forms Controls to create an interface of your own. Adding an image in the question doesn't explain the problem.

In that invoice, he is using an image in the top, then a bunch of TextBlock, a line, a few more TextBlocks, a line, then a Table to contain all of the products in each of the row of its.

Then in the final paragraph (kind of thing) he is adding up the details of the products that were selected and shows the result of them. Now this depends on your approach for the application whether you're using C++'s Win32, C#'s Win Forms or WPF application to develop the software. You can somehow in every case get the details on creating the UI from the .NET Controls from MSDN[^] documents.


这篇关于生成发票报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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