+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

PreviewFile.ConvertTo exportTarget parameter values


(Glenn Doten) #1

Can you tell me what the valid values for the PreviewFile.ConvertTo’s exportTarget parameter are?

We are LL19 right now, but switching to LL20 soon.

In the code example here:

https://www.combit.net/en/reporting-tool/support/list-label-knowledge-base/kb/preview/converting-preview-files-to-other-formats/

It is passing in “PDF”, but I cannot find a valid list of values that can go here. Also, the example in the manual-report-generator-List-Label.pdf document doesn’t even specify this parameter. If the parameter is left off, does the ConvertTo method infer the export target from the extension in the specified filename? If so, is there a list of expected extensions that this inferring works with?

Lastly, we create a preview file using the ListLabel.Export method and are now trying to convert that preview file to a user-selected export target (PDF, Word, etc.) So we fire up a PreviewFile and are trying to then use the ConvertTo (hence the questions above). I’m not sure if the Print method must first be called before ConvertTo is called; does Print need to be called first?

Thank you!


(combit Support - Patrick Preuschoff) #2

Dear Glenn,

thank you for your post.

Can you tell me what the valid values for the PreviewFile.ConvertTo’s exportTarget parameter are?
<<

.NET / C# Example
PreviewFile pf = new PreviewFile(@“C:\preview.ll”);
pf.ConvertTo(@“C:\preview.pdf”,“PDF;Export.IssueIndexRange.Min=2”);
pf.Close();
pf.Dispose();

You can use the following target formats:
Preview - LL / PRV
PDF - PDF
TIFF - PICTURE_MULTITIFF
Text Layout Format - TTY
Metafile - EMF
JPEG - PICTURE_JPEG
PNG - PICTURE_PNG
XPS Document Format - XPS

Lastly, we create a preview file using the ListLabel.Export method and are now trying to convert that preview file to a user-selected export target (PDF, Word, etc.) So we fire up a PreviewFile and are trying to then use the ConvertTo (hence the questions above). I’m not sure if the Print method must first be called before ConvertTo is called; does Print need to be called first?
<<

Either you call the Print() method first or you use the Export() method. It is necessary to generate a preview file (*.ll) before converting it to a specific format with the ConvertTo() method. Otherwise you can just use the Export() method by itself with an export configuration depending on your needs to directly generate an export file in various formats.

.NET / C# Example:

ExportConfiguration exportConfiguration = new ExportConfiguration(_exporterTarget, fileNameTb.Text, “simple.lst”);
LL.Export(exportConfiguration);

Best regards,

Patrick Preuschoff
Technical Support
combit GmbH


(Glenn Doten) #3

Thank you very much, Patrick. That’s very useful information.

Couple more questions! In your example the exportTarget parameter appears to have more than just the type of file to be generated. Are the available variables that may be added documented anywhere?

More important is it looks like the ListLabel.Export method gives us many more output formats than the PreviewFile.ConvertTo method does (from looking at the list you have provided).

The ExportConfiguration that is passed to the ListLabel.Export method takes an LlExportTaget value, which has a lot more output options. We have this conversion from our own export enum to LL’s export export:

switch (exportFormat)
{
	case ReportExportFormat.Bitmap: return LlExportTarget.Bitmap;
	case ReportExportFormat.DOCX: return LlExportTarget.Docx;
	case ReportExportFormat.HTML: return LlExportTarget.Html;
	case ReportExportFormat.JPEG: return LlExportTarget.Jpeg;
	case ReportExportFormat.MHTML: return LlExportTarget.Mhtml;
	case ReportExportFormat.PDF: return LlExportTarget.Pdf;
	case ReportExportFormat.PNG: return LlExportTarget.Png;
	case ReportExportFormat.Preview: return LlExportTarget.Preview;
	case ReportExportFormat.RTF: return LlExportTarget.Rtf;
	case ReportExportFormat.XLSX: return LlExportTarget.Xlsx;
	case ReportExportFormat.XML: return LlExportTarget.Xml;
	case ReportExportFormat.XPS: return LlExportTarget.Xps;
	default:
		throw new ReportException(string.Format(
			"Unknown report export format “{0}”.",
			exportFormat));

	//return LlExportTarget.Jqm;
	//return LlExportTarget.MetaFile;
	//return LlExportTarget.MultiTiff;
	//return LlExportTarget.Text;
	//return LlExportTarget.TextLayout;
	//return LlExportTarget.Tiff;
	//return LlExportTarget.Tty;
	//return LlExportTarget.Xls;
}

Then we use this LlExportTarget as input to the ExportConfiguration. In our test page, we are are able to directly export to all of these formats (the ones that are not commented-out).

Will we still be able to take our preview (.ll) file, pass it into ListLabel.Export, and be able to get all of these formats, or are we limited to the 8 formats you’ve listed? We are most concerned about being able to convert an .ll file to .docx and .xlsx, which is not in your list (but is in the LlExportTarget enum and works with the Export method).

Thanks!


(Glenn Doten) #4

We could really use some help with this question. Thanks!


(combit Support - Patrick Preuschoff) #5

Hello Glenn,

thank you for your post.

In general you will find all possible values documented in the Programmer’s Reference and additonally in the List & Label .NET Online Help ("…\combit\LL20\Documentation\combit.ListLabel20.chm"). Please have a look at these sources and just search for the method or property you want any more option to be displayed.

Unfortunately the conversion from an .ll file does not support as many possible export formats in comparison to the Export() method itself. This is due some lack of information which can not be stored within the preview file. This also includes the conversion of a preview file to an Word or Excel export result.

Concerning the current situation we recommend to switch to the Export() method to be able to export to Word and Excel files instead of using the preview file conversion.

Best regards,

Patrick Preuschoff
Technical Support
combit GmbH


(Glenn Doten) #6

Somehow I missed that .chm file and do see that it has the information I was looking at. Thanks for the pointer!

And thanks for the information about the Export method. We’ll probably have to modify our architecture a little bit, but at least we know what we can expect from the Export method.

Thanks again!