Discussion:
Records in report
(too old to reply)
Sum
2007-10-08 13:04:01 UTC
Permalink
Dear All,

I just want to know that if there are 'n' lines in report for a particular
query,then I have to display the first record with all the fields
displayed,then the other lines for the same query should not display few
fields.

I cant use the controlname.visible for the same.Is there anyother ways that
i can do this using some query or select conditions. If so please let me know
where to write, whther in fetch or send or executesection of that body.

If I use Programmablesection for that values alone, How can i stop the
records for the query, as the same records are printed again with all the
values displayed.

Seeking for help how to proceed.

Regards,
Justin Biggs
2007-10-08 16:51:01 UTC
Permalink
Hi Sum,

Here's one way I can think of to do that using a ProgrammableSection. For
the fields you don't wish to show, make those fields not visible. Create the
ProgrammableSection to look just like the normal data source, including the
fields you want to show every 10 records or so.

Now in the fetch method, add an integer control variable in the local
variables section. Every selection of of the record that gets written to the
report, increment this variable. Then (using a variable name of 'i' and 10
record intervals) every time you run through the selection run a check (if i
MOD 10 == 0), execute your Programmable section instead of sending the record
to the report. All other times, send the buffer as normal.

Hope this helps.
--
Best Regards,
Justin
Post by Sum
Dear All,
I just want to know that if there are 'n' lines in report for a particular
query,then I have to display the first record with all the fields
displayed,then the other lines for the same query should not display few
fields.
I cant use the controlname.visible for the same.Is there anyother ways that
i can do this using some query or select conditions. If so please let me know
where to write, whther in fetch or send or executesection of that body.
If I use Programmablesection for that values alone, How can i stop the
records for the query, as the same records are printed again with all the
values displayed.
Seeking for help how to proceed.
Regards,
Sum
2007-10-09 07:00:00 UTC
Permalink
Hi Justin,

I got your point, but then how to use it in the fetch method. Can you give
me the code for the same and also my report is displayed based on one
workcenter per page. ie., i have a written a logic in send method that if
another workcenterid then element.newpage(), It could be of great help if you
provide me with code.

Thanks,
Sum
Post by Justin Biggs
Hi Sum,
Here's one way I can think of to do that using a ProgrammableSection. For
the fields you don't wish to show, make those fields not visible. Create the
ProgrammableSection to look just like the normal data source, including the
fields you want to show every 10 records or so.
Now in the fetch method, add an integer control variable in the local
variables section. Every selection of of the record that gets written to the
report, increment this variable. Then (using a variable name of 'i' and 10
record intervals) every time you run through the selection run a check (if i
MOD 10 == 0), execute your Programmable section instead of sending the record
to the report. All other times, send the buffer as normal.
Hope this helps.
--
Best Regards,
Justin
Post by Sum
Dear All,
I just want to know that if there are 'n' lines in report for a particular
query,then I have to display the first record with all the fields
displayed,then the other lines for the same query should not display few
fields.
I cant use the controlname.visible for the same.Is there anyother ways that
i can do this using some query or select conditions. If so please let me know
where to write, whther in fetch or send or executesection of that body.
If I use Programmablesection for that values alone, How can i stop the
records for the query, as the same records are printed again with all the
values displayed.
Seeking for help how to proceed.
Regards,
Justin Biggs
2007-10-09 13:57:01 UTC
Permalink
Try something like the following pseudocode in your fetch (I think you may
need to move your code that tests the workcenterid from the executeSection()
method to the fetch):

WorkCenterId lastId;
;
...
while select myTable where myTable.criteria == true
{
if (lastId == '') // handles first loop
{
lastId = myTable.WorkCenterId
}
...
if (lastId == myTable.WorkCenterId)
{
//in the case of the same workid, execute
//the section that has select columns
element.execute(1); //or whatever section#
}
else
{
//newpage and just execute the normal send which has
//all columns
element.newPage();
element.send(myTable);

//and update the last workcenter you used
lastId = myTable.WorkCenterId;
}
...
}
...

