Below is the code I need rewrote to C#. I'm writing a C# application in Visual Studio 2005. I need a code for a button where it exports a Crystal Report to PDF. I just can't find the code in C#, so I figured someone could help write this Visual Basic cod in C#. Any help would be greatly appreciated!!! Thanks
CrDiskFileDestinationOptions = New DiskFileDestinationOptions()
CrDiskFileDestinationOptions.DiskFileName = “C:\exported.pdf”
CrExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
CrReportDocument.Export()
MessageBox.Show (“Report Exported”)
Copyright © 2024 QUIZLS.COM - All rights reserved.
Answers & Comments
Verified answer
CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
CrDiskFileDestinationOptions.DiskFileName = "C:\\exported.pdf";
CrExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrReportDocument.Export();
MessageBox.Show("Report Exported");
you have to highlight over the ...'s that show up to see the finishing of certain lines. good luck!
CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
CrDiskFileDestinationOptions.d.. = "C:\exported.pdf";
crExportOptions. DestinationOptions = crDiskFileDestinationOptions ;
crExportOptions .ExportDestinationType = ExportDestinationType .DiskFile ;
crExportOptions. ExportFormatType = ExportFormatType .PortableDocFo.. ;
CrReportDocument. Export();
MessageBox .Show (“Report Exported”);
hope that helps.
you ought to construct the C progrm as a standalone software, then from VB fork yet another proces to run it, marshall the parameters it desires the two on the command line or stdin, then study its output. or you ought to construct the C area as a library and link it on your VB software and get in touch with applications in it straight away (uncertain if microsoft's compiler device can try this; I gave up toy languages like VB an prolonged time in the past, yet .internet can likely do it)