multiple selection of records by check box on form & print report for selected records only

My requirement:

Select multiple records by check box on a form and click on menuitem button so that it should create a report for those selected record only

Challenges: for one selected record it is working but i need if it multiple record how can capture those records and pass through a menuitem. Please help me on this requirement

Hi,

For multiselection of records based on checkbox… use this code…

void clicked()

{

Student inventLocal;

;

super();

//getFirst method gets all the selected records in the grid

inventLocal = Student_ds.getFirst(true);

while (inventLocal)

{

info(strfmt(“You selected Item %1”,inventLocal.Studentid));

// get the next selected record

inventLocal = Student_ds.getNext();

}

}

after fetching the mutiple selected records from the form… take a tempoarary table( duplicate of the table which You are fetching data currrently)…

and insert all the records that are fetched using the above code to temp table…

provide the tmp table as datasource to the report… and delete the data from the table whenever the generate report button is clicked… so that new data will be inserted…

void clicked()

{

InventTransferTable InventTransferTableLocal;

MenuFunction MenuFunction1;

;

MenuFunction1 = new Menufunction(menuitemoutputstr(your manu item name),MenuItemType::Output);

for(InventTransferTableLocal = InventTransferTable_ds.getFirst(true) ? InventTransferTable_ds.getFirst(true) : InventTransferTable; InventTransferTableLocal; InventTransferTableLocal = InventTransferTable_ds.getnext())

{

// do something as per your requirement

}

MenuFunction1.run();

super();

}

do as shown in above code, so that multiple selected records will be passed to your report. do it in the clicked method of that menuitem button.