开发者

easy way to write report on data

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

开发者_JAVA技巧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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