﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Challenge: NH Prof Exporting Reports</title><description>Yes, I did.
  
It will show up soon in a build near you :-)
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment41</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment41</guid><pubDate>Fri, 23 Oct 2009 22:58:14 GMT</pubDate></item><item><title>JR commented on Challenge: NH Prof Exporting Reports</title><description>Oren, Where is the answer for this? did you find a solution?
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment40</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment40</guid><pubDate>Fri, 23 Oct 2009 22:48:53 GMT</pubDate></item><item><title>Josh Perry commented on Challenge: NH Prof Exporting Reports</title><description>Hey Oren,
  
  
I agree with the others that HTML is the way to go. I started mocking up a small self-contained HTML page that mimics nprof. You can see it here: 
[http://6bit.com/img/nprofreport.html](http://6bit.com/img/nprofreport.html)  
  
I was going to add the ability to view the resulting rows and a session statistics view as well but I thought I'd get your feedback before I put anymore work into this.
  
  
All of the javascript, styles, and data needed to view the report is self contained in the html file you merely need to serialize the nprof session to JSON instead of XML and embed it in the html file. The user could then email or post the html file somewhere for a DBA or anyone to view.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment39</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment39</guid><pubDate>Sun, 20 Sep 2009 23:20:10 GMT</pubDate></item><item><title>Johannes Rudolph commented on Challenge: NH Prof Exporting Reports</title><description>Just wanted to let you know that i have mailed you an example solution.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment38</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment38</guid><pubDate>Wed, 16 Sep 2009 22:53:26 GMT</pubDate></item><item><title>Johannes Rudolph commented on Challenge: NH Prof Exporting Reports</title><description>Im sure you may have already evaluated my suggestion to use combit List&amp;Label, however i want to point out some other things about it:
  
  
Im currently working on an application that uses List&amp;Label to print ~10.000 Reports per month, varying from simple lists, over invoices to analysis charts. There are about 20 kinds of different reports, all of them share a common subset of templates, e.g Paper layout, letter with adress etc. Every Report that gets printed will automatically be archived in an FileShare based Report Storage. 
  
  
Together with modelshredder (see link in my previous post) one can skip the xml creation, you can directly create a reporting model from your domain model.
  
  
Whether you want PDF or HTML would be no problem at all, both formats are possible without ANY further work. L&amp;L has strong support for Realtime WYSWIG editing with production data, your users would gain the ability to design how many different reports or analysis they'd like. I am not aware of any other solution that is this flexible in terms of output formats and report design.
  
  
It remains to say that it isn't free, however licensing is per developer using it and you may redistribute freely.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment37</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment37</guid><pubDate>Wed, 16 Sep 2009 20:52:52 GMT</pubDate></item><item><title>Ray commented on Challenge: NH Prof Exporting Reports</title><description>You could also use TeX definitions to generate highly readable PDFs. See here for details 
[stackoverflow.com/.../latex-for-pdf-generation-...](http://stackoverflow.com/questions/1210334/latex-for-pdf-generation-in-production)</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment36</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment36</guid><pubDate>Wed, 16 Sep 2009 09:36:31 GMT</pubDate></item><item><title>James Farrer commented on Challenge: NH Prof Exporting Reports</title><description>This has been a very interesting discussion on reporting and gives me a few pointers for the work I'm doing!
  
  
I would second what Lothan said
  
"That said, I'd much more appreciate receiving either a SQL Server Project with all the queries or a set of SQL files that I can simply open with SQL Server Management Studio"
  
  
Obviously you would probably want a HTML report, but the ability to export to .sql files in a .zip would be great - you could include at the top of each .sql all the info about the query in comments and then have the sql query good to go below - could even have a "Developer Comment" section in the comments and allow the developer to enter any additional comments they'd like to
  
  
James
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment35</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment35</guid><pubDate>Wed, 16 Sep 2009 08:58:19 GMT</pubDate></item><item><title>Fred Hirschfeld commented on Challenge: NH Prof Exporting Reports</title><description>I typically use Microsoft Reporting built into .NET and have a quick sample created for you to look at. I will e-mail you the solution sample.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment34</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment34</guid><pubDate>Wed, 16 Sep 2009 01:50:15 GMT</pubDate></item><item><title>Shawn Wheatley commented on Challenge: NH Prof Exporting Reports</title><description>@Ayende: A couple options are available for image "embedding" in HTML:
  
  
1) Red Gate side steps the issue by hard-linking images that they serve up themselves. This means the vendor (you) would need to ensure that the URIs must not change ("Cool URIs don't change"--Tim Berners-Lee, 
[http://www.w3.org/Provider/Style/URI](http://www.w3.org/Provider/Style/URI))
  
2) Some browsers, although I'm not sure about IE, support inline "data://" URIs, which can contain a MIME type and Base64-encoded data. I've seen inline images done this way as well.
  
  
That said, it sounds like you're still more interested in PDF. My suggestions would be the iTextSharp route (if you're interested in more OSS) or using a reporting engine like SSRS, Crystal (yuck) or Active Reports. I'm sure there are other reporting solutions out there as well, but those are the only ones I have experience with.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment33</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment33</guid><pubDate>Wed, 16 Sep 2009 01:00:07 GMT</pubDate></item><item><title>Ayende Rahien commented on Challenge: NH Prof Exporting Reports</title><description>Shawn,
  
This is based on my impressions more than anything else, but there seems to be more gravity placed on PDF vs. HTML
  
There is also a side issue, how to resolve handling things like images with HTML, which makes PDF much more compelling
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment32</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment32</guid><pubDate>Wed, 16 Sep 2009 00:31:23 GMT</pubDate></item><item><title>Lothan commented on Challenge: NH Prof Exporting Reports</title><description>I also have to question the usefulness of generating PDF reports since these are static objects that are not easily manipulated and it can be hard to get text out of a PDF in a useful manner. It's more like death by a thousand paper cuts.
  
  
If the intent is to send the report to a DBA for optimization, the first thing he/she likely wants to do is pull the into SQL Server Management Studio to run the queries, examine the execution plans, and maybe even run index tuning.
  
  
That said, I'd much more appreciate receiving either a SQL Server Project with all the queries or a set of SQL files that I can simply open with SQL Server Management Studio.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment31</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment31</guid><pubDate>Wed, 16 Sep 2009 00:12:54 GMT</pubDate></item><item><title>Ray commented on Challenge: NH Prof Exporting Reports</title><description>Seconding the MS report viewer option.
  
I've only used it in a web application but basically we design the reports (RDLCs), then there are some calls to RenderReport() that allow you to get a byte array of the report rendered in either excel or pdf format (the other formats reserved for full-blown Sql Reporting Services).
  
  
This works well for one-click report generation when the actual viewing of the report isn't important (because then you'd use the actual ReportViewer in your UI instead of manipulating it behind the scenes). 
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment30</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment30</guid><pubDate>Tue, 15 Sep 2009 23:47:20 GMT</pubDate></item><item><title>Shawn Wheatley commented on Challenge: NH Prof Exporting Reports</title><description>@Ayende: if that's the case, I'd recommend going with "plain" HTML instead. We use Red Gate Software's SQL Compare tool, which if you're not familiar with it, can output a single HTML report that contains a comparison of two different schemas. We regularly send these files to our DBAs and they really like the layout.
  
  
Going this route, it would be easy to create a single HTML file that contains JavaScript for client side filtering (if desired), print style sheets (no where near as good as PDF, especially in IE), client side or server side syntax highlighting, and other features I can't think of right now :)  Maybe a button to copy the raw SQL text to the clipboard next to each query? You could even embed IE inside NHProf to preview the report, without having to worry that the user doesn't have a PDF viewer for some reason.
  
  
This could all be achieved via XSLT or a templating framework (NVelocity maybe, as @Job Samuel mentioned).  Would you be interested in something like this instead of a PDF solution?
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment29</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment29</guid><pubDate>Tue, 15 Sep 2009 23:28:25 GMT</pubDate></item><item><title>Tobin commented on Challenge: NH Prof Exporting Reports</title><description>@Andrea: True, and could just use a textbox, or an image in a generic rdlc and pipe through the query (or as an image) into the generic report and do a dump to PDF from the backend without hte UI.
  
  
Saves any licensing issues - just would include a bit of bloat in requiring the extra library/install if required, especially since the whole control isn't necessary, but quicker to dev against, and stable.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment28</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment28</guid><pubDate>Tue, 15 Sep 2009 23:15:38 GMT</pubDate></item><item><title>Andrea Balducci commented on Challenge: NH Prof Exporting Reports</title><description>@Tobin: The report viewer control can be used without UI at all. I'm using the MS .rdlc engine to generate pdf reports with WCF services. I'ts quite easy.
  
  
@Ayende: why not just expose a data dump and let us dev to write our own visualization plugin ? ;D
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment27</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment27</guid><pubDate>Tue, 15 Sep 2009 21:20:55 GMT</pubDate></item><item><title>Tobin commented on Challenge: NH Prof Exporting Reports</title><description>As a couple of others have suggested, doing it in Reporting Services is very, very easy.
  
  
You can do it from within the project, against the objects/collections themselves, and once you have the reports there, the controller comes with options to export to Excel (xls), Word (doc), xml, pdf, etc.
  
  
For WPF at the moment you'd have to host the controller in a winforms control, but that code is easy to do and I have a sample I could send through.  This is going to be updated I believe in a future version and there is already a Silverlight compatible controller in Codeplex, I believe.
  
  
All in all, it gives you several options for output, can be adjusted really easy and is very familiar to people running MS solutions.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment26</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment26</guid><pubDate>Tue, 15 Sep 2009 20:53:36 GMT</pubDate></item><item><title>Ayende Rahien commented on Challenge: NH Prof Exporting Reports</title><description>Shawn,
  
