We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Crystal Reports 9 to 2010 code upgrade problem

Medium Priority
625 Views
Last Modified: 2013-11-26
Hi,

I am attempting to upgrade a c# application that calls Crystal Reports 9 to export pages of a report as separate PDF files.  The report queries the database and produces a page for each record.  On each page two of the formula fields contain the unique information that I need to properly name the exported PDF page.

When using Crystal Reports 9 I could get the required data from the formula fields on the ReportSection_Format event as shown in the following code:

private void ReportSection_Format(object pFormattingInfo)
        {
            if (GotFormulas == false)
            {
                foreach (FormulaFieldDefinition oFieldDef in CrystalReport.FormulaFields)
                {
                    if (oFieldDef.Name == "{@First_text}")
                    {
                        FirstNum = System.Convert.ToString(oFieldDef.Value);
                        GotFormulas = true;
                    }
                    else if (oFieldDef.Name == "{@Second_text}")
                    {
                        SecondNum = System.Convert.ToString(oFieldDef.Value);
                        GotFormulas = true;
                    }
                }
            }
        }

Now I need to upgrade the application to run on 64bit but it appears Crystal Reports 9 exports corrupt PDF files.  I upgrade the application to used the latest version of Crystal Reports and it now exports good PDFs but it no longer exposes the same ReportSection_Format event.  How can I get the value of the formula fields at runtime and for each page (db record)?

Thanks for your help!!!
Comment
Watch Question

Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you for your quick response!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.