The C1Reports provide support for creating localized versions of all end-user visible strings for different cultures at design time and switch between languages at run time. To localize Reports for WinForms components in your application, refer to Report Documentation. However, this localize dialog does not provide options to localize the ExportOptions when the print document is exported. This blog discusses the approach to localize the ExportOptions Dialogs used in C1Print Preview Control exporting. You can use the similar approach if you want to customize these dialogs.
The C1PrintPreview controls provides exporting of C1PrintDocument in different formats. The ExportOptionsDialog classes are available in C1.C1Preview.Export namespace. Following table gives the class name of the ExportOptions dialog used :
Export Format
ExportOptions Dialog ClassName
C1D, C1DB, C1DX
C1DOptionsForm
Docx
DocxOptionsForm
Emf
EmfOptionsForm
Html
HtmlOptionsForm
PdfOptionsForm
Rtf
RtfOptionsForm
Xls
XlsOptionsForm
Xlsx
XlsxOptionsForm
Jpg, Png, Bmp, Tiff
ImagesOptionsForm
In this blog, we will explain the SaveOptions (PDF) form to French (France). Following steps are used to localize the dialog :
Open the code for CustomPdfForm and modify CustomPdfForm class to derive from C1.C1Preview.Export.PdfOptionsForm than "Form" as follows:
public partial class CustomPdfForm : C1.C1Preview.Export.PdfOptionsForm
In Design mode set Localizable property of CustomPdfForm as true and set Language property to French (France).
Thread.CurrentThread.CurrentUICulture= new System.Globalization.CultureInfo("fr-FR");
P.S. : Here argument provided to CultureInfo is specific to French(France) Language. Please change if it has to be set for a different languageIn your main form where you are using the C1PrintPreviewControl, write the following code :
ExporterOptions eo = c1PrintPreviewControl1.PreviewPane.ExportOptions[typeof(C1.C1Preview.Export.PdfExportProvider)];
eo.OptionsDialogClassName = "Sample_LocalizePrnPreview.CustomPdfForm";
Run the application.
You may use the same approach to customize these dialogs also. Download the attached sample for detailed implementation. Download Sample