ASP.Net, XSL-FO: nFOP web hosting

·

I have been using XSL-FO a lot in my web applications. It allows me to generate dynamic PDF documents for my reporting system or whatever printable output I would like to generate. Something that is not so simple in web applications most especially in ASP.Net.

 

I could design the document layout or template using XSL (with FO markup of course), output data as XML, do XML transformation, run it on a rendering engine and voila! You have a dynamically generated PDF document.

 

In ASP.Net, there are available commercial XSL-FO rendering engines. But the one that is free is nFOp.  This is a .Net port from the Apache XML Project's FOP Java source. It is written in J#. And that’s where the trouble lies if you are planning to host your web application through a web hosting accounting.  It requires the Microsoft Visual J#® 2.0 Redistributable Package to be installed on the server and most web hosts do not support J# and would not install redistributable packages either.  I’ve already asked two (Mochahost and WebHost4Life) and gave up the effort of inquiring after getting a no from the both of them.

 

Not wanting to give up on nFOp altogether, I uninstalled the Redistributable Package on my development PC and ran my application. It would complain of course but everytime it looks for a certain .dll, I would locate it on my other PC and put it on my application’s Bin folder. And success!  It ran after copying just 3 files:

 

Vjscor.dll

Vjslib.dll

Vjsnativ.dll

 

You can find these files on the .Net framework folder of the PC where you installed the redistributable package. Usually on C:\Windows\Microsoft.NET\Framework\v2.0.50727.

 

Now comes the testing if it will work…

 

In my WebHost4Life account it worked. Great! Now how about Mochahost? Bummer. It didn’t. It won’t allow me to use the DLLs.  I would have loved to make it work there because hosting is cheap and allows me to setup 1000s of websites and SQL Server databases under 1 account.

 

So right now what I do is, setup my web applications in my Mochahost account and use my WebHost4Life account as my “Print Server”.  A bit more expensive having have to maintain 2 hosting accounts but definitely cheaper that the alternatives.

 


Update (11 Nov. 2008) - Mochahost had to move me to a different server a few days ago and guess what? Visual J# dependencies now work and I can run nFOP on my websites now.

2 comments:

Anonymous said...
November 4, 2008 at 9:12 PM  

nice one thanks

Anonymous said...
November 13, 2008 at 8:01 AM  

where are you from?

Recent Posts

About Me

Alain Rivas
A software / web developer by profession.
A Born-Again Christian by Faith.
A father of two (with one on the way).
A husband of one.
Once a radio disc jockey for eight years.
Now a geek glued to his computer.
View my complete profile