In LL20, we took the first steps towards enabling this feature. However, the solution presented then didn’t work for a detached preview, i.e. it required an active database connection and wasn’t enabled in the stand alone viewer. We still heard the request to enable exporting to all of the formats from the preview loud and clear.
In LL24, we’ll come up with a solution to this request. While it’s still not possible to convert the EMF to any of the other supported export formats we’re using a multi pass approach to embed the required export results writing to the preview.
From the coding side, embedding export formats is easy:
This will then trigger a five pass printing process (preview and four export formats) and embed the required export formats into the preview file. In order to keep the preview file at a reasonable size we make sure to compress the embedded formats in the file. Due to the nature of this feature there are some restrictions: you cannot change any export options after printing, i.e. the standalone viewer doesn’t support to change these options. Also, in order to be able to support this feature, List & Label needs your application to support the drill down event. This of course automatically works for our data binding implementations but might require a bit of work on your end if you’re using your own code to feed the data to List & Label.
For the end user, the process is quite straightforward: simply click on the export icon in the ribbon and choose from one of the embedded formats:
One of the most useful applications of this feature is embedding the raw data for the report as a data-only Excel sheet for further post-processing. This is a typical best-of-both-worlds approach. To do so, the required code would simply be:
LL.ExportOptions.Add(LlExportOption.ExportOnlyTableData, "1"); LL.Core.LlSetOptionString(LlOptionString.EmbeddedExportFormats, "XLS");
This enables you to have both a nicely formatted report …
… and the underlying raw data at hand:
The conversion API also supports this feature. So instead of interactively extracting the embedded Excel data as shown above you can also do this by code:
PreviewFile pf = new PreviewFile(@"c:\Reports\Preview.ll"); pf.ConvertTo(@"c:\Data\data.xlsx"); pf.Close();
Your end users will definitely love this new feature. We’re currently supporting XLS, DOCX, MHTML and XHTML as emdedded formats. Feel free to drop a comment if you’d require additional formats