Friday, November 14, 2014

How To Add Company Logo To SSRS Report

Hello Guys..

Here i'm sharing steps how to add company logo to a ssrs report.

Step1 :

-> Add Extended Data Type "BitMap" to your table and name it as "CompanyLogo".
-> Add Extended Data Type "NoYesId" to your table and name it as "PrintLogo".

Step 2 :

-> Go to insert method of your ssrs report DP class and paste the below code before yourtable.insert();

if (conLen(FormLetter::companyLogo()) == 0)
    {
        yourtable.PrintLogo = NoYes::No;
    }
    else
    {
        yourtable.PrintLogo = NoYes::Yes;
        yourtable.CompanyLogo = FormLetter::companyLogo();
    }

//Note : Change table name

Step 3:
-> Edit your ssrs report design in visual studio.
-> Insert Image as shown in the below screen shot
-> Then go to image properties
-> In the properties go to "Use this field" and paste the below code and change the data set name

=IIF(First(Fields!PrintLogo.Value, "datasetname") = "Yes", First(Fields!CompanyLogo.Value, "datasetname"), "")

-> Select company logo type in the "Use this MIME type"
-> Save and then deploy the report ..

That's It ... :)




@ Rahul Talasila

Monday, November 3, 2014

How To Show Limited Records In a Form Info Part

Hello...!

In this post i'm going to show how to show Limited Records In a Form Info Part.

Example : Top 10 Vendors (AP-> Vendors)


In this example i'm going to show only top 5 vendors

Steps :
-> Open related info part(VendTop10VendorsByPurchase)
-> Go to infopart(VendTop10VendorsByPurchase) Properties and change Caption to Top 5 Vendors
-> Expand infopart(VendTop10VendorsByPurchase) ->Layout-> Main properties and change Rowcountwhensmall 10 to 5
->save and close .



Now we can see only 5 records... :)



@ Rahul Talasila

There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was 'Element 'http://tempuri.org/:queryBuilderArgs' contains data from a type that maps to the name 'http://schemas.datacontract.org/2004/07/XppClasses:SRSQueryBuilderArgs'

There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was 'Element 'http://tempuri.org/:queryBuilderArgs' contains data from a type that maps to the name 'http://schemas.datacontract.org/2004/07/XppClasses:SRSQueryBuilderArgs'........................................

Some times we get the above error while running reports in Axapta 2012. To resolve this issue we need to delete usage data in the AOSserver.


Solution : 

Step 1 -> Connect to sql server and go to axapta database(MicrosoftDynamicsAx) and delete all records in dbo.SYSCLIENTSESSIONS table.

Step 2-> Close the AX 2012 client to clear any in-memory elements.

Step 3-> Stop the Microsoft Dynamics Server service on the Application Object Server (AOS) to clear any in-memory elements.

Step 4-> Delete the application element cache files (*.auc),(*.KTI) from the Local Application Data folder.

C:\Users\AOSAccount\AppData\Local  (Delete the all the AUC and KTI files)

Step 5-> Delete VSAssemblies from the Local Application Data folder.

C:\Users\youruserid\AppData\Local\Microsoft\Dynamics AX\VSAssemblies

Step 6-> Start the service




Note : Make sure show hidden files,folders,and drivers option enabled

@Rahul Talasila

Wednesday, October 29, 2014

Display customized Text In Status Bar- Axapta 2012

Here i'm sharing the code to Display customized Text In Status Bar

//Copy and paste the below code in a Job

static void statusbar(Args _args)
{
    str customtext;
    ;

    customtext = "Test";

    // Force the text to be shown
    xUserInfo::statusLine_CustomText(true);
    infolog.writeCustomStatlineItem(customtext);

}



@ Rahul Talasila

Tuesday, October 28, 2014

Filtering Records in a Form - Microsoft Dynamics Axapta

Hello Guys...


In this post i'm sharing steps how to do the Filtration of records in a Form

Here  i'm filtering records based on the selected gender(m/f)

Step 1 :

Go to Form-> Methods->class declaration and declare QueryBuildRange.

public class FormRun extends ObjectRun
{
    QueryBuildRange range;
}

Step 2:
Go to Data sources->your datasource->Add a Range in init() method of the DataSource.

public void init()
{
    super();
    range = this.query().dataSourceName("Test_Filteration").addRange(fieldNum(Test_Filteration,Gender));
}
//Note : You can use dataSourceNo also

Step 3 :

Go to Data sources->your datasource->Override the executeQuery() method


public void executeQuery()
{
    range.value(Gender.valueStr());
    super();
}

//Note : Enable "Gender"Auto-declaration to "Yes" in design

Step 4 :

Finally  Call the executeQuery() method in the Selection Changed method of the ComboBox(Gender).