If you want to do analysis, you can use the profiler itself to do the slicing &amp; dicing.
  
The problem that I am trying to solve is "email queries to DBA so he can optimize them"
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment25</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment25</guid><pubDate>Tue, 15 Sep 2009 20:50:06 GMT</pubDate></item><item><title>Shawn Wheatley commented on Challenge: NH Prof Exporting Reports</title><description>Agree with @Anaimi, maybe your report example is over-simplified, but it doesn't seem useful to me. PDF? For a list of SQL statements?
  
  
I also agree with @zihotki that for this report to be at all useful for a moderately sized application, you would need to offer the ability to drill down into the data, at which point you may want to look at a dedicated reporting component.
  
  
That said, I'd be happy to whip up some code for a free NHProf license  :)
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment24</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment24</guid><pubDate>Tue, 15 Sep 2009 20:45:30 GMT</pubDate></item><item><title>Mr_Simple commented on Challenge: NH Prof Exporting Reports</title><description>Create an HTML report like SyncBackSE.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment23</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment23</guid><pubDate>Tue, 15 Sep 2009 18:46:32 GMT</pubDate></item><item><title>ANaimi commented on Challenge: NH Prof Exporting Reports</title><description>I don't see what you can do with a PDF. Who would want to read a PDF with queries and hit counts? People will probably generate reports to analyze and compare - not print (and to me a PDF is an excellent if your going to print and/or read something).
  
  
Why not:
  
 - HTML (for a friendly quick display)
  
 - CSV file (or OpenXML Spreadsheet) for analysis, once you get this into Excel the sky is the limit
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment22</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment22</guid><pubDate>Tue, 15 Sep 2009 16:51:42 GMT</pubDate></item><item><title>Dan commented on Challenge: NH Prof Exporting Reports</title><description>hm... people wants NHprof... many wants it.. :)
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment21</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment21</guid><pubDate>Tue, 15 Sep 2009 15:25:56 GMT</pubDate></item><item><title>Chris Martin commented on Challenge: NH Prof Exporting Reports</title><description>Since you already have your XML defined, I would write a simple XSLT to transform it into iTextSharp specific XML and run it through the iTextSharp library.
  
  
Simple, done.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment20</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment20</guid><pubDate>Tue, 15 Sep 2009 15:21:00 GMT</pubDate></item><item><title>liviu commented on Challenge: NH Prof Exporting Reports</title><description>If i were you i would do exactly how office does it:
  
  
a free reportviewier that is native code and knows how to display the  data
  
Save the data in raw form.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment19</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment19</guid><pubDate>Tue, 15 Sep 2009 15:19:19 GMT</pubDate></item><item><title>Rob commented on Challenge: NH Prof Exporting Reports</title><description>.NET 3.0 has native support for XPS.  So we could define a printable report view in xaml and simply convert that to XPS.  Or, we could define our reports in xaml and then use WPF's print features (which can print any visual) and let user decide if they want to print to pdf, xps or paper.  
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment18</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment18</guid><pubDate>Tue, 15 Sep 2009 14:42:57 GMT</pubDate></item><item><title>Magesh commented on Challenge: NH Prof Exporting Reports</title><description>using iTextSharp (
[http://itextsharp.sourceforge.net/index.html](http://itextsharp.sourceforge.net/index.html)):
  
  
using iTextSharp.text;
  
using iTextSharp.text.pdf;
  
  
 Document doc = new Document();
  
            string ns = "
[http://nhprof.com/reports/2009/09](http://nhprof.com/reports/2009/09)";
  
            PdfWriter.GetInstance(doc, new FileStream("Report01.pdf", FileMode.Create ));
  
            doc.Open();
  
            Table table = new Table(3);
  
            table.AddCell(new Cell("Query Count"));
  
            table.AddCell(new Cell("Avg. Duration"));
  
            table.AddCell(new Cell("Short SQL"));
  
            XDocument.Load(@"ReportExports\unique-queries.xml")
  
                .Descendants(XName.Get("query", ns))
  
                .ToList()
  
                .ForEach(d =&gt;
  
                {
  
                    table.AddCell(new Cell(d.Attributes().Where(a =&gt; a.Name == "count").First().Value));
  
                    table.AddCell(new Cell(d.Elements().Where(z =&gt; z.Name == XName.Get("duration", ns)).First().Attributes("database-only").First().Value));
  
                    table.AddCell(new Cell(d.Elements().Where(z =&gt; z.Name == XName.Get("short-sql", ns)).First().Value));
  
                });
  
            doc.Add(table); 
  
            doc.Close();
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment17</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment17</guid><pubDate>Tue, 15 Sep 2009 14:02:40 GMT</pubDate></item><item><title>Frank Quednau commented on Challenge: NH Prof Exporting Reports</title><description>+1 on xps...there is a clean connection from WPF to XPS. Take a piece of XAML, feed it the data you want to show and render the stuff to XPS. "Feel Lucky" with "render WPF to XPS" and you get the code snippet.
  
Agreed, XPS is probably a joke, but it's there...using WPF to express reports is certainly possible.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment16</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment16</guid><pubDate>Tue, 15 Sep 2009 13:44:10 GMT</pubDate></item><item><title>alwin commented on Challenge: NH Prof Exporting Reports</title><description>Maybe using Spark and iTextSharp will work: 
[whereslou.com/.../returning-pdfs-from-an-aspnet...](http://whereslou.com/2009/04/12/returning-pdfs-from-an-aspnet-mvc-action)  
  
The free licence sounds good, too bad I don't have any experience with Spark or iTextSharp. Or free time for that matter...
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment15</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment15</guid><pubDate>Tue, 15 Sep 2009 13:37:58 GMT</pubDate></item><item><title>Johannes Rudolph commented on Challenge: NH Prof Exporting Reports</title><description>I can offer you experience with combit Lis&amp;Label (also used by SAP).
  
  
[www.combit.net/.../report-generator-List-Label](http://www.combit.net/en/reporting-tool/report-generator-List-Label)  
  
I am also maintaining a google code project called modelshredder, that enables easy integration with it.
  
  
[http://code.google.com/p/modelshredder/](http://code.google.com/p/modelshredder/)  
  
Together this combo can do pretty much everything you can imagine. PDF and nearly every important report format is a breaze, charts etc. too. I'd be glad to provide a demo for you.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment14</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment14</guid><pubDate>Tue, 15 Sep 2009 13:34:41 GMT</pubDate></item><item><title>Jeremy commented on Challenge: NH Prof Exporting Reports</title><description>We have used stand alone reporting services reports to generate nicely formatted PDF output from database input. The report itself works off of a dataset that you can set in code, so you can use whatever method to populate the dataset you want. The code to load the rdlc file, marry it to a dataset, then export to PDF is pretty straightforward. The key here is that you don't need to whole reporting services setup, but to use it in its standalone form.
</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment13</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment13</guid><pubDate>Tue, 15 Sep 2009 13:24:26 GMT</pubDate></item><item><title>Dan commented on Challenge: NH Prof Exporting Reports</title><description>apply xslt then use this html to pdf ( 
[http://www.html-to-pdf.net/Features.aspx](http://www.html-to-pdf.net/Features.aspx) ). (and I'm not working for them)
  
  
we're using this product like this:
  
list
&lt;items -&gt; serialize -&gt; xml -&gt; apply xslt -&gt; html -&gt; pdf
&gt;</description><link>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment12</link><guid>http://ayende.com/4197/challenge-nh-prof-exporting-reports#comment12</guid><pubDate>Tue, 15 Sep 2009 13:14:03 GMT</pubDate></item></channel></rss>