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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Ssrs report field not getting populated with correct value

(0) ShareShare
ReportReport
Posted on by 351

Hi.

I am trying to input an enum field from form setup to Free text invoice header. So I have overridden form datasource initValue method to initialize field on new creation. 

Now on generating report the field is showing default value (enum value 0) instead of the chosen value.

CustinvoiceTable.ReportTitle = custFormLetterParameters::find().ReportTitle;

I have even updated the Dp class :

FreetextInvoiceHeaderFooterTmp.ReportTitle = custInvoiceTable.ReportTitle;

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    First of all, debug the RDP class - check if the value gets set and saved.

    If it works, you have a problem in the report design. If it doesn't, you have a problem in the data provider and you can ignore the report for now.

    Locating the problem is crucial for being able to focus on the right component.

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    I assume that ReportTitle is a new field that you have created? Just a reminder, please always use your custom prefix when adding elements to standard objects.

    Did you debug your code? If not, please do. If yes, what did you learn by debugging it? Please share your findings.

    Could you share more of your code? As you can understand, it's impossible to say what could be the problem if we see only these two lines. Where you put those lines makes all the difference!

  • PriyaDutta Profile Picture
    351 on at

    After debugging form data source class , the table field is getting updated.

    But on debugging dp class , the value is getting the default value. 

  • nmaenpaa Profile Picture
    101,166 Moderator on at
    [deleted]
  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    Ok, then we keep waiting to see your code.

    Also, please check that you can see the value in CustInvoiceTable in table browser / SSMS.

    Once you verify that CustInvoiceTable part is working, you can move to next step and copy it to the report temp table.

    Once you have verified that the value is copied to report temp table, you can move to the last step: showing this field on the report.

    By working on one step at a time, it's easy to spot & fix issues.

  • PriyaDutta Profile Picture
    351 on at

    Hi Nikolaos,

    I am not able to see the value in CustInvoiceTable when i debug the dp class, but when I open table browser I can see the values.

    Why isnt it reflecting when i am fetching the field in dp class.

    please find my code snippet from both classes:

    public final void initValue()

       {

           CustInvoiceTable custInvoiceTable;

           next initValue();

           FormDataSource   ds = this;

           custInvoiceTable = ds.cursor();    

           custInvoiceTable.XXXFreeTextReportTitle = CustFormletterParameters::find().XXXReportTitle_FTI;

       }

    protected void populateFreeTextInvoiceHeaderFooterTmp(CustInvoiceJour _custInvoiceJour, CompanyInfo _companyInfo)

       {

           next populateFreeTextInvoiceHeaderFooterTmp(_custInvoiceJour,_companyInfo);

           CustInvoiceTable custInvoiceTable = _custInvoiceJour.custInvoiceTable();

           FreeTextInvoiceHeaderFooterTmp  freeTextInvoiceHeaderFooterTmp     = this.getFreeTextInvoiceHeaderFooterTmp();

           while select freeTextInvoiceHeaderFooterTmp

               where custInvoiceTable.InvoiceId == _custInvoiceJour.InvoiceId

           {

           freeTextInvoiceHeaderFooterTmp.XXXFreeTextReportTitle = custInvoiceTable.XXXFreeTextReportTitle;

           }

       }

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    Next time when sharing code, please click "Use rich text formatting" -> "Insert" -> "Code" so that it's easier to read. Thanks!

    Not sure if your code has other problems, but in your populateFreeTextInvoiceHeaderFooterTmp, you never update the freeTextInvoiceHeaderFooterTmp buffer. So even if the field is correctly copied, it's discarded because you are not updating the table.

    Could this explain your problem?

  • PriyaDutta Profile Picture
    351 on at

    Oh sure.

    Can you help me fetch CustInvoiceTable ? I guess the problem lies there.

    Thanks

    protected void populateFreeTextInvoiceHeaderFooterTmp(CustInvoiceJour _custInvoiceJour, CompanyInfo _companyInfo)
        {
            next populateFreeTextInvoiceHeaderFooterTmp(_custInvoiceJour,_companyInfo);
            CustInvoiceTable custInvoiceTable = _custInvoiceJour.custInvoiceTable();
       
            FreeTextInvoiceHeaderFooterTmp  freeTextInvoiceHeaderFooterTmp     = this.getFreeTextInvoiceHeaderFooterTmp();
            while select forupdate freeTextInvoiceHeaderFooterTmp
                where custInvoiceTable.InvoiceId == _custInvoiceJour.InvoiceId
            {
            freeTextInvoiceHeaderFooterTmp.XXXFreeTextReportTitle = custInvoiceTable.XXXFreeTextReportTitle;
            freeTextInvoiceHeaderFooterTmp.update();
            }
        }

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    Did you verify that the problem lies there?

    You can verify it by debugging populateFreeTextInvoiceHeaderFooterTmp, and checking if your code finds CustInvoiceTable (and whether that's the same CustInvoiceTable that you are looking in the table browser).

    Does your code find the correct CustInvoiceTable or not?

  • PriyaDutta Profile Picture
    351 on at

    Yes. I debugged the method and the table is not getting fetched through custinvoiceJour.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 423 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans