PDF from MVC Razor - with heading
Today I was tasked with creating a PDF from a report that had two queries - a header section and detail section. After looking at all the viable options I was tempted by iTextSharp but was faced with the challenge of implementing it in razor. I then came across this nifty dll written specifically for that purpose and it utilizes iTextSharp to do it. RazorPDF was the answer. Al Nyveldt did an excellent job with it and includes a github download with great samples. The one challenge he didn't cover was my example of two queries to make a more comprehensive report. As shown in the example (screenshot of my pdf generated using this tool) I have header information as well as additional data laid out in a table. To accomplish this I created a ViewModel in my Data project with a simple class that incorporated two references. One to the header data and one to the Zipcode detail. public class Fran_Zip_ViewModel { ...