提取方法未在报告中获取第一个值 [英] Fetch Method Not Picking Up First Value On Report

查看:83
本文介绍了提取方法未在报告中获取第一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

再次查询我的报告... 我之前曾遇到过此问题并已解决了该问题,但查看了现有报告后,我看不到我要去哪里出了问题,因此希望其他关注此问题的人能够为您提供帮助...

me again with another report query... I've come across this before and resolved the issue, but having checked the existing report I cannot see where I am going wrong, so hopefully someone else looking at this will be able to help...

基本上,我有一个报告,像其他报告一样,有两个标头和一个正文部分,还有一些静态字段作为可编程部分.标头和可编程部分很好,可以按预期运行.主体部分中的数据来自ProdBOM表中的字段,并且该表与我用作数据源的主表之间存在关联.这两个都是我报告中的数据源.

Basically, I have a report like any other, with two headers and a body section, and some static fields as programmable sections. The headers and programmable sections are fine and run as expected. The data within the body section comes from fields within the ProdBOM table, and there is a relationship between this table and the main table I am using as my datasource. Both of these are datasources in my report.

我已将以下代码输入到fetch方法中;

I have input the following code into the fetch method;

public boolean fetch()
{
    ProdBom                 _prodBom;
    LogisticsControlTable   _logisticsControlTable;
    ;

    queryRun = new QueryRun(this);

    if (!queryRun.prompt() || !element.prompt())
    {
        return false;
    }

    while (queryRun.next())
    {
        if (queryRun.changed(tableNum(LogisticsControlTable)))
        {
            _logisticsControlTable = queryRun.get(tableNum(LogisticsControlTable));
            if(_logisticsControlTable)
            {
                element.newPage();
            }
            this.send(_logisticsControlTable);

            if(_logisticsControlTable.ProdId)
            {
                while select _prodBom where _prodBom.ProdId == _logisticsControlTable.ProdId
                {
                    element.send(_prodBom);
                }
            }
        }
    }
    return true;
}

结果是第一页的正文部分没有数据,但随后的页面的正文中有数据,请问有什么原因吗?

The result is that the first page's body section has no data, but the following pages have data in the body, is there any reason why this is happening?

推荐答案

您在第一个send之前显式调用element.newPage(),这将创建一个空白页面.

You explicitly calls element.newPage() before the first send, which creates a blank page.

控制变量可以解决问题:

A control variable will do the trick:

boolean newPage = false;    
...    
if (newPage)
    element.newPage();
else
    newPage = true;

这篇关于提取方法未在报告中获取第一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