Search This Blog

Monday, April 21, 2014

How to Convert SSRS Report into PDF By using X++.

Hi Folks,

Here is the code to convert SSRS report into PDF.
But Before converting the report to PDF we need to send the parameter values to Contract class after that we need to convert the report.

//For Converting Report to PDF
public void makeCommissionReport()
{
    Args                            args;
    SrsReportRunInterface           reportRun;
    SrsReportDataContract           contract;
    SrsReportRunController          controller;
    CommByAgencyContract            commContract;
    SRSPrintDestinationSettings     printSettings;
    SRSReportExecutionInfo          executionInfo;
 
 

    SrsReportRunImpl                srsReportRun;

    ReportName                      reportname =  "CommissionReportAgency.report";
    filenameType    = '.pdf';
    generatedReportFilePath = filePath + file + filenameType;
    args = new Args();
   /* args.record(record);
    retailStoretable = args.record(record);
    generatedDocument = false;
   */
    /*select custTable where custTable.AccountNum == retailStoretable.DefaultCustAccount;
    storenum = retailStoretable.StoreNumber;
    num      = custTable.InvoiceAccount;
    */
    controller = new SrsReportRunController();
    controller.parmReportName(reportname);
    commContract = controller.parmReportContract().parmRdpContract();
    commContract.parmfromdate(dat);
    commContract.parmTodate(endDate);
    commContract.ReciD(recid);
    controller.parmArgs(args);
    srsReportRun = controller.parmReportRun() as SrsReportRunImpl;
    controller.parmReportRun(srsReportRun);

    controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);
    controller.parmReportContract().parmPrintSettings().overwriteFile(true);
    controller.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
    controller.parmReportContract().parmPrintSettings().fileName(generatedReportFilePath);
    controller.runReport();
    //generatedDocument = true;
}

Thanks
Happy Daxing..!

How to Display SSRS Report into Enterprise Portal in Dynamica Axapta 2012 R2

Hi Folks,

How to Display SSRS Report into Enterprise Portal in Dynamica Axapta 2012 R2 .Its very Easy.

Please see the below steps.

Step1:

After Creating the SSRS in AX,we need to add that into output menuItem with proper label.
Here label is very important because it will connect between Ep and AX.

Step 2:

\Go to your EP page selct the place where you need to display the Report.There we need to add the web Part click on that we can see the option like "Dynamics Report Server Report".

Step 3:

It will display all the outPut MenuItems,Here we can see the label names for the menuitems. Select your menuitems .thats it.

Thanks
Happy Daxing..! 

How to Calculate the time for the particular query time in Dynamics Axapta

Hi Folks,

How to Calculate the query timings ,how much time its working.

Check the below code you can identify :)

static void DateSplit(Args _args)
{
  date fixDate,fromdate,todate;
  int i,j;
  int         day,month,years;
  utcDateTime         jobStart, JobEnd;
  int64               jobRuntime;
  ;
    jobStart = DateTimeUtil::utcNow();
  fixDate = 22\1\2014;//systemDateGet();
  day = dayOfMth(fixDate);
  month = mthOfYr(fixDate);
  years = year(fixDate);

  info(strFmt("%1",day));

    if(day <=15)
    {
        fromdate = mkDate(1,month,years);
        todate   = mkDate(15,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
    else if(day <= 31)
    {
        fromdate = mkDate(16,month,years);
        todate   = mkDate(31,month,years);
        info(strFmt("%1 %2",fromdate,todate));
    }
     jobEnd = DateTimeUtil::utcNow();
    jobRuntime = DateTimeUtil::getDifference(JobEnd, jobStart);
    info(strFmt("JOB DONE IN %1 SECONDS", int642str(jobRuntime)));
}

OutPut:























Thanks
Happy Daxing..!

Sunday, April 20, 2014

Create new Numberseq in Ax2012

Hi Folks,

How to create the new numberseq with Out disturb the existing class In ax2012.

1) Create the new Class extends with NumberSeqApplicationModule

class Sample extends NumberSeqApplicationModule
{

}

2)  Override the Loadmodule method()

protected void loadModule()

{

NumberSeqDatatype datatype = NumberSeqDatatype::construct();

/* Setup application numbers */

datatype.parmDatatypeId(extendedtypenum(EDT));

datatype.parmReferenceHelp(literalstr("Sample"));

datatype.parmReferenceLabel(literalstr("Sample"));

datatype.parmWizardIsContinuous(true);

datatype.parmWizardIsManual(NoYes::No);

datatype.parmWizardIsChangeDownAllowed(NoYes::No);

datatype.parmWizardIsChangeUpAllowed(NoYes::No);

datatype.parmWizardHighest(999999);

datatype.parmSortField(1);

datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);

this.create(datatype);

}
3) Select the numberseq for perticular form

public NumberSeqModule numberSeqModule()
{
    return NumberSeqModule::RetailParameters;
}

4) Goto Organisation and administration Module generate the numberseq in normal process.

Thanks
Happy Daxing..

Thursday, March 27, 2014

How to Hide Modules based in Company in AX2012

Hi Folks,

Here is the way to hide modules based on the company...

1) Open the Dynamics Axapta Application.

Go to navination pane select the options like













2) Then below screen will open go there and un select the modules and then save it






















Thanks
Happy Daxing..

How to debugg the RDP Class in SSRS Reports on Dynamics AX2012

Hi Folks,

Hope every one is doing good.It has been long time since I shared the things into my blog.I am little bit busy with my current project and learning new things about SSRS,AIF and MVC.

Today I would like to share a very interesting and simple concept on SSRS,i.e

Debugging the SSRS RDP Class in Dynamics AX2012.

1) Class declaration of RDP class ,we need to replace the code like extends SrsReportDataProviderPreProcess instead of SrsReportDataProviderBase 

2) Temp table properties should be
     (a) Table type :Regular 
     (b)  Created by : Yes
     (c) Created Transaction Id : Yes
Third step is not a mandatory.
3) In process report of the class add this line  in Temporarytablename.setConnection(this.parmUserConnection());

Thanks
Happy Daxing..

Monday, January 13, 2014

Periodic maintenance and performance analysis in AX

Hi Friends,

I recently came across a very useful article about the AX maintenance and performance.

Which is actually explains about how the DAX DB is really being used for real data and temp data.

In fact if you look into the DAX DB tables almost 60% of your DAX DB is being used by 4 tables unfortunately they are temp data i.e. INVENTSETTLEMENT, SYSDATABASELOG, SALESPARMLINE, INVENTSUMLOGTTS.

Click here to view the article.

Thanks,
Sai