Good luck.
--
Best Regards,
Justin
Post by Sum
Hi Justin,
I got your point, but then how to use it in the fetch method. Can you give
me the code for the same and also my report is displayed based on one
workcenter per page. ie., i have a written a logic in send method that if
another workcenterid then element.newpage(), It could be of great help if you
provide me with code.
Thanks,
Sum
Post by Justin Biggs
Hi Sum,
Here's one way I can think of to do that using a ProgrammableSection. For
the fields you don't wish to show, make those fields not visible. Create the
ProgrammableSection to look just like the normal data source, including the
fields you want to show every 10 records or so.
Now in the fetch method, add an integer control variable in the local
variables section. Every selection of of the record that gets written to the
report, increment this variable. Then (using a variable name of 'i' and 10
record intervals) every time you run through the selection run a check (if i
MOD 10 == 0), execute your Programmable section instead of sending the record
to the report. All other times, send the buffer as normal.
Hope this helps.
--
Best Regards,
Justin
Post by Sum
Dear All,
I just want to know that if there are 'n' lines in report for a particular
query,then I have to display the first record with all the fields
displayed,then the other lines for the same query should not display few
fields.
I cant use the controlname.visible for the same.Is there anyother ways that
i can do this using some query or select conditions. If so please let me know
where to write, whther in fetch or send or executesection of that body.
If I use Programmablesection for that values alone, How can i stop the
records for the query, as the same records are printed again with all the
values displayed.
Seeking for help how to proceed.
Regards,
Kireet Kumar
2011-11-21 11:10:26 UTC
Permalink
CAN YOU HELP ME IN THIS
IN THE BELOW CODE, IT'S FOR PRINTING 12 LINE IN TO THE BODY THEN MOVE TO THE NEXT pAGE, BUT IT DOESN'T PRINT ANYTHING AND MOVES TO THE NEXT PAGE.
void executeSection()
{
if(counter >= 12)
{
element.newPage();
counter = 0;
}

//super();
counter++;
info(num2str(counter,0,0,1,2));
}
AND IF I REMOVE THE COMENT ON SUPER() THEN IT GOES INTO THE INFINITY LOOP.
THANX IN ADVANCE
Post by Sum
Dear All,
I just want to know that if there are 'n' lines in report for a particular
query,then I have to display the first record with all the fields
displayed,then the other lines for the same query should not display few
fields.
I cant use the controlname.visible for the same.Is there anyother ways that
i can do this using some query or select conditions. If so please let me know
where to write, whther in fetch or send or executesection of that body.
If I use Programmablesection for that values alone, How can i stop the
records for the query, as the same records are printed again with all the
values displayed.
Seeking for help how to proceed.
Regards,
Post by Justin Biggs
Hi Sum,
Here's one way I can think of to do that using a ProgrammableSection. For
the fields you don't wish to show, make those fields not visible. Create the
ProgrammableSection to look just like the normal data source, including the
fields you want to show every 10 records or so.
Now in the fetch method, add an integer control variable in the local
variables section. Every selection of of the record that gets written to the
report, increment this variable. Then (using a variable name of 'i' and 10
record intervals) every time you run through the selection run a check (if i
MOD 10 == 0), execute your Programmable section instead of sending the record
to the report. All other times, send the buffer as normal.
Hope this helps.
--
Best Regards,
Justin
Post by Sum
Hi Justin,
I got your point, but then how to use it in the fetch method. Can you give
me the code for the same and also my report is displayed based on one
workcenter per page. ie., i have a written a logic in send method that if
another workcenterid then element.newpage(), It could be of great help if you
provide me with code.
Thanks,
Sum
Post by Justin Biggs
Try something like the following pseudocode in your fetch (I think you may
need to move your code that tests the workcenterid from the executeSection()
WorkCenterId lastId;
;
...
while select myTable where myTable.criteria == true
{
if (lastId == '') // handles first loop
{
lastId = myTable.WorkCenterId
}
...
if (lastId == myTable.WorkCenterId)
{
//in the case of the same workid, execute
//the section that has select columns
element.execute(1); //or whatever section#
}
else
{
//newpage and just execute the normal send which has
//all columns
element.newPage();
element.send(myTable);
//and update the last workcenter you used
lastId = myTable.WorkCenterId;
}
...
}
...
Good luck.
--
Best Regards,
Justin
Post by Gaps In Report New Page
Hi Justin ,
i need ur help iam new to axapta .. in the report i use programmable
section to sort the records for not repeating the label for each salesid and
in the newpage there is some gaps between some records , i dont know y it
comes ...
i need that report without any gaps in the newpages so give me sme idea......
with regards ,
Rajesh
Gaps In Report New Page
2007-12-22 12:07:00 UTC
Permalink
Hi Justin ,

i need ur help iam new to axapta .. in the report i use programmable
section to sort the records for not repeating the label for each salesid and
in the newpage there is some gaps between some records , i dont know y it
comes ...
i need that report without any gaps in the newpages so give me sme idea......

with regards ,
Rajesh
Loading...