[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

Referencing a body section in a report

Thomaslp

1/28/2006 2:01:00 PM

Hi,

I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
report from which I would like to reference the body section of the reports
design node. Is this possible? Could somebody help me with the syntax.

Thanks.
Thomas
6 Answers

Steen Andreasen

1/28/2006 9:21:00 PM

0

Hi Thomas,

Are you looking for a handle to modify body section at runtime? If so,
go to the property sheet for you body section at set the property
AutoDeclaration to Yes. By that you can reference the body section
typing the name of the body section from X++.

You can download a chapter on creating report in Axapta from my website
- see link below.

Best Regards
Steen Andreasen
http://www.steenandreasen.com/axap...

Thomaslp wrote:

>Hi,
>
>I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
>report from which I would like to reference the body section of the reports
>design node. Is this possible? Could somebody help me with the syntax.
>
>Thanks.
>Thomas
>
>

--

Thomaslp

1/28/2006 9:31:00 PM

0

Hello Steen,

thank you for your answer. Modifying the body at runtime is exactly what I
wanna do. Unfortunally I am using Axapta 2.5, which don't have the
autodeclaration property. Is there another way that I can do it?

Best regards
Thomas

"Steen Andreasen" wrote:

> Hi Thomas,
>
> Are you looking for a handle to modify body section at runtime? If so,
> go to the property sheet for you body section at set the property
> AutoDeclaration to Yes. By that you can reference the body section
> typing the name of the body section from X++.
>
> You can download a chapter on creating report in Axapta from my website
> - see link below.
>
> Best Regards
> Steen Andreasen
> http://www.steenandreasen.com/axap...
>
> Thomaslp wrote:
>
> >Hi,
> >
> >I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
> >report from which I would like to reference the body section of the reports
> >design node. Is this possible? Could somebody help me with the syntax.
> >
> >Thanks.
> >Thomas
> >
> >
>
> --
>
>

Steen Andreasen

1/28/2006 9:42:00 PM

0

This should do the trick in 2.5:

ReportSection reportSection;
;
reportSection =
element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);

Best Regards
Steen Andreasen
http://www.steenandreasen.com/axap...

Thomaslp wrote:

>Hello Steen,
>
>thank you for your answer. Modifying the body at runtime is exactly what I
>wanna do. Unfortunally I am using Axapta 2.5, which don't have the
>autodeclaration property. Is there another way that I can do it?
>
>Best regards
>Thomas
>
>"Steen Andreasen" wrote:
>
>
>
>>Hi Thomas,
>>
>>Are you looking for a handle to modify body section at runtime? If so,
>>go to the property sheet for you body section at set the property
>>AutoDeclaration to Yes. By that you can reference the body section
>>typing the name of the body section from X++.
>>
>>You can download a chapter on creating report in Axapta from my website
>>- see link below.
>>
>>Best Regards
>>Steen Andreasen
>>http://www.steenandreasen.com/axap...
>>
>>Thomaslp wrote:
>>
>>
>>
>>>Hi,
>>>
>>>I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
>>>report from which I would like to reference the body section of the reports
>>>design node. Is this possible? Could somebody help me with the syntax.
>>>
>>>Thanks.
>>>Thomas
>>>
>>>
>>>
>>>
>>--
>>
>>
>>
>>
--

Thomaslp

1/28/2006 10:27:00 PM

0

Hello Steen,

thank your for your quick reply. I tried testing this and have made a simple
report that overloads the fetch() method with the following code:

public boolean fetch()
{
boolean ret;
QueryRun qr;
ReportSection reportSection;
;
reportSection =
element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);
reportSection.lineBelow(1);

qr = new QueryRun(element);
if(qr.prompt() && element.prompt())
{
while(qr.next())
{
custTable_1 = qr.get(tableNum(CustTable));
if(qr.changed(tableNum(CustTable)))
{
element.send(CustTable_1,1);
}
}
ret = true;
}
return ret;
}

