views:

1095

answers:

9

Hi,

I am total noob with XSL and XSL-FO and I am looking for some advice on the possibilities and limitations with DotNet 2.0 and 3.5 when using XSL for formatting XML Data For reporting purposes.

Here is what I was looking to do.

1)Get data from a SQL 2005 DB based on some business rules

2) Output to xml from SQL directly or create xml files from some other custom middle tier component and save the files to disk.

3) Use a 3rd party library to create pdf's from the transformed files. <-- I Need suggestions on tool too please.

My concerns are around page breaks and keeping related content together when breaks occur. From what I can tell these two commands are for that: keep-with-previous and keep-with-next But those I believe are XSL-FO commands, please correct me if I am wrong. There is also this which appears to be in the base XSL commands. http://www.w3.org/TR/xsl/#keepbreak From what I have read IE and DotNet don't support XSL-FO is that still true? I also read some posts about adding an XSL Schema to Visual Studios schemas for intellisense, does anyone know of a current XSL-FO Schema for this purpose. So given what I would like to accomplish and my concerns what should I know about the limitations of XSL-FO in DotNet and IE.

+1  A: 

Have a look at Aspose PDF for generating PDFs from XSL-FO. It's not free however, but depending on your needs it might be worth the price.

Conrad
+1  A: 

.Net 2.0 and 3.5 do nothing except make the transformations from xml to xsl-fo. You still need to write the XSLT file and as far as I know there is no intellisense for xsl-fo under visual studio. I use http://www.alt-soft.com 's product to transform from xsl-fo to pdf. To write the xsl-fo I use Stylus Studio. You can also check out Altova's Stylvision. http://www.renderx.com/ also makes a similar product to alt-soft's. I also use the alt soft product to transform SVG from Dundas Charting to PDF.

EthR
+1  A: 

Yep EthR, there is no intellisense for XSL-FO but it can be added by adding the schema for XSL-FO to Visual Studio schemas http://msdn.microsoft.com/en-us/library/ms255821(VS.80).aspx . Does anyone know of a current schema for XSL-FO to use for this purpose? I found this one suggested to someone else in forum post on MSDN, I just have no idea how current it is: www.syntext.com/products/index.htm#Dtd2Xs

Does IE support XSL-FO Yet?

OutOFTouch
A: 

Thanks for the links to the xsd resources. I'd vote your reply up one but I don't have the points for it yet :)

xsl-fo is basically worthless unless you are going to then convert it to PDF or some other "readable" format so I doubt that IE or any browser for that matter would ever "support" xsl-fo. I suppose you could create a plugin that reacts to the mime type and then the browser/plug-in would convert the xsl-fo to pdf.

EthR
A: 

Ok I downloaded the syntext xsd and put it in the same directory that has my xsl, which generates xsl-fo, in it and its working using the Visual Studio editor. It only allows you to "intellisense" the proper tags in relation to where you are. Very helpful. In fact unless I am doing something wrong it is more useful than Sylus Studio, it doesnt limit you to only the valid tags.

EthR
A: 

Yep, I am considering creating pdf's from XSL-FO. We use Crystal XI and SQL 2005 reports now where I work we but have noticed strange exporting changes to reports when exporting to PDF from Crystal espcially. I just thought we might have better control over the report format to pdf by using XSL-FO, I guess that is another question. Maybe someone who has done this before will let me know if you do have more control. I know using XSL-FO to pdf to meet our business needs would be around 2-5 times more work then using the reporting tools we use now and I am lazy :) and would prefer not too go that route. I also came across NFOP J# based port of Apache FOP, haven't tried it though, to bad it is not in C#, I will still try it anyways.

OutOFTouch
+2  A: 

I have used XSL-FO a lot professionally, both from Java and .NET environments. It indeed gives you total control over the printed document/PDF. I myself have generated very complex PDF's ready for mass-printing(brochures and papers). They included complex structures like text floated in columns, graphs(using embedded SVG) and tables.

XSL-FO is for print what HTML is for the screen. Given that you learn to know it well, you will be able to produce anything with it, no matter how complex the design.

The Java based FOP is probably one of the best XSL-FO processors. And it's free, open-source too.

AltSoft's commercial .NET XML2PDF is good 2.

XSL-FO is definitely way to go when generating PDF's or printed documents.

EDIT: I only answered part of your question, i guess. XSL-FO is not natively supported within any common browser as of today. I don't think there any plans for implementing native support in IE, i'd be very surprised if it was. XSL-FO is just XML, so you won't need any further XSL-FO support by the .NET Framework then as of today. Typically, XSL-FO is generated using XSLT and then the transformation result is passed to a Formatting Objects processor, such as FOP. In some cases, XSLT (at least not 1.0) is not enough, if your XSL-FO document is very complex. You might then consider using XSLT extensions, written in languages such as C#. In some cases, maybe XSLT is not right for the job, you could then consider using code to generate XSL-FO.

baretta
A: 

Unofficial schema can be found as described here: http://xmlgraphics.apache.org/fop/fo.html#fo-validate

A: 

I am new to XML... and i am forced to look at XSL-FO. My simple question is that using XSL-fo, i am not going to do any pdf generation work.. rather I just want to check on XSL-fo with its basic tags. I am to work in dotnet environment in Visual Studio. So to go ahead with this do i need a seperate FO Processor or there will be enough support without it.??

Because every single page which i visited they tell, pdf generation and xsl-fo then install Fo processor.