crystal使用表中不同行的记录报告组名称公式(crystal reports group name formula using a record from a different line in table)
我试图使用表中不同行的记录创建一个组名公式,而不是链接到该组中包含的记录的行。
首先,我的数据中包含单词group ,所以为了避免混淆,我将它用斜体区分以区别于Crystal Reports中的组。
我从这个组名中提取记录的表有:
- {GroupSection.Group}库存数据库中的项目组
- {GroupSection.Section}节(这些类似于嵌套在每个库存组中的子组 )。
- {GroupSection.Description}问题从这里开始,因为{GroupSection.Group}和{GroupSection.Section}的描述都存储在这里。
这是我的表的一个示例:
{GroupSection.Group} {GroupSection.Section} {GroupSection.Description} 3.00 0.00 PRECAST CONCRETE PRODUCT 3.00 50.00 MISC PRECAST CONCRETE PRODUCT 3.00 99.00 *Z* MISC PRECAST CONCRETE PRODUC 4.00 0.00 CEMENT SUPPLIES 4.00 50.00 MISC CEMENT SUPPLIES 4.00 99.00 *Z* MISC CEMENT SUPPLIES
此表中的第一行和第四行是{GroupSection.Group}的描述(它们在{GroupSection.Section}行中有0.00),其余是{GroupSection.Section}的描述。 此报告中包含的实际数据位于不同的表中,并且与此表中的前两个字段具有相同的两个字段,但不是第三个字段,因此需要链接并使用此表来对其进行描述。组名。 另一个表没有链接到0.00的行的记录。
我希望我的Group Tree看起来像这样:
3. PRECAST CONCRETE PRODUCT 50 MISC PRECAST CONCRETE 99 *Z* MISC PRECAST CONCRETE 4. CEMENT SUPPLIES 50 MISC CEMENT SUPPLIES 99 *Z* MISC CEMENT SUPPLIES
这是我现在在顶级组的Group Name公式中使用的有缺陷的公式:
ToText (left(Cstr({GroupSection.Group}),2))+ " " + ToText (If {GroupSection.Section} <> 0 then {GroupSection.Description} Else " ")
这是内嵌套组的组名公式(工作正常):
ToText (left(Cstr({GroupSection.Section}),2))+ " " + ToText ({GroupSection.Description})
这就是我的Group Tree现在的样子:
3. MISC PRECAST CONCRETE 50 MISC PRECAST CONCRETE 99 *Z* MISC PRECAST CONCRETE 4. MISC CEMENT SUPPLIES 50 MISC CEMENT SUPPLIES 99 *Z* MISC CEMENT SUPPLIES
正如您所看到的,我需要从表中的第一行获取外部组的名称,即使它将组中的记录链接到表中的第二行和第三行。 合理?
我已尝试在公式中使用previous()但它会出现以下错误:无法使用此函数,因为必须稍后进行评估。
编辑:我也尝试再次添加相同的表并将其链接到组 ,一次链接到该部分 ,它适用于组名称,但现在我有190万条记录,真的重复了一些。 除非我能弄清楚如何修复多个记录,否则这将无法工作。
“。” 在组名描述中是一个无关的问题。 这是我能做到最好的3.00显示为3和50.00显示为50。
谢谢你的帮助!
编辑2013年12月30日的用户@Promethean:
对不起,我是SQL Command Tables的新手。 我从另一个报告中获取了一个命令表并对其进行了一些更改。 这是我得到了多远:
SELECT "GroupSection"."Group", "GroupSection"."Section", "GroupSection"."Description" FROM ("SpruceDotNet"."dbo"."InventoryCommon" "InventoryCommon" with (nolock) INNER JOIN "SpruceDotNet"."dbo"."GroupSection" "GroupSection" with (nolock) ON "InventoryCommon"."Group"="GroupSection"."Group") WHERE "GroupSection"."Section"=0 ORDER BY "InventoryCommon"."Group"
你有没有机会使用这个信息修改你的命令表,所以像我这样的假人可以遵循它? 看起来你要两次添加其中一个字段,但我并不遵循一切。
然后你将如何将命令表加入包含更详细的更大的表? 我必须使用正确的联接,所以我最终不会重复记录?
任何帮助是极大的赞赏。
I am trying to create a group name formula using a record from a different line in the table than the line that the records contained in this group are linked to.
First off, my data has the word group in it, so to avoid confusion I have italicized it to differentiate it from groups in Crystal Reports.
My table that I am pulling the records for this group name from has:
- {GroupSection.Group} Groups of items in our inventory database
- {GroupSection.Section} Sections (these are like subgroups nested within each inventory group).
- {GroupSection.Description} The problems start here because the descriptions for {GroupSection.Group} and {GroupSection.Section} are both stored here.
This is a sample of my table:
{GroupSection.Group} {GroupSection.Section} {GroupSection.Description} 3.00 0.00 PRECAST CONCRETE PRODUCT 3.00 50.00 MISC PRECAST CONCRETE PRODUCT 3.00 99.00 *Z* MISC PRECAST CONCRETE PRODUC 4.00 0.00 CEMENT SUPPLIES 4.00 50.00 MISC CEMENT SUPPLIES 4.00 99.00 *Z* MISC CEMENT SUPPLIES
The first and fourth line in this table are descriptions for {GroupSection.Group} (they have a 0.00 in the {GroupSection.Section} line) and the rest are descriptions for {GroupSection.Section}. The actual data that is contained in this report is in a different table and has the same two fields as the first two in this table, but not the third field, hence the need to link to and use this table to make the descriptions of the group names. The other table has no records that link to the lines with 0.00.
I want my Group Tree to look like this:
3. PRECAST CONCRETE PRODUCT 50 MISC PRECAST CONCRETE 99 *Z* MISC PRECAST CONCRETE 4. CEMENT SUPPLIES 50 MISC CEMENT SUPPLIES 99 *Z* MISC CEMENT SUPPLIES
This is the flawed formula I am using now in the Group Name formula for the top group:
ToText (left(Cstr({GroupSection.Group}),2))+ " " + ToText (If {GroupSection.Section} <> 0 then {GroupSection.Description} Else " ")
This is the Group Name formula for the inner nested group (working fine):
ToText (left(Cstr({GroupSection.Section}),2))+ " " + ToText ({GroupSection.Description})
This is what my Group Tree looks like now:
3. MISC PRECAST CONCRETE 50 MISC PRECAST CONCRETE 99 *Z* MISC PRECAST CONCRETE 4. MISC CEMENT SUPPLIES 50 MISC CEMENT SUPPLIES 99 *Z* MISC CEMENT SUPPLIES
As you can see, I need to get the name for the outer group from the first row in the table even though it's linking the records that are in the group to the second and third row in the table. Make sense?
I have tried using previous() in the formula but it gives the following error: This function cannot be used because it must be evaluated later.
Edit: I also just tried adding the same table again and linking it once to the group and once to the section and it worked for the group names, but now I have 1.9 million records, something really duplicated. So that won't work unless I can figure out how to fix the multiple records.
The "." in the group name description is an unrelated problem. It's the best I can do to get 3.00 to display as 3 and 50.00 to display as 50.
Thanks for any help!
Edit Dec 30, 2013 for user @Promethean:
Sorry I am new at SQL Command Tables. I took a command table from another report and did some changes to it. This is how far I got:
SELECT "GroupSection"."Group", "GroupSection"."Section", "GroupSection"."Description" FROM ("SpruceDotNet"."dbo"."InventoryCommon" "InventoryCommon" with (nolock) INNER JOIN "SpruceDotNet"."dbo"."GroupSection" "GroupSection" with (nolock) ON "InventoryCommon"."Group"="GroupSection"."Group") WHERE "GroupSection"."Section"=0 ORDER BY "InventoryCommon"."Group"
Is there any chance you could use this info to modify your command table so a dummy like me can follow it? It looks like you are adding one of the fields twice, but I don't follow everything.
And then how would you join the command table to the bigger table that contains the more detailed? I would have to use the right kind of join so I don't end up duplicating the records?
Any help is greatly appreciated.
原文:https://stackoverflow.com/questions/20507474
最满意答案
我可以添加菜单项。我在方法load_administration_settings中检查了moodle / lib / navigationlib.php,类settings_navigation,如下所示:
$referencebranch = $this->add(get_string('administrationsite'), null, self::TYPE_SITE_ADMIN, null, 'root');
因此,对于“root”,navigation_node类型必须是 TYPE_SITE_ADMIN,而不是TYPE_SETTING。
在firefox firebug中,我之前注意到在加载站点管理菜单的ajax调用中,“root”的css类被命名为TYPE_SITE_ADMIN。
请注意,我还无法激活新菜单项。 请注意,使用$ PAGE的那部分是评论。
function local_setmotd_extends_settings_navigation(settings_navigation $settingsnav, context $context) { global $CFG, $PAGE; /* // Only let users with the appropriate capability see this settings item. if( ! has_capability('local/setmotd:view', $context) ) { return; } */ $settingnode = $settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN); if( $settingnode ) { $setMotdMenuLbl = get_string('menutitle', 'local_setmotd'); $setMotdUrl = new moodle_url('/local/setmotd/set_motd.php'); $setMotdnode = navigation_node::create( $setMotdMenuLbl, $setMotdUrl, navigation_node::NODETYPE_LEAF); /* if ($PAGE->$setMotdUrl->compare($setMotdUrl, URL_MATCH_BASE)) { $setMotdnode->make_active(); } */ $settingnode->add_node($setMotdnode); } }
I am able to add menu item.I checked in moodle/lib/navigationlib.php , class settings_navigation in method load_administration_settings, the following line :
$referencebranch = $this->add(get_string('administrationsite'), null, self::TYPE_SITE_ADMIN, null, 'root');
So, with "root", the navigation_node type has to be TYPE_SITE_ADMIN, not TYPE_SETTING.
In firefox firebug, I had earlier noticed in the ajax call for loading site administration menu, that the css class for "root" was named TYPE_SITE_ADMIN.
Note, that I am not yet able to make the new menu item active. So notice that, that part using $PAGE, is commented.
function local_setmotd_extends_settings_navigation(settings_navigation $settingsnav, context $context) { global $CFG, $PAGE; /* // Only let users with the appropriate capability see this settings item. if( ! has_capability('local/setmotd:view', $context) ) { return; } */ $settingnode = $settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN); if( $settingnode ) { $setMotdMenuLbl = get_string('menutitle', 'local_setmotd'); $setMotdUrl = new moodle_url('/local/setmotd/set_motd.php'); $setMotdnode = navigation_node::create( $setMotdMenuLbl, $setMotdUrl, navigation_node::NODETYPE_LEAF); /* if ($PAGE->$setMotdUrl->compare($setMotdUrl, URL_MATCH_BASE)) { $setMotdnode->make_active(); } */ $settingnode->add_node($setMotdnode); } }
相关问答
更多-
改变这个: // 'parent_url' => get_option('siteurl').'/shop', // 'parent_slug' => $bp->profile->slug, 对此: 'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug, 然后尝试这个: function gift_card_s ...
-
菜单项可见但不应该(Menu Item visible but shouldn't)[2021-10-16]
这似乎是不可能的。 用户不能同时在两个组中。 如果“注册”组被带走,那么一切都按预期工作。 只有其他需要做的事情是,在“具有查看访问权限的用户组”下的“已注册”访问级别中检查此“创建者”组 This seems to be impossible. The user cannot be in both groups. If the 'Registered' group is taken away then everything works as intended. Only other thing that ... -
将菜单项添加到管理菜单(Add menu items to admin menu)[2023-03-02]
项目名称不能在一个分支中重复。 给它另一个名字。 喜欢: Remote Access Logs 9 adminhtml ... -
WP管理菜单编辑器插件是可让您完全控制您的wp-admin菜单的插件之一。 This was the answer to my question... function wpse28782_remove_menu_items() { if( !current_user_can( 'administrator' ) ): remove_submenu_page( 'admin.php', 'stock-manager' ); add it to your theme's functions.php
-
.Moodle本地插件,菜单项未添加到站点管理(.Moodle Local plugin , menu item not getting added to Site Administration)[2022-06-15]
我可以添加菜单项。我在方法load_administration_settings中检查了moodle / lib / navigationlib.php,类settings_navigation,如下所示: $referencebranch = $this->add(get_string('administrationsite'), null, self::TYPE_SITE_ADMIN, null, 'root'); 因此,对于“root”,navigation_node类型必须是 TYPE_SITE ... -
如何检查菜单项已添加到onprepareoptionsmenu中(How to check menu item are already added in onprepareoptionsmenu)[2020-11-14]
menu.add(0, 9, 0, "search") 这里9是添加项目的ID,你可以得到它 menu.findItem(9) menu.add(0, 9, 0, "search") here 9 is id for added item you can get it by menu.findItem(9) -
这是一个例子: XAML: 代码背后: public MainWindow() { InitializeComponent(); MenuItem item = new MenuItem { Header = "test" }; item.Click += new RoutedEventH ...
-
以下是您可以使用jQuery进行基础的逻辑 //suppose your menu is this//the ...
-
试试这个链接 在预蜂窝状态下,ActionBarSherlock的溢出菜单(即,不适合操作栏的项目)将默认放置在常规选项菜单中。 并且可以试试 menu.add("Save") .setIcon(R.drawable.save) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); try as per this link On pre-Honeycom ...
-
从Orchard 1.5.0开始, INavigationProvider不用于在前端构建菜单(它仍然用于构建仪表板的管理菜单)。 您需要实现IMenuProvider或INavigationFilter 。 请参阅David Hayden博客上的这篇文章以获取一些建议 。 您还可以在Orchard.Projections和Orchard.CulturePicker中找到很好的示例。 From Orchard 1.5.0 onwards, INavigationProvider isn't used to ...