public int selectionChange()
{
    int ret;

    ret = super();
    Test_Filteration_ds.executeQuery();
    return ret;
}




@ Rahul Talasila

Monday, October 27, 2014

Import Vendor Balances In Microsoft Dynamics Axapta 2012

Here I'm sharing code to import Vendor Opening Balances Lines.

Note : The below code import only Lines.


-> Copy and paste below code in AOT->Jobs(Compile Job before using)
->open excel and fill the data according to the below format and save in CSV format
->Run job and browse file and press ok

Csv Format :

column1 - Journal Number
column2 - MainAccountNum
column3 - Dimension1
column4 - Dimension2
column5 - Dimension3
column6 - Debit Amount
column7 - Credit Amount
column8 - Transaction Date
Column9 - Description
Column10 - InvoiceId
Column11 - PostingProfile

//Code Starts From Here- @ Rahul Talasila

static void VendorOpeningBalances(Args _args)
{
    CommaIO                   csvFile;
    container                 readCon;
    counter                   icount,inserted;
    Dialog                    dialog;
    DialogField               dfFileName;
    FileName                  fileName;
    LedgerJournalACType       ledgerJournalACType;
    AxLedgerJournalTable      axLedgerJournalTable ;
    AxLedgerJournalTrans      axLedgerJournalTrans;
    container                 accPatternvend,accPatternledger;
    container                 offSetPattern;
     DimensionDynamicAccount   ledgerdimension;
   str transdate;
    ;
     inserted =0;
    #File
    dialog     = new Dialog("Pick the file");
   // dialog
    dfFileName = dialog.addField(extendedTypeStr(FileNameOpen));
    dialog.filenameLookupFilter(["All files", #AllFiles]);
    if(dialog.run())
    {
       filename =  dfFileName.value();
    }
       csvFile  =  new CommaIO(filename,'r');

    if(csvFile)
    {
        ttsBegin;
        while (csvFile.status() == IO_Status::OK)
        {
          readCon  = csvFile.read();
          if(readCon)
            {
                transdate = conPeek(readCon, 8);
                axLedgerJournalTable = new AxLedgerJournalTable();
                axLedgerJournalTrans = new AxLedgerJournalTrans();
                axLedgerJournalTrans.parmJournalNum(conPeek(readCon, 1));
                axLedgerJournalTrans.parmTransDate(str2Date(transdate,123));
                axLedgerJournalTrans.parmAccountType(LedgerJournalACType::Vend);
                ledgerdimension = DimensionStorage::getDynamicAccount(conPeek(readCon, 2), LedgerJournalACType::Vend);
                axLedgerJournalTrans.parmLedgerDimension(ledgerdimension);
                axLedgerJournalTrans.parmDefaultDimension(LedgerJournalTable::find(conPeek(readCon, 1)).DefaultDimension);
                axLedgerJournalTrans.parmAmountCurDebit(conPeek(readCon, 6));
                accPatternledger = [conPeek(readCon,2) + conPeek(readCon,3) + conPeek(readCon,4) + conPeek(readCon,5), conPeek(readCon,2),conPeek(readCon,3),conPeek(readCon,4),conPeek(readCon,5)];
                axLedgerJournalTrans.parmOffsetAccountType(LedgerJournalACType::Ledger);
                axLedgerJournalTrans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(accPatternledger));
                axLedgerJournalTrans.parmAmountCurCredit(conPeek(readCon, 7));
                axLedgerJournalTrans.parmTxt(conPeek(readCon,9));
                axLedgerJournalTrans.parmInvoice(conPeek(readCon,10));
                axLedgerJournalTrans.parmPostingProfile(conPeek(readCon,11));
                axLedgerJournalTrans.save();
                icount++;
                inserted++;
            }
        }
      ttsCommit;
    }
   info(strfmt("%1 records Inserted out of %2",inserted,icount));

}


Note : Based on ledger account dimension structure your account pattern will change

@ Rahul Talasila

Sunday, October 26, 2014

"Unable to preview the report, install the Business Intelligence Development Studio feature of Microsoft SQL Server. For more information, see http://go.microsoft.com/fwlink/?LinkId=212331”



Solution:
-> Axapta 2012 needs to integrate with Visual Studio 2010.
-> Therefore you have to install BIDS (Business Intelligence Development Studio). 
->You can use a SQL Server 2008 R2 installation image to install it (it’s one of the components you can select during installation of “A new standalone server or additional components” on the client machine.




After the installation open report in visual studio - 2010. 

 Rahul Talasila

What is the primary purpose of using a Solution in Microsoft Power Platform & ALM?

As organizations embrace low-code development with Microsoft Power Platform , it becomes essential to manage and govern apps, flows, and dat...