Displaying Dimensions in Report

I’ve a customized table named “tableABC”,in which i have the employee id field…i’m generating a report with tableABC datasource,and in this report i want to display the “Dimension- Entity,region,service center” for that particular employee which i select.Please suggest me solutions Regards -Rajee

What is your problem in doing that?

You want to get the dimensions from Employee table - use find method (EmplTable::find(tableABC.emplId).dimension)

if you want to print only some dimensions - like only department - EmplTable::find(tableABC.emplId).dimension[1];//// 1 points to department

But kranthi, i did the same which you hav said--------return EmplTable::find(PmsListTable.Employee).Dimension[1];------thisis i have written in the display method of the report,but i’m not getting the entity value

Hi,

Check whether for the employee dimesion exists or not…

what the code written, returns the dimesion[1] value…

Naresh Kolli

yes i have given dimensions for the employee

I dont think Employee has the dimension fields otherwise it will come in the report.

A suggestion : Avoid writing Select statements in the display method. You can declare a variable and store the dimension value in fetch method. Return this variable in the display Method.

Open EmplTable once more and cross verify.

Hi Monika,Please check EmplTable,it has the ‘Dimension’ field

Sorry, I guess I was not very clear. I wanted you to cross verify the table if values are there. If it does then it should display in the report.

values are there in the table

Put a debugger in the display method and find out whether the value is coming into PmsListTable.Employee

no kranthi,its not retriving the emplid.what to do now?

Are you able to print the EmplId?

what is your report structure?

i tried the other way,by adding the ‘empltable’ in the datasource and included the dimension[1] field from the empltable to the report design,but still i faced another issue…the problem is that,if i have totally 5 records,it does not display the value for the 1st rec. is there any way to solve? please help

my report has 2 tables 1.ListTable,2.AppSummaryTable…these two table are customized my me. i’m taking fields EmployeeId,EmployeeName, AppraiserID,AppraiserName,ReviewFromDate,ReviewToDate from ListTable…and State field from AppSummaryTable…with respect to the Employee Id from the ListTable…i want to display the Entity dimension for the corresponding emp…

try this and check whether dimension is displaying or not…

static void EmpDim(Args _args)
{
Query q;
QueryRun qr;
QueryBuildDataSource qbds;
QueryBuildRange qbr;
EmplTable emplTable;
EmplId empId;
str dim1;
str dim2;

;
q = new Query();
qbds = q.addDataSource(tablenum(EmplTable));
qbr = qbds.addRange(fieldnum(EmplTable,emplId));
qbr.value(‘000001’); //give here the employee id which u want print the dimension…

qr = new QueryRun(q);
while( qr.next() )
{
emplTable = qr.get(tablenum(EmplTable));

empId = emplTable.EmplId;
dim1 = empltable.Dimension[1];
dim2 = emplTable.Dimension[2];

info(strfmt("%1 - %2 - %3",empId,dim1,dim2));
}
}

Naresh Kolli

then use the listTable.EmploeeId in the find method

Hi Naresh,Thanks for the reply,but will tis hold good for generating my report? and moreover i cannot fix the employee id ,coz my report gets generated at run time

No need to fix the empid there…i just gave the example for one empid to test…

just remove the qbr.value line of code from it…it will run for all the employee…

Kranthi,This is what i have written in the display method-------------- return EmplTable::find(ListTable.EmplId).Dimension[1];