šŸ“˜
TimeLine E3
  • TimeLine E3 Documentation
  • Framework
    • Introduction
    • DataSet Definition
    • Window Handling Object
      • Input/Output arguments
      • Open
      • BindDataControls
      • Item Changes
      • Item Search
      • MenuItemClicked
      • Print
      • ModuleOpened (BlueArrow)
      • BlueArrowArguments
      • New Row
      • Delete Row
      • Save
      • Transactions
      • Locking [deprecated]
      • Locking (new)
      • Resizing a response window
      • ParaPanel
      • Adding DMS Tab to a Module
    • BusinessObject
    • Controls
      • BindingFormat
      • LookupGrid and SearchDef
      • ComboBox
      • RadioButton
      • Multiline Textbox
      • xTextBoxSearch
      • xFileBrowse [v16+]
      • DxDispoColumn
      • DxProgressColumn
      • DxTemplateColumn
      • Change control caption programmatically
      • TabControl
      • Navigation
      • Enable controls programmatically
      • Enable a MenuItem programmatically
      • Filter search values
      • Jumping to another module
      • Messages, Notifications, Log, Exceptions, Translation
      • LoggerSink [deprecated]
      • Log
      • OpenFile, FolderBrowsing and SaveFile
      • Execute Actions while displaying an Hourglass
      • Using Progress
      • Async methods with progress bar
      • Wizard
      • Customizing controls using xBehaviors
      • TLProperty.AllowInReadOnly [v16+]
    • DataSet Operations
    • Business-related functionality
      • Getting the next primary key
      • Hybrids
      • Enums
      • Get Current User
    • SQL
    • SQL (using named parameters)
    • Advanced SQL
    • Expression Binding
    • Server-side logic & customization [v16+]
      • Service Hoster
      • Starting / stopping hosted services
      • Changes to scheduled jobs!
      • Business Object Proxies
      • Business Object API
    • Colors in Expression Bindings [v15+]
    • Theming
      • Icons
  • TimeLine Developer (TLD)
    • Debugging in TLD
    • Targets
    • Custom Project Rework [v16+]
  • TimeLine-specific LL functions
  • Stunnel proxy
    • Pre-requisites
    • 1. Initial setup
    • 2. Generate the server/web certificates
    • 3.a. Generating client certificates using the CSR flow
    • 3.b. Generate client certificates from the server console
    • 4. Setting up the E3 client connection
    • 5. Setting up the browser certificates
  • Configuration
    • Configuring the WCF timeout
  • Troubleshooting the E3 Bridge
  • [Deprecated]
    • TimeLine WEB - deprecated in v16+
      • Prerequisites for running the WASM modules on the server
      • Prerequisites for developing WASM modules with TLD
      • Creating a small web module with TLD
      • Terminal Configuration
    • Customization Examples - deprecated in v16+
    • Codestore [deprecated]
    • Configuring the scheduled jobs timeout - deprecated in v16+
Powered by GitBook
On this page
  • OnPrint
  • OnPrintSpecificReportArgs
  1. Framework
  2. Window Handling Object

Print

OnPrint

The code written in this section specifies the fields which are passed as arguments to the report. The link between reports and modules is made in the module ā€žFormular Generatorā€ (TFG).

For Reports having no arguments, the below code is not needed.

public override void OnPrint()
{
    base.OnPrint();
    
    ShowPrintDialog();
}
public virtual void ShowPrintDialog()
{
    int nr = this.BusObj.tSet.bel.DefaultViewRows[0].nr;
    short typ = this.BusObj.tSet.bel.DefaultViewRows[0].typ;

    if (BusObj.dSet.HasChanges())
    {
        BusObj.Retrieve(typ, nr);
    }

    this.BusObj.tSet.Args_nr = nr;
    this.BusObj.tSet.Args_typ = typ;
    object document_type = busBelUtils.Instance.GetBelDescription(typ);
    string document_type_string = document_type == null ? string.Empty : document_type.ToString();
    string adr1name1 = this.BusObj.tSet.bel.DefaultViewRows[0].adr1name1;
    string report_name = string.Format("{0} {1} - {2}", document_type_string, nr, adr1name1);    
    string hybrid = HybridExtensions.Get("BEL", typ, nr);

    ModuleManager.Instance.GetReport(this.Module.ModuleId, this.BusObj.dSet.Args, report_name, hybrid, this as xWindowHandlingObject);
    
   this.BusObj.SetDruckStatus();
}

If no report_name and/or hybrid values are available, the method can be called replacing the parameters with null values.

OnPrintSpecificReportArgs

The OnPrintSpecificReportArgs method allows to specify dataset retrieval arguments that are specific to one report or dataset. If not set, the standard module args will be used, as before.

public override xSqlArgs OnPrintSpecificReportArgs(string dsd_id, string rpt_id)
{
   xSqlArgs args = null;
   dsKalk2.kalk2_kopfRow kalkRow = BusObj.tSet.kalk2_kopf.FirstOrDefault();

   if (dsd_id == "rptKalkulation" && rpt_id == "Kalkulation" && kalkRow != null)
      {
         args = new xSqlArgs();
         args.Add("typ", kalkRow.bab_typ.ToInt(0));
         args.Add("nr", kalkRow.bab_nr.ToInt(0));
      }

   return args;
}

PreviousMenuItemClickedNextModuleOpened (BlueArrow)

Last updated 3 years ago