on 08-22-2014 5:13 PM
Hello.
According to my tests whenever I export a report document to a text file (ExportFormatType = ExportFormatType.Text), Crystal engine produces UTF-8 file (BOM is EF BB BF). The question is - is there any way to explicitly specify output file encoding (ANSI / UTF-8 / UTF-16)? I am using <SAP Crystal Reports, version for Microsoft Visual Studio> 13.0.10.1385 (i.e. Support Pack 10). C# code example is following:
{
TextFormatOptions formatOptions = CrystalDecisions.Shared.ExportOptions.CreateTextFormatOptions();
formatOptions.CharactersPerInch = 10;
formatOptions.LinesPerPage = 60;
DiskFileDestinationOptions destOptions = CrystalDecisions.Shared.ExportOptions.CreateDiskFileDestinationOptions();
destOptions.DiskFileName = @"c:\test.txt";
CrystalDecisions.Shared.ExportOptions crystalExportOptions = new CrystalDecisions.Shared.ExportOptions
{
ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Text,
ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile,
ExportFormatOptions = formatOptions,
ExportDestinationOptions = destOptions
};
CrystalDecisions.CrystalReports.Engine.ReportDocument crystalDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
crystalDocument.Load(@"c:\test.rpt");
crystalDocument.Export(crystalExportOptions);
}
Thanks in advance,
Gleb.
Hi Gleb,
Crystal does not have the ability to select the type of encoding when exporting any file types. You will need to use a third party API set to do the encoding outside of Crystal to convert the type.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.