SSRS White Space due to Hidden Column ?

I have few SSRS Reports that is show/hide columns based on the parameter. Some time you may get White Space due to hidden column. The reason behind the white space is, The design which you made you are changing the HIDDEN property to Header and Data Row. It means you made hidden only Header and Data row. But you can see the Tablix row at the top of your Header and Data row which is in Grey Color. So right click the particular Tablix Row and Custom Invisible Property Set True or False.

Cannot create a record in Table () , The record already exists.

Sometime you tried to insert some record in the table, if the system shows Cannot create a record in Table () , The record already exists. Generally we know that, this issues is caused due to Duplicate value. But here is the trick, so even i have checked the Index values which is allow duplicate yes. But still why this issue.. Basically we know that dynamics AX has invisible Index in every Table which is Recid, so this Recid is generating from SystemSequences Table( field nextval). So this SystemSequences  table contains every table Id and its next recid value in nextval field, so if it has a value with an already issued record id, you can increase the number.  To access this SystemSequences table you have to use SQL Management studio, Better it’s recommended to stay away from this table.

 

Hope you enjoyed.

SSRS Expression

Company Name :
=Microsoft.Dynamics.Framework.Reports.DataMethodUtility.GetFullCompanyNameForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value)

Page details:
=System.String.Format(Labels!@SYS182566, "" & Globals!PageNumber & "", "" & Globals!TotalPages & "")

Date & Time:
=Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "d", Parameters!AX_RenderingCulture.Value) & vbCrLf & Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "t", Parameters!AX_RenderingCulture.Value)

Show / Hide Based on an expression :
=Not(IIF(First(Fields!FieldName.Value, "ReportDatasetName")="",false,true))

Note : In this case try to use Parameter table alone.

Drillthrough Report in SSRS

Hi Guys, Have a Good Day!. Hope you are doing Good.

Today I’m going to share you how to developDrillthrough report in SSRS.

Confused ?

Don’t worry. Let me explain in short manner. Drillthrough report is a report that user can opens by clicking a link within another report. For example, We are listing All the Vendors and want to iterate vendors to all of his Purchase Orders and to their Purchase Order Details.

CONCEPT1

For more Details DrillThrough Reports in SSRS

We are going to illustrates the following tasks:
• Creating a Report Model project. 
• Creating reports 
• Vendor list 
• Purchase order list 
• Purchase order details 
• Providing drill-through action under designs 
• Saving the report to AOT and deploying it to the Report Server.
 Continue reading 

Move File from One Folder to Another Folder using X++

Hi Guys . I hope you are doing Good.

Today i’m going to share you that , how to move a File from One Folder to another folder using X++.

Here we can achieve this with the Help of WINAPI(Windows Application Programming Interface). Even though we can do Copy a file, delete a file, Create Directory, getting the file Size, etc. Refer more Details WINAPI

