Report Printing Detection

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Report Printing Detection

Postby SBarnes » Wed Jul 01, 2026 5:05 pm

Is there an event that can be used to detect the printing of any and all reports in Jiwa?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1707
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Report Printing Detection

Postby Scott.Pearce » Wed Jul 01, 2026 5:42 pm

Try JiwaPrintReport.AfterPrintOutputControllerPrintReport
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 768
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Report Printing Detection

Postby SBarnes » Wed Jul 01, 2026 5:51 pm

Thanks Scott, but I already tried that should it fire on preview or only print and if its print is there something similar for preview?

Code: Select all
public class BusinessLogicPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogicPlugin
{

    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaBusinessLogic, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
      if (JiwaBusinessLogic is JiwaFinancials.Jiwa.JiwaApplication.JiwaPrintReport.JiwaPrintReport)
       {
      var reportPrint = (JiwaFinancials.Jiwa.JiwaApplication.JiwaPrintReport.JiwaPrintReport)JiwaBusinessLogic;
           reportPrint.AfterPrintOutputControllerPrintReport += ReportPrint_AfterPrintOutputControllerPrintReport;
       }      
    }
   
   private void ReportPrint_AfterPrintOutputControllerPrintReport(
       ref JiwaFinancials.Jiwa.JiwaApplication.JiwaPrintReport.JiwaPrintReport jiwaPrintReport,
       ref JiwaFinancials.Jiwa.JiwaApplication.PrintGroup.Maintenance.LogicalPrinter printer,
       ref int copies,
       ref CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions printReportOptions)
   {
      System.Diagnostics.Debugger.Launch();
   }   
}
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1707
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Report Printing Detection

Postby Scott.Pearce » Wed Jul 01, 2026 5:58 pm

That event will only fire on print to printer.

For preview try listening to JiwaPrintReportUI.Mainform.CrystalReportViewer1.ReportRefresh. But you will have to add your handler by listening to the FormFactory.AfterFormStart and looking at the type of the form created (JiwaPrintReportUI.Mainform).
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 768
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Report Printing Detection

Postby SBarnes » Wed Jul 01, 2026 6:00 pm

Thanks
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1707
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Report Printing Detection

Postby Mike.Sheen » Wed Jul 01, 2026 6:03 pm

A similar question was asked by Danny over in this topic.

I mention there that you could hide the report preview toolbar, and add your own so you can then know when the preview is actually printed (if that's what you are after).
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2603
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 817

Re: Report Printing Detection

Postby SBarnes » Wed Jul 01, 2026 6:10 pm

Thanks, but no this more about the possibility of logging what reports are being run.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1707
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Report Printing Detection

Postby Mike.Sheen » Wed Jul 01, 2026 6:42 pm

SBarnes wrote:Thanks, but no this more about the possibility of logging what reports are being run.


If the user story is: "We want to log whenever anyone runs any reports" then you could add a handler to the Business logic factory's AfterBusinessLogicSetup if the object is the JiwaPrintReport business logic, then add a handler for it's ReadEnd event.

You could just log that - but that'll log when someone just has launched a menu report and are looking at the ranges and have not generated a report yet - so if that's a concern, there might be an event coming out of the CrystalDecisions.CrystalReports.Engine.ReportDocument or JiwaApplication.Report.Configuration.Report (which are properties of the JiwaPrintReport business logic) that you could use to determine when a report is generated - I don't know, I've not looked at those API's to see what is available.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2603
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 817


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 23 guests