With the handle I want to modify the lineBelow property at runtime. The code
compiles and the report runs fine. But unfortunally I don't get any line on
the report :(

Can you tell me where the problem is?


"Steen Andreasen" wrote:

> This should do the trick in 2.5:
>
> ReportSection reportSection;
> ;
> reportSection =
> element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);
>
> Best Regards
> Steen Andreasen
> http://www.steenandreasen.com/axap...
>
> Thomaslp wrote:
>
> >Hello Steen,
> >
> >thank you for your answer. Modifying the body at runtime is exactly what I
> >wanna do. Unfortunally I am using Axapta 2.5, which don't have the
> >autodeclaration property. Is there another way that I can do it?
> >
> >Best regards
> >Thomas
> >
> >"Steen Andreasen" wrote:
> >
> >
> >
> >>Hi Thomas,
> >>
> >>Are you looking for a handle to modify body section at runtime? If so,
> >>go to the property sheet for you body section at set the property
> >>AutoDeclaration to Yes. By that you can reference the body section
> >>typing the name of the body section from X++.
> >>
> >>You can download a chapter on creating report in Axapta from my website
> >>- see link below.
> >>
> >>Best Regards
> >>Steen Andreasen
> >>http://www.steenandreasen.com/axap...
> >>
> >>Thomaslp wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>
> >>>I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
> >>>report from which I would like to reference the body section of the reports
> >>>design node. Is this possible? Could somebody help me with the syntax.
> >>>
> >>>Thanks.
> >>>Thomas
> >>>
> >>>
> >>>
> >>>
> >>--
> >>
> >>
> >>
> >>
> --
>
>

Steen Andreasen

1/29/2006 8:47:00 AM

0

You should initiate reportSection after the if statement calling the
dialogs. As the property you override is not depended on the outcome of
fetch() you could just override executeSection() on the CustTable body
section, and add the following before super() :

this.lineBelow(LineType::Solid);

Best Regards
Steen Andreasen
http://www.steenandreasen.com/axap...

Thomaslp wrote:

>Hello Steen,
>
>thank your for your quick reply. I tried testing this and have made a simple
>report that overloads the fetch() method with the following code:
>
>public boolean fetch()
>{
> boolean ret;
> QueryRun qr;
> ReportSection reportSection;
> ;
> reportSection =
>element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);
> reportSection.lineBelow(1);
>
> qr = new QueryRun(element);
> if(qr.prompt() && element.prompt())
> {
> while(qr.next())
> {
> custTable_1 = qr.get(tableNum(CustTable));
> if(qr.changed(tableNum(CustTable)))
> {
> element.send(CustTable_1,1);
> }
> }
> ret = true;
> }
> return ret;
>}
>
>With the handle I want to modify the lineBelow property at runtime. The code
>compiles and the report runs fine. But unfortunally I don't get any line on
>the report :(
>
>Can you tell me where the problem is?
>
>
>"Steen Andreasen" wrote:
>
>
>
>>This should do the trick in 2.5:
>>
>>ReportSection reportSection;
>>;
>>reportSection =
>>element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);
>>
>>Best Regards
>>Steen Andreasen
>>http://www.steenandreasen.com/axap...
>>
>>Thomaslp wrote:
>>
>>
>>
>>>Hello Steen,
>>>
>>>thank you for your answer. Modifying the body at runtime is exactly what I
>>>wanna do. Unfortunally I am using Axapta 2.5, which don't have the
>>>autodeclaration property. Is there another way that I can do it?
>>>
>>>Best regards
>>>Thomas
>>>
>>>"Steen Andreasen" wrote:
>>>
>>>
>>>
>>>
>>>
>>>>Hi Thomas,
>>>>
>>>>Are you looking for a handle to modify body section at runtime? If so,
>>>>go to the property sheet for you body section at set the property
>>>>AutoDeclaration to Yes. By that you can reference the body section
>>>>typing the name of the body section from X++.
>>>>
>>>>You can download a chapter on creating report in Axapta from my website
>>>>- see link below.
>>>>
>>>>Best Regards
>>>>Steen Andreasen
>>>>http://www.steenandreasen.com/axap...
>>>>
>>>>Thomaslp wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
>>>>>report from which I would like to reference the body section of the reports
>>>>>design node. Is this possible? Could somebody help me with the syntax.
>>>>>
>>>>>Thanks.
>>>>>Thomas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>--
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>--
>>
>>
>>
>>