static void MoveFilesFromFoldertoAnotherFolder(Args _args)
{
 FilenameOpen fileNameOpen;
 DialogField dialogFileName;
 Dialog dialog;
 Filename filePath;
 Filename fileName;
 Filename fileType;
 FileName DestinationPath;
 #File
 
 ;
DestinationPath = @'C:\Users\saadullah\Desktop\Dest\'; // Define your Destination Path
 dialog = new Dialog("Move Files");
// AX 2009
 dialogFilename = dialog.addField(typeId(FileNameOpen));
// AX 2012
 // dialogFileName = dialog.addField(extendedTypeStr(FileNameOpen));
dialog.filenameLookupFilter([#AllFilesType]);
 dialog.filenameLookupTitle("Select File");
 dialog.caption("Move File");
 dialogFilename.value(fileName);
if(!dialog.run())
 return;
filenameOpen = dialogFilename.value();
 [filePath, fileName, fileType] = fileNameSplit(fileNameOpen);
// MoveFile - The Original File won't be available once it's moved into destination path
WinAPI::moveFile(fileNameOpen, DestinationPath+FileName+FileType);
// CopyFile - The Original File will be available even if it's moved into destination path
 //WinAPI::copyFile(fileNameOpen, DestinationPath+FileName+FileType);
// DeleteFile - Delete the Selected File
 //WinAPI::deleteFile(fileNameOpen);
 
 // If u need to Use this in Form Take look in AOT > Forms > Tutorial_Form_File
}

Collecting AOT object Properties Details in to Excel

One of the user posted in DUG that he required the list of all Classes and its properties from AOT to extract into Excel..  So, here is my solution…..

static void Export_Classes_propertied(Args _args)
{
    SysExcelApplication xlsApplication;
    SysExcelWorkBooks xlsWorkBookCollection;
    SysExcelWorkBook xlsWorkBook;
    SysExcelWorkSheets xlsWorkSheetCollection;
    SysExcelWorkSheet xlsWorkSheet;
    SysExcelRange xlsRange;
    int row = 1;
    str fileName;
    TreeNode classesNode = TreeNode::findNode(@'\Classes');
    TreeNodeIterator iterator = ClassesNode.AOTiterator();
    TreeNode classNode = iterator.next();
    ClassName   className;
    UtilElements utilElements;
    System.DateTime CreatedSysDate, ModifiedDate;
    utcdatetime UtcCreatedDate, UtcModifiedDate;
    str StrCreatedDate, strModifiedDate;
    ;
    //Filename
    fileName = "C:\\Users\\saadullah\\Desktop\\Class.xlsx";  // Define your Excel Path


    //Initialize Excel instance
    xlsApplication = SysExcelApplication::construct();
    //Open Excel document
    //xlsApplication.visible(true);
    //Create Excel WorkBook and WorkSheet
    xlsWorkBookCollection = xlsApplication.workbooks();
    xlsWorkBook = xlsWorkBookCollection.add();
    xlsWorkSheetCollection = xlsWorkBook.worksheets();
    xlsWorkSheet = xlsWorkSheetCollection.itemFromNum(1);

    //Excel columns captions
    xlsWorkSheet.cells().item(row,1).value("ID");
    xlsWorkSheet.cells().item(row,2).value("Name");
    xlsWorkSheet.cells().item(row,3).value("Extends");
    xlsWorkSheet.cells().item(row,4).value("RunOn");
    xlsWorkSheet.cells().item(row,5).value("CreatedBy");
    xlsWorkSheet.cells().item(row,6).value("CreatedDateTime");
    xlsWorkSheet.cells().item(row,7).value("ChangedBy");
    xlsWorkSheet.cells().item(row,8).value("ChangedDateTime");
   
    row++;

    while (classNode)
    {
        className = classNode.treeNodeName();
        classNode.AOTgetProperties(true);
        select utilElements
            where utilElements.RecordType == UtilElementType::Class
            && utilElements.Name == className;
        UtcCreatedDate = utilElements.createdDateTime;
        CreatedSysDate = Global::utcDateTime2SystemDateTime(UtcCreatedDate);
        UtcCreatedDate = Global::CLRSystemDateTime2UtcDateTime(CreatedSysDate);
        StrCreatedDate = DateTimeUtil::toStr(UtcCreatedDate);
        UtcModifiedDate = utilElements.modifiedDateTime;
        ModifiedDate = Global::utcDateTime2SystemDateTime(UtcModifiedDate);
        UtcModifiedDate = Global::CLRSystemDateTime2UtcDateTime(ModifiedDate);
        strModifiedDate = DateTimeUtil::toStr(UtcCreatedDate);

        xlsWorkSheet.cells().item(row,1).value(classNode.applObjectId());
        xlsWorkSheet.cells().item(row,2).value(classNode.AOTgetProperty('Name'));
        xlsWorkSheet.cells().item(row,3).value(classNode.AOTgetProperty('Extends'));
        xlsWorkSheet.cells().item(row,4).value(classNode.AOTgetProperty('RunOn'));
        xlsWorkSheet.cells().item(row,5).value(utilElements.createdBy);
        xlsWorkSheet.cells().item(row,6).value(StrCreatedDate);
        xlsWorkSheet.cells().item(row,7).value(utilElements.modifiedBy);
        xlsWorkSheet.cells().item(row,8).value(strModifiedDate);
        classNode = iterator.next();
        
        row++;
    }

    //Check whether the document already exists
    if(WinApi::fileExists(fileName))
    WinApi::deleteFile(fileName);

    //Save Excel document
    xlsWorkbook.saveAs(fileName);
    xlsWorkbook.comObject().save();
    //Open Excel document
    xlsApplication.visible(true);

    //Close Excel
    //xlsApplication.quit();
    //xlsApplication.finalize();
}

Period is not Open

Hi Guys..

I have started with SCM , i have created one PO then im trying to do Packing Slip by filling the Packing Slip #, But it showing Period is not Open on my given Paking Slip Date.

the reason behind the error is there is no Fiscal Period for my packing Slip date.

So i have create Period in General Ledger->Setup->Periods->Periods

Problem solved….

Import CSV files

As you have seen the Exporting Complete Table Record into CSV in the last post. Same way here i have written Code for Importing CSV into Table

static void Import_CSV(Args _args)
{
common TableBuffer;
DictTable dictTable = new DictTable(tableNum(TableName)); // Define Table Name
str TableName = dictTable.name();
DictField dictField;
int i;
CommaIo file;
container line;
str path = 'C:\\Users\\saadullah\\Documents\\'+TableName+'.csv'; // Directory Path
#define.filename(path)
#File
file = new CommaIo(#filename, #io_read);
if (!file || file.status() != IO_Status::Ok)
 {
 throw error("File cannot be opened.");
 }
TableBuffer = dictTable.makeRecord();
while (file.status() == IO_Status::Ok)
 {
 line = file.read(); // Selecting File values line by line as assigning to Container
 if (line != conNull())
 {
 // Looping the Table Field
 // we have Defined - 15 from the Counting of Fields 
 // we do not Require 15 System Field such as RecId, RecVersion, Created By, Created Datetime, Modified By, etc...
 for( i =1; i <= dictTable.fieldCnt() -15; i++)
 {
 // Selecting the Fields
 dictField = new DictField(dictTable.id(), dictTable.fieldCnt2Id(i));
 // Assigning the Container values to the Selected Table Field
 TableBuffer.(dictField.id()) = conpeek(line, i);
 }
 // Inserting Record 
 TableBuffer.doInsert();
 }
 }
}

Export CSV file

Hi Guys,.

Today i’m going to share one of the easiest way to Export and Import the Data without Microsoft Office Excel.
Its Comma Separated Value (CSV). The main Objective of CSV is storing the table record in the CSV file. even though i have found it from CookBook. But i have modified that coding for General Purpose in any table we can easily Export and Import.
Here i have written my Job for Exporting Complete data of any defined Table into CSV..

static void ExportCSV(Args _args)
 {
 common TableBuffer;
 DictTable dictTable = new DictTable(tableNum(TableName)); // Define Table Name
 str TableName = dictTable.name();
 DictField dictField;
 int i;
 CommaIo file;
 container line;
 str path = 'C:\\Users\\saadullah\\Documents\\'+TableName+'.csv'; // Directory Path
 #define.filename(path)
 #File
file = new CommaIo(#filename, #io_write);
if (!file || file.status() != IO_Status::Ok)
 {
 throw error("File cannot be opened.");
 }
TableBuffer = dictTable.makeRecord();
// Select the Entire Table
 while select TableBuffer
 {
 // Looping the Table Field
 // we have Defined - 15 from the Counting of Fields
 // we do not Require 15 System Field such as RecId, RecVersion, Created By, Created Datetime, Modified By, etc...
 for( i =1; i <= dictTable.fieldCnt() -15; i++)
 {
 // Selecting the Fields
 dictField = new DictField(dictTable.id(), dictTable.fieldCnt2Id(i));
// Adding the Selected Field values in Container
 line += [ TableBuffer.(dictField.id()) ];
}
 // Wrting the Selected Container Expression in File
 file.writeExp(line);
// we have to store the Next Records , so we are making Container to Null
 line = ConNull();
 }
info(strfmt("File Successfully Created in %1", #filename));
}

Unable to configure SharePoint Products and Technologies Configuration Wizard

Hi guys,

Hope everyone doing Good.

Today I started with Microsoft Office Sharepoint Server and first thing I did was to install MOSS 2007 J. The installation was successful, but while trying to run SharePoint Products and Technologies Configuration Wizard, I got the following error message.

SharePoint Products and Technologies Configuration Wizard #

Failed to start the database service MSSQL$OfficeServers. Repair this product by selecting it from the Add/Remove Programs menu.

I didn’t want to reinstall the SQL Express. I researched a bit and saw that the Registry Key for server role (HKLM/Software/Microsoft/Shared Tools/Web Server Extensions/12.0/WSS/ServerRole) is set incorrectly. It was set to SINGLESERVER.

I changed ServerRole’s value from SINGLESERVER to APPLICATION and after this I was able to configure the MOSS successfully and it’s running fine now J.

NOTE: Please make sure you make a backup of the registry before you make any changes. Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system.