首页 \ 问答 \ Crystal Reports - 添加分组结果(Crystal Reports - add results of grouping together)

Crystal Reports - 添加分组结果(Crystal Reports - add results of grouping together)

真的是低级别的问题,但是自从我使用Crystal Reports已经5年了,我想确保在我再次使用它之前确定它是合适的 - 我认为它会。

我有两组数据 - 第1组是收入,第2组是费用。 我希望通过一个公式创建一个利润结果,以使第2组的总和远离第1组的总和。如果我记得这很简单,但只是把它放在那里开始。

谢谢


Really low level question, but it's been 5 years since I used Crystal Reports and I want to ensure that before I think about using it again that it would be suitable - I think it will.

I have two groups of data - Group 1 is Income, Group 2 is Expenses. I am looking to create a Profit result by a formula to take the sum of Group 2 away from the sum of Group 1. If I recall this is quite straightforward, but just throwing this one out there to begin with.

Thanks


原文:https://stackoverflow.com/questions/26869777
更新时间:2019-11-09 18:41

最满意答案

https://play.golang.org/p/JGZ7mN0-U-

for k, v := range m { 
    fmt.Printf("key[%s] value[%s]\n", k, v)
}

要么

for k := range m {
    fmt.Printf("key[%s] value[%s]\n", k, m[k])
}

Go语言规范for语句指定第一个值是键,第二个变量是值,但不一定存在。


https://play.golang.org/p/JGZ7mN0-U-

for k, v := range m { 
    fmt.Printf("key[%s] value[%s]\n", k, v)
}

or

for k := range m {
    fmt.Printf("key[%s] value[%s]\n", k, m[k])
}

Go language specs for for statements specifies that the first value is the key, the second variable is the value, but doesn't have to be present.

相关问答

更多
  • https://play.golang.org/p/JGZ7mN0-U- for k, v := range m { fmt.Printf("key[%s] value[%s]\n", k, v) } 要么 for k := range m { fmt.Printf("key[%s] value[%s]\n", k, m[k]) } Go语言规范for语句指定第一个值是键,第二个变量是值,但不一定存在。 https://play.golang.org/p/JGZ7mN0-U- for ...
  • 检查Go模板文档中的变量部分 。 范围可以声明两个变量,用逗号分隔。 以下应该工作: {{ range $key, $value := . }}
  • {{ $key }}: {{ $value }}
  • {{ end }} Check the Variables section in the Go template docs. A range may declare two variables, separated by a comma. The foll ...
  • 这是预期的行为。 (doseq [x ... y ...])将遍历y中每个项目的每个项目。 相反,您应该遍历地图本身一次。 (seq some-map)将返回一个两项目向量的列表,一个用于映射中的每个键/值对。 (真的他们是clojure.lang.MapEntry ,但表现像2项目向量。) user> (seq {:foo 1 :bar 2}) ([:foo 1] [:bar 2]) doseq可以像任何其他的一样迭代这个seq。 像Clojure中的大多数功能与集合一起使用, doseq内部调用seq ...
  • 您可以在除第一个和最后一个元素之外的所有元素上使用map ,并分别处理这两个元素。 通过这种方式,您可以避免对每个元素进行的那些比较。 (define special-map (λ (lst f1 f2) (append (list (f1 (car lst))) (map f2 (drop-right (cdr lst) 1)) (list (f1 (last lst)))))) 例 让我们尝试增加第一个和最后一个元素并减少所有其他元素。 > ...
  • 1- Golang是强类型语言,因此map[int]interface{}与map[interface{}]interface{}不兼容。 int与interface{}类型不同,请参阅: Go:interface {}的含义是什么? 2-不,Golang不支持泛型,这非常好,因为它使语言简单快速。 你有一些选择: 如果您不想更改使用的地图类型: 1-您可以将函数编辑为: func Keys(m map[int]interface{}) []int ,就像这个工作示例代码: package main im ...
  • 您是否因为某些外部原因而特意排除TreeMap ? 如果没有,你可以明显地使用TreeMap和一个特制的Comparator 。 你有没有考虑过其他的SortedMap ? 如果TreeMap肯定出来了,我会扩展HashMap并使它看起来像总是有一个条目,但这绝对不是一件简单的工作。 在走这条路之前,你应该有一个很好的理由不使用SortedMap 。 添加 下面是一个如何使用TreeMap将特定条目排序到最后的例子: // This key should always appear at the end o ...
  • val m = Map(1 -> "a", 2 -> "b", 4 -> "c", 10 -> "d") val s = Set(1,4) m.filterKeys { s.contains(_) == false } // Map(2 -> b, 10 -> d) 但是,如果这是一张巨大的地图和一个巨大的集合,那么我建议先对它们进行排序并相互迭代通过它们,随时挑选需要的位。 对contains的重复调用可能无法达到您想要的效果,特别是如果您使用List而不是Set 。 val m = Map(1 -> ...
  • Guava的加载缓存可以解决您的超时和并发修改: https : //code.google.com/p/guava-libraries/wiki/CachesExplained将您的请求映射交换为LoadingCache,方法如下: LoadingCache requests = CacheBuilder.newBuilder() .maximumSize(1000) .expireAfterAccess(1, TimeUnit.MIN ...
  • 您可以使用for和pattern匹配其返回值: map = %{ drop_off_lat: nil, drop_off_lng: "4.5", pick_up_lat: "6.5e2", pick_up_lng: nil, } [drop_off_lat, drop_off_lng, pick_up_lat, pick_up_lng] = for key <- [:drop_off_lat, :drop_off_lng, :pick_up_lat, :pick_up_lng] do ...
  • 最好的办法是将有序值存储为切片,然后使用init函数生成如下地图: var a map[int]string var vals = []string{ "some", "value", "maintained", "manually", } func init() { a = make(map[int]string) for idx, val := range vals { a[idxToKey(idx)] = val } } fu ...
  • 相关文章

    更多
  • Memcached add 添加key-value命令(存在不会更新)
  • 荐 Twitter Storm Stream Grouping编写自定义分组实现
  • about lucene grouping and facet history
  • IK如何添加分词到主词典?
  • 如何 通过TabPanel的add方法,调用已经存在的panel?
  • 前端网页上添加分享到朋友圈,关注微信等按钮
  • add more solr core for switch deploy old new replace hot deploy
  • 微信公众平台开发之在网页上添加分享到朋友圈,关注微信号等按钮
  • 在微信公众平台前端网页上添加分享到朋友圈,关注微信等按钮
  • 荐 Twitter Storm, 数据流分组策略,fieldsGrouping
  • 最新问答

    更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)