[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.axapta.programming

Launching a Report from a form

Raj

1/25/2006 2:17:00 AM

Hi ,
I want to send the report to the printer on click of a button from a
Form ,
My problem is how to pass the Values of the selected record in the form as
parameter to the report , so that the report displays records pertaining only
to the selected record in the grid.

Do any one have Code to do this. I want to do this process using code.

Raj
3 Answers

Luegisdorf

1/25/2006 12:00:00 PM

0

Hi Raj

I suggest to use a RunBaseReport-Class to handle the report. The
RunBaseReport can access the formDataSource of your form if you catch the
args's caller (which is the form).

Hope this helps a litte bit. A code example would be to large to post it here.

regards
Patrick

"Raj" wrote:

> Hi ,
> I want to send the report to the printer on click of a button from a
> Form ,
> My problem is how to pass the Values of the selected record in the form as
> parameter to the report , so that the report displays records pertaining only
> to the selected record in the grid.
>
> Do any one have Code to do this. I want to do this process using code.
>
> Raj

Kyle Alons

1/26/2006 2:17:00 PM

0

Raj,

Check out the helptext for MenuFunction from the AOT \System documentation
\Classes:

==========
A MenuFunction object represents an interface to other Axapta Application
objects. It provides an easy way to access and run any Form, Report, Job,
Class and Query.

Example
This example uses a MenuFunction object to access and run a Tax Report:
{
MenuFunction mf;
ReportRun Report;
Args A = new Args();

// Create a MenuFunction object
mf = new MenuFunction(ReportStr(TaxReporting), MenuItemType::Output);

//Setup arguments to pass to the report.
A.caller(this);
A.record(TaxReportVoucher);
Report = mf.create(A);
Report.run();
}
==========

To make this happen when clicking a button, override the clicked() method on
the form button control.

....or use the ClassFactory to instantiate an object inheriting from
RunbaseReport()....

JFB Smoggy
----

"Raj" <Raj@discussions.microsoft.com> wrote in message
news:254BE7D2-FAC4-4EA8-B192-AAC665F98144@microsoft.com...
> Hi ,
> I want to send the report to the printer on click of a button from
> a
> Form ,
> My problem is how to pass the Values of the selected record in the form as
> parameter to the report , so that the report displays records pertaining
> only
> to the selected record in the grid.
>
> Do any one have Code to do this. I want to do this process using code.
>
> Raj


Raj

2/14/2006 5:53:00 AM

0

Hi ,
Thanks for the help, iam able to display report on click of the button.
i need one help what's happening is even if there is error in the form the
report is getting displayed , is there any method where we can check for
error condition and then display the report if there is no error,

right now error message is getting deisplayed after the report is displayed.

Thanks in advance

rr

"JFB the Smoggy" wrote:

> Raj,
>
> Check out the helptext for MenuFunction from the AOT \System documentation
> \Classes:
>
> ==========
> A MenuFunction object represents an interface to other Axapta Application
> objects. It provides an easy way to access and run any Form, Report, Job,
> Class and Query.
>
> Example
> This example uses a MenuFunction object to access and run a Tax Report:
> {
> MenuFunction mf;
> ReportRun Report;
> Args A = new Args();
>
> // Create a MenuFunction object
> mf = new MenuFunction(ReportStr(TaxReporting), MenuItemType::Output);
>
> //Setup arguments to pass to the report.
> A.caller(this);
> A.record(TaxReportVoucher);
> Report = mf.create(A);
> Report.run();
> }
> ==========
>
> To make this happen when clicking a button, override the clicked() method on
> the form button control.
>
> ....or use the ClassFactory to instantiate an object inheriting from
> RunbaseReport()....
>
> JFB Smoggy
> ----
>
> "Raj" <Raj@discussions.microsoft.com> wrote in message
> news:254BE7D2-FAC4-4EA8-B192-AAC665F98144@microsoft.com...
> > Hi ,
> > I want to send the report to the printer on click of a button from
> > a
> > Form ,
> > My problem is how to pass the Values of the selected record in the form as
> > parameter to the report , so that the report displays records pertaining
> > only
> > to the selected record in the grid.
> >
> > Do any one have Code to do this. I want to do this process using code.
> >
> > Raj
>
>
>