cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification on Dynamic Field Addition and Runtime Report Customization in Crystal Reports 13

Amna13
Discoverer
0 Kudos
174

Hello 

I am currently working on a project using Crystal Reports 13 (CR13) with .NET, and I have encountered some limitations when trying to dynamically modify reports at runtime. In particular, I am looking to replicate certain functionalities that were achievable in Crystal Reports 9 (CR9) with VB6, but I am finding that the same flexibility does not appear to be available in CR13.

In CR9 with VB6, we were able to dynamically add FormulaFields, modify grouping and sorting options, and even insert new objects (such as text fields and field objects) into the report at runtime, all based on the data received. This allowed for highly customizable and dynamic reports. However, in CR13, I am struggling to achieve similar outcomes. Specifically, I would like to know:

  1. Is it possible in CR13 to add FormulaFields dynamically at runtime, or must all formula fields be predefined in the report template?

  2. Can I dynamically add new fields or objects (such as text objects or field objects) to a report at runtime in CR13, as was possible in CR9 using the COM-based API? If not, could you please confirm the limitations in CR13 around runtime modifications to report structures?

  3. Is there any official documentation or guidance available that details the exact limitations and capabilities of runtime report customization in CR13 compared to earlier versions (such as CR9)?

I appreciate your assistance and look forward to your guidance on these questions.

Accepted Solutions (0)

Answers (1)

Answers (1)

DonWilliams
Active Contributor
0 Kudos

Hi Anna,

Yes can add formulae and other CR objects in .NET.

What you look for is the *Controller using RAS

CrystalDecisions.ReportAppServer.Controllers.FormulaFieldControllerClass

Work would be get all Formula fields using ForNext()

Then Clone the collection then FormulaField.Add

Same for any other object.

To get you started download my example test app:

how-to-parameters-in-crystal-reports-for-visual-studio-net

You can see in the drop downlist box for objects how to get them and display them, modify to use the .Add() function

Go here to get the API reference Guide:

https://help.sap.com/docs/SUPPORT_CONTENT/crystalreports/3354091173.html

Don

Amna13
Discoverer
0 Kudos
Hi Don,
Amna13
Discoverer
0 Kudos
Thank you for replying. So is it possible to generate a complete report at runtime ? What I understood is that it needs to have template and structure predefined.
DonWilliams
Active Contributor
0 Kudos
Yes, much easier to have a template. You can add as many default objects as possible and DB connection info as well, much easier since the RPT file does keep track of the Database structured used in the report.