Odoo2Fast.report

CustomFunctions


In dieser Seite sind die CustomFunctions aufgeführt, die in der Report Engine verwendet werden können. Dabei handelt es sich um Funktionen, die man in verschiedenen Report häufig verwenden kann. Insbesondere geht es auch um die Konvertierung von Formaten.

Wie kann man die Funktionen benutzen?

Zunächst muss man den Installationspfad herausfinden. Dies kann man tun, in dem man im Windows Explorer unter einem Benutzer nach "..AppData\Local\Apps" und der Datei "EqFastReportCoreFunctions.dll" sucht und diese dann hinzufügt.

   

  

oder Sie öffnen einfach den Report in einem Texteditor und fügen den Namen im Report Kopf in Zeile 2 am Ende dazu und unter using:


Die Funktionen

static string EqFastReportCoreFunctions.EqCoreFunctions.BuildAddress(Dictionary< string, string > data) 

Builds an address string using the provided data dictionary.


Parameters

    data The dictionary containing the address data.


Returns

    The formatted address string.

Example

      // Lets build Dict for Address
      Dictionary<string, string> address = new Dictionary<string, string>();
      
      // print parent address only if the addresstype is not a "company". So the parent company will not be printed
      string addresstype = "";
      addresstype = ((String)Report.GetColumnValue("sale_order.res_partner_customer.company_type"));
      if(addresstype.Contains("company"))
      {
        address.Add("ParentName", "");
      }
      if(addresstype.Contains("person"))
      {
        address.Add("ParentName", ((String)Report.GetColumnValue("sale_order.res_partner_customer.res_partner.name")).Trim());
      }
      
      //address.Add("ParentName", ((String)Report.GetColumnValue("sale_order.res_partner_customer.res_partner.name")).Trim());
      address.Add("Title", ((String)Report.GetColumnValue("sale_order.res_partner_customer.res_partner_title.name")).Trim());   
      address.Add("FirstName", ((String)Report.GetColumnValue("sale_order.res_partner_customer.eq_firstname")).Trim());
      address.Add("LastName", ((String)Report.GetColumnValue("sale_order.res_partner_customer.name")).Trim());
      address.Add("CompanyType", ((String)Report.GetColumnValue("sale_order.res_partner_customer.company_type")).Trim());    
      address.Add("Company2", ((String)Report.GetColumnValue("sale_order.res_partner_customer.eq_name2")).Trim());
      address.Add("Company3", ((String)Report.GetColumnValue("sale_order.res_partner_customer.eq_name3")).Trim());
      address.Add("Street", ((String)Report.GetColumnValue("sale_order.res_partner_customer.street")).Trim());
      address.Add("EqHouseNo", ((String)Report.GetColumnValue("sale_order.res_partner_customer.eq_house_no")).Trim());
      address.Add("Street2", ((String)Report.GetColumnValue("sale_order.res_partner_customer.street2")).Trim());
      address.Add("Zip", ((String)Report.GetColumnValue("sale_order.res_partner_customer.zip")).Trim());
      address.Add("City", ((String)Report.GetColumnValue("sale_order.res_partner_customer.city")).Trim());
      address.Add("EqCityPart", ((String)Report.GetColumnValue("sale_order.res_partner_customer.eq_citypart")).Trim());
      address.Add("Country", ((String)Report.GetColumnValue("sale_order.res_partner_customer.res_country.name")).Trim());

      // Build Address
      to_record_customer_address.Text = EqCoreFunctions.BuildAddress(address); 

static bool EqFastReportCoreFunctions.EqCoreFunctions.CheckDiscounts (List<PosData> dataset)


Checks if there are different discount values in the dataset. This is required for the taxes labels to be visible or not.


Parameters

    dataset The list of PosData objects to check.


Returns

    True if there are different discount values, false otherwise.

static bool EqFastReportCoreFunctions.EqCoreFunctions.CheckSections(List<PosData> dataset)


Checks if sections are present in the dataset. Required for the GroupHeader to be visible or not.


Parameters

    dataset The list of PosData objects.


Returns

    Returns true if sections are present, false otherwise.


static bool EqFastReportCoreFunctions.EqCoreFunctions.CheckTaxes ( List< PosData > dataset )

Checks if the taxes in the given dataset are consistent. Required for the taxes labels to be visible or not.

Parameters
    dataset The list of PosData objects representing the dataset.

Returns
    True if the taxes are inconsistent, false otherwise.


static string eqFastReportCoreFunctions.EqCoreFunctions.ConvertHTMLToPlainText (string html)


Converts HTML to plain text.


Parameters

    html The HTML string to convert.


Returns

    The plain text representation of the HTML.


static string EqFastReportCoreFunctions.EqCoreFunctions.convertStringDate (string date)


Converts a string date to a formatted date string.


Parameters

    date The string date to convert.


Returns

    The formatted date string.



static string EqFastReportCoreFunctions.EqCoreFunctions.convertStringDate_to_dd_mm_yyyy (string date)


Converts a string date to the format "dd.MM.yyyy".


Parameters

    date The string date to be converted.


Returns

    The converted date in the format "dd.MM.yyyy".


Example



static DateTime EqFastReportCoreFunctions.EqCoreFunctions.convertStringDateToDatetime (string date)


Converts a string date to a DateTime object.


Parameters

    date The string date to convert.


Returns

    The converted DateTime object.


static Borders EqFastReportCoreFunctions.EqCoreFunctions.GetBorders	(	List< PosData >	list	)	
static
Retrieves the borders for a list of PosData objects.

Parameters
list	The list of PosData objects.
Returns
The Borders object containing the lower and upper borders.


static string EqFastReportCoreFunctions.EqCoreFunctions.getFontSizeFromNode	(	HtmlNode	node	)	
static
Retrieves the font size from an HTML node.

Parameters
node	The HTML node.
Returns
The font size as a string.


static ProductNameLineElements EqFastReportCoreFunctions.EqCoreFunctions.SeparateOrderProductLine	(	string	saleOrderLineName	)	
static
Separates the order product line into its individual elements.

Parameters
saleOrderLineName	The name of the sale order line.
Returns
The separated product line elements.


static string EqFastReportCoreFunctions.EqCoreFunctions.StripNotSupportedHTMLTags	(	string	html	)	
static
Strips the not supported HTML tags from the given HTML string.

Parameters
html	The HTML string to process.
Returns
The processed HTML string with unsupported tags stripped.


static string EqFastReportCoreFunctions.EqCoreFunctions.ToHex	(	int	red,
int	green,
int	blue )
static
Converts RGB color values to a hexadecimal color code.

Parameters
red	The red component of the color (0-255).
green	The green component of the color (0-255).
blue	The blue component of the color (0-255).
Returns
The hexadecimal color code.