如何在水晶报表中创建包含动态列的报表 [英] How to create report with dynamic columns in crystal report

查看:73
本文介绍了如何在水晶报表中创建包含动态列的报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有DataGridView每次返回不同数量的列,所以我需要在水晶报表中显示这个不同数量的列

这是代码的一部分

谢谢你,



我的尝试:



I have DataGridView that returns different number of columns every time , so I need to display this different number of columns in crystal report
this is some part of code
thank you ,,

What I have tried:

Dim sqlsubjects As String = "SELECT DISTINCT Subjects.SubjectID,  Subjects.SubjectCode, Subjects.SubjectName, Subjects.SubjectHours,StudentSubjects.SubjectTypeReults "
           sqlsubjects = sqlsubjects + "FROM Subjects, StudentSubjects  "

推荐答案

抱歉,但Crystal不会这样。 Crystal使用预定义的数据对象以指定的格式显示数据。

如果你传递了一个不同的数据对象,它会给你错误,它找不到列 xyz

要么是;

a)始终传递相同数量的列&在数据中使用某种类型的标志来告诉Crystal要显示的列。这很复杂,因为您还需要设置元素的位置

b)为每个场景创建单独的报告

c )更改报告的格式



我个人会选择 C 。按学生分组主题,然后在每个学生下面的表格中显示主题,小时,结果等



亲切的问候
Sorry but Crystal doesn't work that way. Crystal uses a pre-defined data object to display the data in a specified format.
If you pass a different data object then it will give you errors that it cannot locate column xyz.
Either;
a) Always pass the same number of columns & use some type of flag in the data to tell Crystal what columns to show. This is complicated because you would also need to set the position of the elements
b) Create individual reports for each scenario
c) Change the format of your Report

I would personally go with Option C. Group the Subjects by Student and then show the Subjects, Hours, Results etc in a table below each Student

Kind Regards


这篇关于如何在水晶报表中创建包含动态列的报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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