Archive for '.NET framework' Category
OpenXml format, insert an image into a document
2 September 2008In previous post I showed how to open a docx file, search for a specific text, and replace the text with another string. The reason for doing this is simply to create a master report file in docx format, and let an application insert data in specific part of the document itself.
The next step is [...]
LINQ2XMl and namespaces
1 September 2008In Xml namespace are used extensively to distinguish between tag names, you can use namespaces directly with XElement class thanks to the XNamespace class, here is an example.
XNamespace ns = XNamespace.Get("http://www.nablasoft.com/mynamespace");
XElement element = new XElement(ns + "root",
[...]
OpenXml Office format, open and substitute text
29 August 2008Quite often, customers ask us to generate reports in word format, the main advantage of this approach is that people feels comfortable working with word, and they love the possibility to modify the report once generated. In the past years I used many techniques to reach this goal, but in the end, a lot of [...]
Use ICSharpCode.SharpZipLib to write directly to Response.OutputStream in a asp.net application
26 August 2008I have a web site where I need to dynamically create rtf reports. I decided to use Asp.NEt 3.5 routing, (maybe I’ll discuss another day) so I can redirect request like
http://localhost/Myapp/reports/reportwizard/14/Report.zip
to an handler that dynamically creates the zip file and stream it to the client browser. Here is the code
Dim service As New WebLogic.Report.ReportService
Dim [...]
LINQ, SingleOrDefault and NullObject
20 August 2008Suppose you have this simple class (has no business meaning is valid only as example)
public class MyObject
{
public static MyObject NullValue = new MyObject() { Value = -100, Name = String.Empty };
public Int32 Value { get; set; }
public String Name { get; set; }
[...]
>