Thomaslp

1/29/2006 11:43:00 AM

0

Hi Steen,

Thank you for your help. It now works fine. I do not think that I can use
the executeSection(). My report have 2 body sections. One with Vendor
information and one with information about Vendor bank accounts. In cases
where there are no bank account specified for a vendor I want to skip the
information in the report for that specific vendor and then make a
"linebelow". So with the code that you have helped me with I can now choose
if the linebelow shold be generated by the vendor body section or the vendor
bank account body section.

Best regards
Thomas

"Steen Andreasen" wrote:

> You should initiate reportSection after the if statement calling the
> dialogs. As the property you override is not depended on the outcome of
> fetch() you could just override executeSection() on the CustTable body
> section, and add the following before super() :
>
> this.lineBelow(LineType::Solid);
>
> Best Regards
> Steen Andreasen
> http://www.steenandreasen.com/axap...
>
> Thomaslp wrote:
>
> >Hello Steen,
> >
> >thank your for your quick reply. I tried testing this and have made a simple
> >report that overloads the fetch() method with the following code:
> >
> >public boolean fetch()
> >{
> > boolean ret;
> > QueryRun qr;
> > ReportSection reportSection;
> > ;
> > reportSection =
> >element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);
> > reportSection.lineBelow(1);
> >
> > qr = new QueryRun(element);
> > if(qr.prompt() && element.prompt())
> > {
> > while(qr.next())
> > {
> > custTable_1 = qr.get(tableNum(CustTable));
> > if(qr.changed(tableNum(CustTable)))
> > {
> > element.send(CustTable_1,1);
> > }
> > }
> > ret = true;
> > }
> > return ret;
> >}
> >
> >With the handle I want to modify the lineBelow property at runtime. The code
> >compiles and the report runs fine. But unfortunally I don't get any line on
> >the report :(
> >
> >Can you tell me where the problem is?
> >
> >
> >"Steen Andreasen" wrote:
> >
> >
> >
> >>This should do the trick in 2.5:
> >>
> >>ReportSection reportSection;
> >>;
> >>reportSection =
> >>element.design().sectionGroup(tablenum(CustTable)).section(ReportBlockType::BODY);
> >>
> >>Best Regards
> >>Steen Andreasen
> >>http://www.steenandreasen.com/axap...
> >>
> >>Thomaslp wrote:
> >>
> >>
> >>
> >>>Hello Steen,
> >>>
> >>>thank you for your answer. Modifying the body at runtime is exactly what I
> >>>wanna do. Unfortunally I am using Axapta 2.5, which don't have the
> >>>autodeclaration property. Is there another way that I can do it?
> >>>
> >>>Best regards
> >>>Thomas
> >>>
> >>>"Steen Andreasen" wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Hi Thomas,
> >>>>
> >>>>Are you looking for a handle to modify body section at runtime? If so,
> >>>>go to the property sheet for you body section at set the property
> >>>>AutoDeclaration to Yes. By that you can reference the body section
> >>>>typing the name of the body section from X++.
> >>>>
> >>>>You can download a chapter on creating report in Axapta from my website
> >>>>- see link below.
> >>>>
> >>>>Best Regards
> >>>>Steen Andreasen
> >>>>http://www.steenandreasen.com/axap...
> >>>>
> >>>>Thomaslp wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>Hi,
> >>>>>
> >>>>>I am pretty new to Axapta and X++. I have an overloaded fetch() method on a
> >>>>>report from which I would like to reference the body section of the reports
> >>>>>design node. Is this possible? Could somebody help me with the syntax.
> >>>>>
> >>>>>Thanks.
> >>>>>Thomas
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>--
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>--
> >>
> >>
> >>
> >>
>