web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Temporary tables in report

(0) ShareShare
ReportReport
Posted on by 40

I tried searching for an answer, not really making any progress.

I am writing a report based on tempTableDB. This report leverages existing functionality that was written by an earlier developer to display same data in the form. Now I need to use the same functionality in a report (and no, they want a separate report dont want to use excel download). This is my code in processReport method

invoicePaymJournalTmp = globalCustomerRevenue.processRevenueReport(today() - 365, today(), invoicePaymJournalTmp, companyIds, false);

select * from avaInvoicePaymJournalTmp;

InvoicePaymJournalTmp is the name of the existing tempDB table.  globalCustomerRevenue is the name of the class that processes data for the form.

I can see that the data is getting inserted. However, nothing gets displayed in the report. I believe that the data gets discarded as soon as execution is done before report is displayed.

Any solution? I tried to use the same pattern as custAccountStatementExtDP but getting in valid table name when I try to set .existingPhyicalTablename.

I have the same question (0)
  • Martin Dráb Profile Picture
    236,330 Most Valuable Professional on at
    RE: Temporary tables in report

    Which class does your RDP class extend? SRSReportDataProviderBase? SRSReportDataProviderPreProcessTempDB?

  • HBrook Profile Picture
    40 on at
    RE: Temporary tables in report

    SrsReportDataProviderPreProcessTempDB

  • Martin Dráb Profile Picture
    236,330 Most Valuable Professional on at
    RE: Temporary tables in report

    Based on what you said, your class should look somehow like this.

    class MyRdp extends SrsReportDataProviderPreProcessTempDB
    {
    	InvoicePaymJournalTmp invoicePaymJournalTmp;
    	
    	[SRSReportDataSetAttribute("InvoicePaymJournalTmp")]
    	public InvoicePaymJournalTmp getInvoicePaymJournalTmp()
    	{
    		select * from invoicePaymJournalTmp;
    		return invoicePaymJournalTmp;
    	}
    	
    	public void processReport()
    	{
    		GlobalCustomerRevenue globalCustomerRevenue = ...
    		var companyIds = ...
    		
    		invoicePaymJournalTmp = globalCustomerRevenue.processRevenueReport(today() - 365, today(), invoicePaymJournalTmp, companyIds, false);
    		
    		// Test code - you get data when you run this
    		while select invoicePaymJournalTmp
    		{
    		
    		}
    	}
    }

    Is it the case?

    Have you generated CIL after compiling code?

    By the way, that nothing is displayed in a report doesn't necessarily mean that RDP class doesn't work correctly. Maybe the problem is in the report itself. You can test it with a regular table.

  • Suggested answer
    abdultp Profile Picture
    867 on at
    RE: Temporary tables in report

    Hi,

    Did you try with restarting of sql server reporting services?

  • Suggested answer
    HBrook Profile Picture
    40 on at
    RE: Temporary tables in report

    This is weird, I thought I posted a reply yesterday. I can see that ax was messing up with temporary tables name hence data was not getting inserted. Tried insertdataset and query::insert etc that did not work either, some kind of sql locking. This has been used successfully in custaccountstatementextdp. So there must be a way. I simply created a new temporary table and looped through earlier one to insert data in the new table (insert_recordset and query::insert still did not work). Can't afford to spend more time fighting this.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,004

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 865 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 582 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans