Printing to PDF via Bullzip

irenegireneg Member Posts: 30
Hi there

I'm stepping through a customer table and printing a report per customer to PDF using Bullzip. I need to print after the first report a second report (Summary of activity) with another file name. The first report is called from within a form (onPush event) and now I want to do the same for the second report, straight after the first report.runmodal. I've tried to duplicat the following code, but it is as if the file name stays the same.
    //Report 1 _ Statement
    FileName := 'Statement' + CustEmail."Customer No." + '.pdf';
    BullZipPDF.Init;
    BullZipPDF.LoadSettings;
    RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
    BullZipPDF.SetValue('Output',FileDirectory+FileName);
    BullZipPDF.SetValue('Showsettings', 'never');
    BullZipPDF.SetValue('ShowPDF', 'no');
    BullZipPDF.SetValue('ShowProgress', 'no');
    BullZipPDF.SetValue('ShowProgressFinished', 'no');
    BullZipPDF.SetValue('SuppressErrors', 'yes');
    BullZipPDF.SetValue('ConfirmOverwrite', 'no');
    BullZipPDF.WriteSettings(TRUE);

    CLEAR(rStatement);  //New
    rStatement.Passvariables(vAccTypeDim, vCampaignNo,
                 PrintEntriesDue,PrintAllHavingEntry,PrintAllHavingBal, PrintReversedEntries, PrintUnappliedEntries,
                 IncludeAgingBand, FORMAT(DateChoice), LogInteraction, vCredRep);  //New
    rStatement.GetDateFilters(CustEmail."Customer No.", ldFrom, ldTo);

    rStatement.USEREQUESTFORM := FALSE;
    rStatement.RUNMODAL;

    //Report 2 - Summary of activity
    FileName := 'SumAct' + CustEmail."Customer No." + '.pdf';
    BullZipPDF.Init;
    BullZipPDF.LoadSettings;
    RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
    BullZipPDF.SetValue('Output',FileDirectory+FileName);
    BullZipPDF.SetValue('Showsettings', 'never');
    BullZipPDF.SetValue('ShowPDF', 'no');
    BullZipPDF.SetValue('ShowProgress', 'no');
    BullZipPDF.SetValue('ShowProgressFinished', 'no');
    BullZipPDF.SetValue('SuppressErrors', 'yes');
    BullZipPDF.SetValue('ConfirmOverwrite', 'no');
    BullZipPDF.WriteSettings(TRUE);

    CLEAR(rStatement);  //New
    rSumAct.GetDateFilters(CustEmail."Customer No.", ldFrom, ldTo);

    rSumAct.USEREQUESTFORM := FALSE;
    rSumAct.RUNMODAL;


It looks like the secord file name is used for the first one. Am I doing something wrong?
Irene Grassow

Answers

  • ara3nara3n Member Posts: 9,256
    after you run report.modal, you have to wait till the pdf is created. then run the second report and with for the PDF created.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • irenegireneg Member Posts: 30
    Thanks, is there a way that the program can test that the 1st PDF has been created? Otherwise, I'll have to initiate the 2nd report from another command button.
    Irene Grassow
  • SogSog Member Posts: 1,023
    Check if the file exists in the folder (wsh shell) is the option that comes to mind. If the Bullzip creates the file first and generates the second, then see if the file is not writeprotected.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.