Pizzor2000 Posted June 1, 2006 Posted June 1, 2006 I have an ASP.Net 1 application, which includes database-driven electronic paperwork. The paperwork is entered into the system within this site, and users can view and print the notes online. Right now, the printable reports are simply ASP.Net forms--the background code queries the database for the form, and echoes the results onto ASP Labels. Being HTML-based reports, however, they do not always look good when printed--it's hard to get the page breaks correct, different users have different browsers, font settings, etc., and some forms have more lines of data entered in some text fields. As a result, some of the forms have the last few lines of data on top of an otherwise blank page. What are some options for generating a clean printout from an ASP.Net application, such as writing out to a PDF template? Quote
Arch4ngel Posted June 2, 2006 Posted June 2, 2006 (edited) I normally take a look toward Crystal Decision which is included in some version of Visual Studio 2003. Otherwise, you could look toward generating PDF report. Those, once generated, will ALWAYS be printer friendly. Edited June 2, 2006 by Arch4ngel Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Pizzor2000 Posted June 2, 2006 Author Posted June 2, 2006 I normally take a look toward Crystal Decision which is included in some version of Visual Studio 2003. Otherwise, you could look toward generating PDF report. Those, once generated, will ALWAYS be printer friendly. Do you have any suggestions for a solution to generate PDFs? Do you have any sample source code for either of these methods? Quote
Arch4ngel Posted June 2, 2006 Posted June 2, 2006 Basically, PDF are just text with commands and everything but it's kinda hard to put togheter and generate one like that (really complicated specifications). What we use here is a PDF Printer. Once it's printed, we can share it to everyone. I know there is also many differents tool to do the job. But here we use this PDF printer or the Crystal Decision coming with our version of VS2003. Sadly, I don't have any code under hand to help you out. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Pizzor2000 Posted June 2, 2006 Author Posted June 2, 2006 My colleague and I did search for some .Net examples for writing out to PDF. We found some examples which write out basic text and tables to a blank PDF, but we need a way to use a template for the form and write the results onto the appropriate place. I assume Crystal Decision could spit out data onto a pre-built report. I am familiar with Crystal Reports, just not Decision. Quote
Arch4ngel Posted June 2, 2006 Posted June 2, 2006 It's basically the same thing but with some strip out features. You might look online how to make reports out of it. Really nice and easy. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Administrators PlausiblyDamp Posted June 2, 2006 Administrators Posted June 2, 2006 If you are using SQL as a database you might want to evaluate Sql Reporting Services Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
bri189a Posted June 8, 2006 Posted June 8, 2006 As an alternative, CSS allow you to specify where page breaks occur, width of 'boxes' of data, etc. You can of coarse specify this stuff for 'print' only rather that screen. If you don't want to spend a small fortune on a package such as SRS or Crystal, spend $20 on a good CSS book (such as DHMTL and CSS for WWW), and use CSS to do all your printing. Don't by a Ferrari if all you need is a Toyota. Quote
Administrators PlausiblyDamp Posted June 8, 2006 Administrators Posted June 8, 2006 Or if you are on a budget look at XSLT as a way of formatting the output. XSL-FO is a common mid-ground that you can then get various tools to transform into PDF (amongst many other formats). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
bri189a Posted June 8, 2006 Posted June 8, 2006 Ah yes...always for get that XSLT isn't just for data... :) Quote
Administrators PlausiblyDamp Posted June 8, 2006 Administrators Posted June 8, 2006 It's also for headaches... ;) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.