Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.4k views
in Technique[技术] by (71.8m points)

c# - Using Microsoft RDLC without a database (or using MySQL as the database)

Although I read this article: Printing and making reports in c# winform it did not answer where I was hoping to go with using the Microsoft RDLC report writer.

Suppose that you have data somewhere (any SQL database (MS, MySQL, etc.), or any other file, such as a CSV file) and you would like to read that data, do some calculations with that data and then produce a report. You might exclude some data based on some factors. You might want to print some ratios without showing all the data that went into the calculation of those ratios.

Ultimately, I would like to take an array or datatable that I have in memory and produce it as a report. In the simplest form, suppose I have an array called MyReport. It has r rows and c columns. For each row, print the columns across the page. I may want to have some subtotals along the way. Have the report writer take care of the page headers, page footers and page numbering.

This is basic COBOL stuff. In COBOL there was a "Report Section". An example can be found at: http://h30266.www3.hpe.com/odl/axplp/progtool/cobol29/AA_Q2G1H_TK.PDF, pages 10-45 through 10-47. However, do not assume that the data is neatly organized in some input file where you are just reading a record, then printing that record. Suppose instead that you read the data, crunch on it and then the output is very different (and hopefully more meaningful) than the detailed data records. Most likely, you are summarizing the detailed data records, but through an algorithm that is more complex than anything you could write in SQL.

How can I do something similar in C#?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...