Passing Dataset to Crystal Reports

I know how to build a BAQ Report. I am trying to autoprint or auto preview the report with code. My code is creating the XML correctly (to a point, will explain at end). I am able to pull the XML into crystal to design the report, however the report is not previewing and under the system manager it shows under history as complete but does not preview or show up under the reports tab.

 

 

I also just noticed that all of my Extended UD fields are displaying as blank in the report and XML. The actual field is there, but it displays no data.

I have been searching for an example and cannot find one!

 

I have built a form that will be creating International Documents using UD100 and UD100A. I have created a BAQ with Parameters for the 4 keys that I am using and I can use the DynamicQueryAdapter to get a dataset. Now I am kind of stuck on what I need to do next

Why not use a BAQ Report?


Jose C Gomez

Software Engineer


T: 904.469.1524 mobile
E: jose@…

http://www.josecgomez.com
     Â


Quis custodiet ipsos custodes?


On Mon, Jan 13, 2014 at 4:34 PM, <livingstonmh@...> wrote:

Â
<div>
  
  
  <p></p><p></p><p>I have been searching for an example and cannot find one!</p><p>Â </p><p>I have built a form that will be creating International Documents using UD100 and UD100A. I have created a BAQ with Parameters for the 4 keys that I am using and I can use the DynamicQueryAdapter to get a dataset. Now I am kind of stuck on what I need to do next<var></var></p>

</div>
 


<div style="color:#fff;min-height:0;"></div>

That is one of the things that I tried.

 

Used this to print preview, however nothing displays. XML is created though...

 

 Epicor.Mfg.Core.Session epiSession = default(Epicor.Mfg.Core.Session);
          epiSession = (Epicor.Mfg.Core.Session)UD100Form.Session;
          Epicor.Mfg.Rpt.BAQReport rptInternational = new Epicor.Mfg.Rpt.BAQReport(epiSession.ConnectionPool);
          Epicor.Mfg.Rpt.BAQReportDataSet rptDSInternational = rptInternational.GetNewParameters();

          EpiDataView edvBPMData  = ((EpiDataView)(oTrans.EpiDataViews["CallContextClientData"]));

          rptDSInternational.Tables["BAQReportParam"].Rows[0]["BAQID"] = "MJP-InternationDocuments";
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["ReportID"] = "International";
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["BAQRptID"] = "International";
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["Filter1"] = "<?xml version = \"1.0\" encoding = \"UTF-8\"?> <BAQReport> <BAQFilter> <TableName>UD100</TableName> <FieldName>Key1</FieldName> <Comparison>=</Comparison> <FieldValue>I0501</FieldValue> <RowIdent>Field1</RowIdent> </BAQFilter> <BAQFilter> <TableName>UD100</TableName> <FieldName>Key2</FieldName> <Comparison>=</Comparison> <FieldValue>Sales Order</FieldValue> <RowIdent>Field2</RowIdent> </BAQFilter> <BAQFilter> <TableName>UD100</TableName> <FieldName>Key3</FieldName> <Comparison>=</Comparison> <FieldValue>2160</FieldValue> <RowIdent>Field3</RowIdent> </BAQFilter> </BAQReport>" ;
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["Option01"] = edvUD100Row["key1"].ToString() ;
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["Option02"] = edvUD100Row["key2"].ToString() ;
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["Option03"] = edvUD100Row["key3"].ToString() ;
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["Option04"] = edvUD100Row["key4"].ToString() ;
    rptDSInternational.Tables["BAQReportParam"].Rows[0]["Summary"] = false;
    rptDSInternational.Tables["BAQReportParam"].Rows[0]["AutoAction"] = "Preview";
    //Set Task Agent
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["AgentID"] = "SystemTaskAgent";

          //Report Style
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["ReportStyleNum"] = 1;
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["WorkStationID"] = Environment.MachineName + " " + edvBPMData.dataView[edvBPMData.Row]["CurrentUserId"];;
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["DateFormat"] = "mm/dd/yyyy";
          rptDSInternational.Tables["BAQReportParam"].Rows[0]["NumericFormat"] = ",.";

          //Submit to Task Agent
          rptInternational.SubmitToAgent(rptDSInternational, "SystemTaskAgent",0,0,"Epicor.Mfg.UIRpt.BAQReport;International");

I'd step back and dig into how to build a BAQ report.  For the basic reports you don't need to do any coding. 


You can add filters using the BAQ report designer.


Jim Kinneman

Encompass Solutions, Inc.