Epicor Discussion Forums Homepage
Forum Home Forum Home > Epicor University > Epicor ERP Tools and Technical
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Execute a Report through a Customization

 Post Reply Post Reply
Author
Message
e2btekLou View Drop Down
Groupie
Groupie


Joined: 19 September 2014
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote e2btekLou Quote  Post ReplyReply Direct Link To This Post Topic: Execute a Report through a Customization
    Posted: 06 October 2015 at 13:58

I have a need to automatically print a custom report in Epicor 10 from a custom button added to the form.  I see using the BL tester that there is a contract I can use to do this, but I do not see an adapter, which is the normal method I know of running a standard Epicor process in a screen customization.

The contract is ERP.Contracts.Rpt.PTranLog.DLL.  Is there an associated adapter for this?  If not has anyone done something similar in a screen customization using only a contract to get a report to print?  If so would you be willing to share that code.

Thanks.

Lou Davis
E2B Teknologies
Back to Top
e2btekLou View Drop Down
Groupie
Groupie


Joined: 19 September 2014
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote e2btekLou Quote  Post ReplyReply Direct Link To This Post Posted: 07 October 2015 at 08:26

Ok I think I found the solution to this.  What threw me off is how the adapters for reports are labeled.  For my purpose I need to print labels using PTranLog.  To do this I needed to add assemblies Erp.Contracts.Rpt.PTranLog and Erp.UIRpt.PTranLog to my screen customization. 

So far in my preliminary testing I have been able to instantiate the report object and execute its GetNewParameters method.  Next step is to preview the report itself, but so far everything seems to be going well so I'm pretty confident I can get this working.

Lou Davis
E2B Teknologies
Back to Top
Vincentan View Drop Down
Newbie
Newbie


Joined: 05 April 2016
Location: Malaysia
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vincentan Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2016 at 06:55
Hi there, nice to hear that.
Can you share the code as i have project here to print the packingslip with specific report style direct from the C# code.

I would like the code to load the default printer.

Thanks in advance.
Back to Top
LeroyMeares View Drop Down
Newbie
Newbie


Joined: 17 February 2017
Location: London
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote LeroyMeares Quote  Post ReplyReply Direct Link To This Post Posted: 17 February 2017 at 09:05

For anyone who stumbles across this as I did when doing some research, here is my code to print preview the Quote form.

I added Erp.Contracts.Rpt.QuotForm and Erp.UIRpt.QuotForm assemblies to the screen.



   EpiDataView edvReportParam = ((EpiDataView)(this.oTrans.EpiDataViews["ReportParam"]));

   Erp.Adapters.QuotFormAdapter rptQuote = new Erp.Adapters.QuotFormAdapter(this.oTrans);
    rptQuote.BOConnect();

   rptQuote.GetNewParameters();

   rptQuote.ReportData.Tables["QuoteFormParam"].Rows[0]["QuoteNum"] = edvReportParam.dataView[edvReportParam.Row]["QuoteNum"].ToString();
   rptQuote.ReportData.Tables["QuoteFormParam"].Rows[0]["AutoAction"] = "SSRSPREVIEW";
   rptQuote.ReportData.Tables["QuoteFormParam"].Rows[0]["ReportStyleNum"] = edvReportParam.dataView[edvReportParam.Row]["ReportStyleNum"].ToString();
   rptQuote.ReportData.Tables["QuoteFormParam"].Rows[0]["PrinterName"] = "\\app1\PrintToAPM";
   rptQuote.ReportData.Tables["QuoteFormParam"].Rows[0]["RowMod"] = "A";

   rptQuote.SubmitToAgent("SystemTaskAgent",0,0);

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.17
Copyright ©2001-2013 Web Wiz Ltd.