I am sending the logic of the code. I deleted some lines. it has 569 lines of code. And it is running on server side.
str 64 Butce;
int referenceBuy;
Amount referenceBuyAmount, monthlyPay;
Description urunTipi;
CustAccount custAccount1;
BankChequeTable bankChequeTable;
Container companyList = DirUtility::getDataAreaList(false);
int curTime;
int myCounter;
;
curTime = timeNow();
info(int2str(curTime));
print int2str(curTime);
try
{
perm = new FileIoPermission(#ExampleFile, #ExampleOpenMode);
perm.assert();
textBuffer.appendText("name;");
//there are 57 columns more.
textBuffer.appendText("\n");
while select smmBusRelTable
index hint PartyIdx
{
DirPersonPartyDetail = DirPersonPartyDetail::find(smmBusRelTable.PartyId);
Address = Address::findCRM(smmBusRelTable.PartyId);
textBuffer.appendText(strfmt("%1;",smmBusRelTable.Name));
textBuffer.appendText(strfmt("%1;",smmBusRelTable.Email));
while select CPMAreaTable
index hint CustIdx
where CPMAreaTable.CustAccount == custAccount1
{
textBuffer.appendText(strfmt("%1,",CPMAreaTable.AreaNameId));
}
textBuffer.appendText(strfmt(";"));
textBuffer.appendText(strfmt("%1;",this.dispProjects(smmBusRelTable)));
textBuffer.appendText("\n");
myCounter++;
if (myCounter == 1800)
{
// we have 10 records
break;
}
print myCounter;
}
Lines = textBuffer.numLines();
info(int2str(curTime));
print int2str(curTime);
try
{
if (textBuffer.toFile(#ExampleFile))
info( strfmt("File Generated as %1.total insert %2 Lines",#ExampleFile,Lines));
}
catch ( Exception::Error )
{
error ("Generated file error.");
}
CodeAccessPermission::revertAssert();
}
catch (Exception::Deadlock)
{
retry;
}
}