Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Report isn't displaying data

Posted on by 200

In GP2010, I created a temp table, a report, and a procedure wherein I pass the temp table and run a report on that table. The procedure is going to be invoked from a plugin to run the report. I've used dag.exe to generate a dll so I can access the table and the procedure from the plugin code. I'm able to put rows into this temp table and iterate through the rows and have them show up using MessageBox.Show() in the plugin. When I pass the table from the plugin into the dexterity procedure I'm able to retrieve that data and display them in warning messages in dex code. But when I run a report on this table it doesn't show anything. It's like the data doesn't exist.

What am I missing here? Is there something weird happening when passing the table from the plugin in C# code to a Procedure in dex code to I don't know about?

Here is my sample code

 private void RunBatchReport(string legend1, string legend2)
{
    TableError error;
    var batchReportsTable = MyDexterity.Tables.BatchReport;
    var batchReports = service.GetBatchReports(Dynamics.Globals.UserId.Value, 
                       Dynamics.Globals.CompanyId.Value.ToString(), legend2);
    batchReportsTable.Clear();
    foreach (var report in batchReports)
    {
        batchReportsTable.Id.Value = report.Id.ToString();
        batchReportsTable.ReferenceNum.Value = report.ReferenceNumber ?? "";
        batchReportsTable.Name.Value = report.Name ?? "";
        batchReportsTable.MasterNumber.Value = report.MasterNumber;
                
        error = batchReportsTable.Save();
        if (error != TableError.NoError)
            MessageBox.Show("error saving report - " + error.ToString());
    }
    MyDexterity.Procedures.RunBatchReport.Invoke(legend1, legend2, batchReportsTable);
    batchReportsTable.Close();
}

**** Run_Batch_Report **** Dex code
in string legend1, legend2;
inout table Batch_Report;
run report 'Batch_Report' legends legend1, legend2;

*This post is locked for comments

  • Verified answer
    JQ_anonbot Profile Picture
    JQ_anonbot 200 on at
    RE: Report isn't displaying data

    Found a solution. What I did was to copy the table and rename it slightly

    so in Dex my code would look like

    in string legend1, legend2;
    inout table Batch_Report_FromPlugin;
    {Clone table}
    range clear table Batch_Report_FromPlugin;
    range start table Batch_Report_FromPlugin;
    range end table Batch_Report_FromPlugin;
    range copy table Batch_Report to table Batch_Report;

    run report 'Batch_Report' legends legend1, legend2;

  • JQ_anonbot Profile Picture
    JQ_anonbot 200 on at
    RE: Report isn't displaying data

    Still looking for an answer for this. It seems I can't pass in my table I created from my plugin to an invoked procedure to run GP's report. Is there anyway .Net call I can make to run reports from the plugin?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans