Link to home
Start Free TrialLog in
Avatar of NoraWil
NoraWilFlag for Belgium

asked on

Read contents of Crystal Reports text box in Visual Basic

Hi experts,

How can I read the contents of a Crystal Reports text box in my visual basic application. My application shows invoices in a Crystal Reports. The user can navigate throught the invoices using the arrows of the CrystalReportViewer.
One of the text boxes of the report shows the invoice number. I want to be able to automatically export invoices to PDF files named by the invoice number (i.e. 1.pdf, 2.pdf, etc.)
Exporting to PDF is not a problem, but I need to know how to read the contents of my Crystal Reports text box (TxtInvoiceNumber) in my VB app.
How can I do that?
Avatar of Mike McCracken
Mike McCracken

This works frm VB6 with CR XI.  Not sure the properties are available through the .Net API

CRReportObject.Sections(SectionNumber).ReoportObjects("ObjectName").Text

You will need your own export button onthe report unless you can intercept the click of the export button.

mlmcc
Avatar of NoraWil

ASKER

Sorry mlmcc, but I'm not getting further this way. Writing to a Crystal Reports  text box works with


CType(CR.ReportDefinition.ReportObjects("TxtBox"), CrystalDecisions.CrystalReports.Engine.TextObject).Text = "My text"

But the opposite doesn't work.

The Crystal Reports ReportDocument has a Rows property. Perhaps it's possible to read the contents of one of the columns that way, but I can't find any documentation on that property.

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial