We are using CRforVS 64bits 13.0.20 on .Net 4.5 all is working fine, but when we try to expor to pdf we find:
Method not found: 'Void CrystalDecisions.ReportAppServer.ReportDefModel.PDfExportFormatOptionsClass.set_CurrentPage(Int32)'.
It also happens to if we try to export to any other format. All is fine when print the report on a pdf printer.We believe that we have tried all possibilities but still it`s the only thing that we do not know how to put to work in all our Project.
Best Regards,
Request clarification before answering.
This might be due to user permissions on a font used by the report.
So create a dummy report with just one object with standard font and see if that report fails.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI CR for VS does not get patched, full release only.
You could try upgrading to SP 26:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
if (ExportTypeSelected == "crReportExportFormatPDF")
#region PDF
{
// This works do not alter
// this gets the report name and sets the export name to be the same less the extension
string outputFileName = "";
string MyRptName = rpt.FileName.ToString();
outputFileName = MyRptName.Substring(9, rpt.FileName.Length - 9);
outputFileName = outputFileName.Substring(0, (outputFileName.Length - 3)) + "pdf";
try
{
if (File.Exists(outputFileName))
{
File.Delete(outputFileName);
}
CrystalDecisions.ReportAppServer.ReportDefModel.PDFExportFormatOptions RasPDFExpOpts = new PDFExportFormatOptions();
try
{
RasPDFExpOpts = rptClientDoc.get_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatPDF);
}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
//return;
}
// Set them now:
//RasPDFExpOpts.CreateBookmarksFromGroupTree = false;
//RasPDFExpOpts.EndPageNumber = 1;
//RasPDFExpOpts.StartPageNumber = 1;
// Save the udpated info
if (RasPDFExpOpts != null )
rptClientDoc.set_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatPDF, RasPDFExpOpts);
CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions exportOpts1 = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();
exportOpts1.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatPDF;
exportOpts1.FormatOptions = RasPDFExpOpts;
// And Export
rptClientDoc.PrintOutputController.ExportEx(exportOpts1).Save(outputFileName, true);
MessageBox.Show("Export to PDF Completed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
btnSQLStatement.Text = "ERROR: " + ex.Message;
return;
}
//// change selection formula and export again
//rpt.RecordSelectionFormula = "{Customer.Customer Credit ID} >= 11";
//rpt.Refresh();
//outputFileName = outputFileName.Substring(0, (outputFileName.Length - 3)) + "1.pdf";
//try
//{
// if (File.Exists(outputFileName))
// {
// File.Delete(outputFileName);
// }
// CrystalDecisions.ReportAppServer.ReportDefModel.PDFExportFormatOptions RasPDFExpOpts = new PDFExportFormatOptions();
// try
// {
// RasPDFExpOpts = rptClientDoc.get_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatPDF);
// }
// catch (Exception ex)
// {
// btnSQLStatement.Text = "ERROR: " + ex.Message;
// //return;
// }
// // Set them now:
// //RasPDFExpOpts.CreateBookmarksFromGroupTree = false;
// //RasPDFExpOpts.EndPageNumber = 1;
// //RasPDFExpOpts.StartPageNumber = 1;
// // Save the udpated info
// if (RasPDFExpOpts != null)
// rptClientDoc.set_SavedExportOptions(CrReportExportFormatEnum.crReportExportFormatPDF, RasPDFExpOpts);
// CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions exportOpts1 = new CrystalDecisions.ReportAppServer.ReportDefModel.ExportOptions();
// exportOpts1.ExportFormatType = CrReportExportFormatEnum.crReportExportFormatPDF;
// exportOpts1.FormatOptions = RasPDFExpOpts;
// // And Export
// rptClientDoc.PrintOutputController.ExportEx(exportOpts1).Save(outputFileName, true);
// MessageBox.Show("Export to PDF Completed 2nd time", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
//}
//catch (Exception ex)
//{
// btnSQLStatement.Text = "ERROR: " + ex.Message;
// return;
//}
// This works do not alter
}
#endregion PDF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you search terms such as Crystal Reports PDF Export Calibri you'll find discussions of that issue. Easiest solution is to use a different font. But there are other ways around the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, sorry for the delay to write again. At end we upgrading like Don said and now it´s working fine. Thanks too much for help and attention. One thing more, by the way, sometimes in some computers when we export to pdf all looks right but reading the document you can find some words like department writing as departtmentt, is like some character are writen twice, or too in some moments it doesn't keep spaces between words and looks like words on words.
Example: written: ttulació,n según los siguientes dato:s must be: titulación según los siguientes datos
Best regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for answers. We check today that Adobe Acrobat Reader is working right and it is the software associated to pdf files.
We Will check with the solutions givens and we Will write with the results.
Thanks a lot again for your attention, time and answers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try hard coding the name file with a full path and no parameters, export the whole report.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We develop a simple desk application based on Microsoft Visual Studio 2015 Pro. It just manage a database of students. Our problems come out when we try to export to pdf. The line that crash is
rptCopypeCab.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, namefile)
We take always this error but the rest works fine, we can print to pdf for example without any problema. By other way, we don´t see the way to incorpórate your code to our to prove.
Thanks a lot for your answer and attention,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Explain what you mean by system we have this problem?
Are you saying it works sometimes?
If so usually means Adobe Reader is not installed or the Adobe reader plugin in your browser may be broken/not installed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks so much for your kind and fast answer. We will incorporate your code and try with the system in which we have this problem. We will write again with the results Thanks again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.