English 中文(简体)
easy way to write report on data
原标题:

looking for a good easy way to generate reports on data my application holds.

rather than building it painfully by writing it all out and formatting it with /n s etc is there an easier method? It could be into excel, or just a list... Maybe the only way is to do it like I was thinking...

最佳回答

try creating a csv file (comma seperated values)... its easy to generate

name, author, year lotr, jr tolkien, 1995

and so on

excel can open csv files

问题回答

SQL Server Reporting Sercices (SSRS) is a good reporting option, especially as you can run it for free on top of SQL Express. But it might be a bit of overkill if all you want is one or two simple reprots which will not change.

ASPX In that case it would be relatively simple to have an aspx page that contains either a gridview or listview which you bind your data in to, or you could just generate an HTML page with the data formatted in to a table. The reason why i mention doing it in an aspx or web page is that it simplifies your printing and display options.

Other Tools Of course there are other reporting toolsets out there which you should check out, but invariably they will add extra dependencies or complexities to your application.

EXCEL If your users have Excel installed, you can write data to Excel sheets from C# or from Excel queries.

Standard Reporting Packages If your 2008 tag meant SQL Server 2008, then you already have reporting services - that is a really good option. You can investigate compar

I definitely recommend going with a standard reporting package (Excel, SSRS, Crystal, etc) rather than building one by hand using HTML or ASPX.

Why not create an XML document based on the data that you want to be outputted (be sure you format the greater than/less than/ampersand/quotes into a html entity), apply an XML/XSLT stylesheet to transform it to generate a html document. Using a WebBrowser Control, you can use that as a "Report Viewer" and can print it out. Have done this before and it was successful. Ok, it may sound ridiculous but it was the nearest thing to the grail of reporting. I did not have Crystal Reports at the time but hey it worked for me. Think about it, suppose you want to change the layout. Leave the XML document alone, but change the XSLT stylesheet to suit your needs. There is one big gotcha that I have not had much success with, taking into account of number of lines per page as trying to do that with XPATH code was somewhat kludgy...What do you think of this?

Hope this helps, Best regards, Tom.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签