Home » Programming » Reports
Category Archives: Reports
Generate a PDF from an ASP.NET Web Page using the iTextSharp XMLWorker Namespace
If you need to quickly and easily generate PDF documents from ASP.NET, then the iTextSharp library is very convenient. To install and start using iTextSharp, you can download the zipped reference files from their Web site and then add them to your Visual Studio project the same way as you would do with any other third party library file.
The latest version of iTextSharp has deprecated their old HTMLWorker object in favor of the newer XMLWorkerHelper object. This is good news for any developer that likes to use CSS formatting since the older object did not support this. Likewise, the new object allows a number of important behaviors such as PDF page breaks that were impossible to do using the older object.
To make use of the XMLWorkerHelper object you will need to reference two DLL files in your Visual Studio project. These are:
- itextsharp.dll
- itextsharp.xmlworker.dll
Once you have referenced these two libraries you are ready to start coding.
(more…)
Crystal Reports Generating SQL Server Error 18456 Severity 8 Error Logs
Crystal Reports XI R2 and Crystal Reports 9 incorrectly generate non-critical connection error logs when set to run reports from SQL Server 2008.
Specifically, when Crystal Reports is connected to a SQL Server 2008 database it will serve the report correctly, but invisibly it will also generate an error log in SQL Server.
Although insignificant for just one report, this clutters up the error logs for no reason when there are several hundred Crystal Reports all doing the same thing.
Background:
As part of modernizing our company database infrastructure we updated our database server from SQL Server 2000 to SQL Server 2008.
UDL Files: How to Create and Configure Universal Data Link Files
UDL files can be incredibly useful for a variety of reasons (please see my earlier post for details). In this article I will explain the steps for creating and configuring a UDL file.
Creating a UDL file is quite straightforward. Here are the steps:
- First create a new text document in Windows Explorer and give a name to your new file, making sure you set the extension to .udl (or you can open notepad and save it using .udl extension). Either way, make sure nothing is entered in the notepad document.
- Once you have created your new .udl file, the icon for your file should change from the icon for a text document to a special icon specific to .udl files
- Now double click your new .udl file in order to open it. (more…)
UDL Files: Centralizing your DataSource Connections – Overview
I have not had much use for UDL (Universal Data Link) files in the past, but recently I found out just how useful they can be. Today I encountered an issue with Crystal Reports 9 calling SQL Server with a blank password when the connection was set within Crystal Reports. After much research and testing I found that the only way to correct this was to force Crystal Reports to use a UDL file to obtain its connection information.
For anyone not sure exactly what a UDL file is, it is basically a file that one can create and use to centralize database connection information. So it functions along the lines of an ODBC data source, or a little like an old .ini file… or for the web, like a web.config file. The only difference being that like an ODBC datasource, Windows will present a forms like view of the connection information in the UDL file when it is opened.





