Sunday, September 26, 2010

Pictures from the seminar

Some pictures from BI seminar are here.



PowerPivot in Excel 2010 looks really cool!

Thursday, September 16, 2010

Business Intelligence Seminar in Montreal, September 25

BI: SSIS, SSRS, SSAS, PowerPivot, OLAP Cubes. The event will be in Montreal, more info.



Who's going to participate?

Wednesday, September 15, 2010

Microsoft Dynamics Salary Survey 2010

Now, this is the time to participate in the annual Microsoft Dynamics Salary Survey conducted by Nigel Frank International.

It takes actually two minutes to fill in. This is in English, but it is very easy to understand.

As a prize you will get a copy of the survey results, which are a comprehensive analysis of comparative salary data in different aspects: geography, domains, positions and so on. You can see 2009 report here.



Copyright 2009 Nigel Frank International Ltd.

I am sure this job helps us a lot to improve our employment situation. So, please, enjoy!

Thursday, August 12, 2010

Value in Query range

How to use Enum values in Query ranges:



public void init()
{
    QueryBuildRange   criteriaOpen;
    ;
    super();
    criteriaOpen = this.query().dataSourceTable(tableNum(ProdTable)).addRange(fieldnum(ProdTable, ProdStatus));
    criteriaOpen.value("Started"); // it does not work in non-English interface!!!

    criteriaOpen.value(enum2str(ProdStatus::StartedUp)); // not enough good...

        criteriaOpen.value(QueryValue(ProdStatus::StartedUp); // now it is correct!    
}

Friday, May 7, 2010

Vania Kashperuk's Tutorial: refresh, reread, research, executeQuery

First of all, I have to admit that this subject was a little vague for me. This is why I read with a huge interest this new Vania's tutorial about how to use efficiently and correctly these four data source methods.

In fact, it is always much easier to acquire new knowledge on real examples, and luckily this is the case! Not only explained he step-by-step the difference between the methods but also provided us with a ready-to-use project  for Dynamics AX 2009, which can help a lot to them who have just started working with the system.

So, I highly recommend his blog to every AX developer. 

To whom it may be useful, I adapted this xpo-project to Dynamics AX 4.0. 

Didn't get it right? Just reread() it and refresh() your knowledge!

Tuesday, March 16, 2010

All Lables from given Layer in given Languages

Sometimes I need to see a label translations into different languages. Sometimes it is good to see all the labels that were created during the project on a given layer - like those on USR.

This job exports all labels from a given layer in given languages to an Excel file.

Here I used the two following code examples from the AXForum.info:

Firstly, the job calculates the number of labels; then, it shows progress window; finally, it opens an Excel file saved under the name like "Labels from "+#LayerId+ " in "+#English+", "+#French+", "+#Russian+".xls".

In this particular job are SYS layer and three mentioned languages used; you can easily change them to your needs.



static void SisPrintAllLabelsOnGivenLanguages(Args _args)
{
    // needed layer
    #define.LayerId("SIS")
    // all needed languages
    #define.English("en-us")
    #define.French("fr-ca")
    #define.Russian("ru")
    // label classes
    Label   lEn = new Label(#English);
    Label   lFr = new Label(#French);
    Label   lRu = new Label(#Russian);
    // start looking every label
    str 250 lId;
    int totalLabels;
    RunbaseProgress         progress;
    #macrolib.AviFiles
    //Excel variables section
    COM rstAxa = new COM('ADODB.Recordset');    // ADO: Recordset
    COM flds   = rstAxa.Fields();
    COM fld;
    #define.LabelId("LabelId")
    COM xlApp;            
    COM wbks, wbk;        
    COM wkss, wks;        
    COM rng, cell, rngCR; 
    COM font;             
    COM entCol;           
    COM actWin;           
    int i, iMax;
    ;
    print("@SYS34745");
    // start looking every label
    lId = lEn.searchFirst('');
    while (lId)
    {
        if (lEn.moduleId(lId) == #LayerId) // The particular label file
        {
            // count labels
            totalLabels++;
        }
        lId = lEn.searchNext();
    }
    print(strfmt("%1 = %2", "@SYS54695", totalLabels));
    print("@SYS76178");
    if (totalLabels<=0)
        return;

    progress = RunbaseProgress::construct(1,null);

    progress.setCaption("@SYS76178");
    progress.setTotal(totalLabels);
    progress.setAnimation(#AviPrint);

    // <--- create excel fields in a worksheet
    flds.Append(#LabelId, 8);
    flds.Append(#English, 8);
    flds.Append(#French, 8);
    flds.Append(#Russian, 8);
    rstAxa.Open();

    xlApp = new COM('Excel.Application');
    xlApp.Visible(false);
    wbks = xlApp.Workbooks();
    wbk  = wbks.Add();
    wkss = wbk.Worksheets();
    wks  = wkss.Item(1);
    wks.Name("Labels");
    rng  = wks.Range('A1');
    flds = rstAxa.Fields();
    iMax = flds.Count() - 1;
    for (i = 0; i <= iMax; i += 1)
    {
        fld = flds.Item(i);
        cell = rng.Offset(0, i);
        cell.Value2(fld.Name());
    }
    rngCR = rng.CurrentRegion();
    font = rngCR.Font();
    font.Bold(true);
    cell = rng.Offset(1, 0);
    // <--- end of creating of excel fields in a worksheet

    lId = lEn.searchFirst('');
    while (lId)
    {
        if (lEn.moduleId(lId) == #LayerId) // The particular label file
        {
            // print to excel
            progress.incCount();
            rstAxa.AddNew();
            fld = flds.Item(#LabelId);  fld.Value(lId);
            fld = flds.Item(#English);  fld.Value(lEn.extractString(lId));
            fld = flds.Item(#French);   fld.Value(lFr.extractString(lId));
            fld = flds.Item(#Russian);  fld.Value(lRu.extractString(lId));
            rstAxa.Update();
        }
        lId = lEn.searchNext();
    }
    cell.CopyFromRecordset(rstAxa);
    progress.kill();
    // format excel worksheet
    rngCR = rng.CurrentRegion();
    entCol = rngCR.EntireColumn();
    entCol.AutoFit();
    cell.Select();
    actWin = xlApp.ActiveWindow();
    actWin.FreezePanes(true);
    rstAxa.Close();
    xlApp.Visible(true);
    wbk.SaveAs("Labels from "+#LayerId+ " in "+#English+", "+#French+", "+#Russian+".xls");
}


Form Digger

FormDigger is a very useful tool. It facilitates form development substantially by allowing to search fields either by its name or label,  highligt them on the form, take a snapshot of it, and jump directly to AOT.

It should be installed as an XPO project  and then called by Alt-~.

Highly recommended!

By the way, this is the second powerful tool I use created by the same AX master - Evgeny Arlionak