Uniconta Report before print

Date: 2021-01-11
using System.Linq;
using System.Collections;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using Uniconta.ClientTools;
using Uniconta.ClientTools.DataModel;
using Uniconta.Common;
using Uniconta.API;
using Uniconta.API.Service;
using Uniconta.API.System;
using Newtonsoft.Json;


private void NewSimpleReport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {

	var homePage = (System.Windows.Application.Current.MainWindow as UnicontaClient.HomePage);
	var firstItem = (this.DataSource as IEnumerable).Cast<object>().FirstOrDefault();
	if (homePage != null && firstItem is UnicontaBaseEntity) {
		var baseEntity = firstItem as UnicontaBaseEntity;
		var companyId = 27270;// baseEntity.CompanyId 
		var cache = homePage.ClientGetCache(companyId, typeof(InvSerieBatchClient));
		System.Diagnostics.Debugger.Break();
		Console.WriteLine("baseEntity.CompanyId" + baseEntity.CompanyId.ToString());
	}
//	var api = new CrudApi(this.);
//	(await api.Query<InvSerieBatchClientUserCustom>(propValuePairs)).ToList();
}

Application.Current.MainWindow

new CrudApi(Uniconta.ClientTools.Page.BasePage.session);

UnicontaClient.HomePage

(System.Windows.Application.Current.MainWindow as UnicontaClient.HomePage)


	public static SQLCache ClientGetCache(int CompanyId, Type TableType)
	{
		Company Comp = Company.Get(CompanyId);
		if (Comp != null)
		{
			SQLCache cache = Comp.GetCache(TableType);
			if (cache != null)
			{
				return cache;
			}
			return Comp.GetCache(TableType, new QueryAPI(BasePage.session, Comp));
		}
		return null;
	}

	System.Diagnostics.Debugger.Break();


DNA ontwikkel-web 27270


var session = Uniconta.ClientTools.Page.BasePage.session;
            new CrudAPI(session, session.GetOpenCompany(27270));


using Uniconta.ClientTools;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using Uniconta.ClientTools.DataModel;
using Uniconta.Common;
using Uniconta.API;
using Uniconta.API.Service;
using Uniconta.API.System;
using Newtonsoft.Json;


private void FactuurLand_GetValue(object sender, DevExpress.XtraReports.UI.GetValueEventArgs e) {
    try
    {
		  e.Value = e.Report.FindControl("lblCompanyId", true).Value.ToString();
		  var intValue = 0;	
  	      int.TryParse( e.Report.FindControl("lblCompanyId", true).Value.ToString(), out intValue);
	      e.Value = AppEnums.Countries.Label(intValue).ToString();
    }
    catch (Exception ex)
    {
        e.Value = ex.Message;
    }
}

private void standardInvoiceReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {

}



ProductionPostedClient => BatchNumber

InvSerieBatchClient => BatchNumber

Datum Batch
44300cookie-checkUniconta Report before print