SAP Knowledge Base Article - Preview

2527230 - Searching RPTR reports will only search the current page and generates and error

Symptom

In a simple Cortez app export a report to RPTR format:

private void ExportToRPTR_Click(object sender, EventArgs e)

{

CrystalDecisions.Shared.DiskFileDestinationOptions diskOpts = CrystalDecisions.Shared.ExportOptions.CreateDiskFileDestinationOptions(); CrystalDecisions.Shared.ExportOptions exportOpts = new CrystalDecisions.Shared.ExportOptions();

rptClientDoc = new ReportClientDocument(); exportOpts.ExportDestinationOptions = diskOpts; string outputFileName = "";

string MyRptName = rpt.FileName.ToString(); outputFileName = MyRptName.Substring(9, rpt.FileName.Length - 9);

outputFileName = outputFileName.Substring(0, (outputFileName.Length - 4)) + ".rptr";

try

{

if (File.Exists(outputFileName))

{ File.Delete(outputFileName);

}

try

{ diskOpts.DiskFileName = outputFileName; exportOpts.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile; exportOpts.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.RPTR;

rpt.Export(exportOpts);

MessageBox.Show("Export to RPTR Complete - Saved as " + outputFileName, "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);

rpt.ExportToDisk(ExportFormatType.RPTR, outputFileName);

}

catch (Exception ex)

{

btnSQLStatement.Text = "ERROR: " + ex.Message;

//return;

}

} catch (Exception ex)

{ btnSQLStatement.Text = "ERROR: " + ex.Message; //return;

}

}

Now open the saved report in a viewer and search on any text that is on multiple pages or any text that is not on the page.

An error is generated if the text is not found or the end of page has been reached


Read more...

Environment

Crystal Reports for Visual Studio

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio

Keywords

CR for VS, .NET, Invalid operation of Crystal reports- report (read-only RPTR). See release notes for more information. , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.