PDA

Click to See Complete Forum and Search --> : Read Crystal Reports Template


tansarbh
Oct 7th, 2005, 01:57 PM
Hey Guys,

Can we read the template of a crystal report? The reason I need to is I have to getvalues from the users for the values in the template they select from the list.

e.g If the report has a label with caption "Name" and a Text Box with the Name="Customer Name",

The form will load those and the user will enter Value for the Text box.

Thanks.

ducky
Oct 7th, 2005, 02:43 PM
Yes you can read the entire design of the report via the RDC. First set the references in your project to the Crystal Reports Activex Designer Runtime Library (RDC). I assume when you say template you mean an existing report? Then open the report using code like

Dim rpt As CRAXDRT.Report
Dim myapp As CRAXDRT.Application
Set myapp = New CRAXDRT.Application
Set rpt = myapp.OpenReport(txtRptName)

Once the report is "open" you can now traverse the enitre report (rpt object) sections to pick off whatever you need to dynamically request from the user before running.