Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8050707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:08:31+00:00 2026-06-05T07:08:31+00:00

I implemented a loop that exports a crystal report to pdf. The idea is

  • 0

I implemented a loop that exports a crystal report to pdf. The idea is instanciating the initial report with its conection and then inside the loop applying the parameters before exporting to PDF (so i get one pdf for each record), but the report keeps exporting the pdf with the data of the first loop execution. How can i force it to refresh its data after applying the new parameters?

Example Code:

ReportDocument reportDoc=new ReportDocument();
reportDoc.Load("c:\\reportx.rpt");
ConnectionInfo cinfo = FunctionLibrary.getCrystalConection();
foreach (Table table in reportDoc.Database.Tables)
{
    table.LogOnInfo.ConnectionInfo = cinfo;
    table.ApplyLogOnInfo(table.LogOnInfo);
}
string[] docnumbers=new[]{"1","2","3","4"};

for(int i=0;i<docnumbers.Lenght; i++)
{
    report.SetParameterValue(0, docnumbers[i]);
    report.Refresh();
    DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
    PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
    CrDiskFileDestinationOptions.DiskFileName = "C:\\generatedpdf " + docnumbers[i] + ".pdf";
    ExportOptions CrExportOptions = reportDoc.ExportOptions;
    {
        CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
        CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
        CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
        CrExportOptions.FormatOptions = CrFormatTypeOptions;
    }
    reportDoc.Export();
}
reportDoc.Close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:08:32+00:00Added an answer on June 5, 2026 at 7:08 am

    The problem was at report.Refresh(); when i removed that line it worked…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I implemented a fonction in Visual Basic 2008 that takes the content of all
I would like to have a script with an infinite loop, that kills all
Does anyone know or have good links that explain what iPhone's event loop does
I noticed that IEnumerable (Generics) requires 2 methods to be implemented: 1. IEnumerator<T> GetEnumerator()
I am having trouble figuring out how to break out of a loop that
The program takes a string using getline, and then passes that string to a
I have just implemented a loop to populate a player's hand (a queue) with
I have implemented pdf creation, http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf but in my logic, there is a link
I have an issue with a Loop that doesn't actually loop. I've posted a
I understand that the new TPL (Task Parallel Library) has implemented the Parallel.ForEach such

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.