开发者

how to combine 2 tables in crystalReport?

i have 2 开发者_开发知识库tables:

Table: A (the Header)
Id|Name
1 |A
2 |B
3 |C

table: B (the lines)
Id|Data
1 |123
1 |111
1 |222
2 |123
2 |444
3 |101

how i can show in my crystalReport like this:

1|A
123
111
222

2|B
123
444

3|C
101


This is quite hard to say when not in face of Crystal Reports myself, since there's no piece of code I can provide anyhow. Hence my answer might not be a definitive answer but empirical tries with you to achieve your goal.

  1. Make both table the source of your report;
  2. Indicate what is the relationship between both tables;
  3. Create a group which will group by TableA.Id;
  4. Delete the text Label Crystal Reports placed in your created group;
  5. Create a new Formula field the name to reflect your newly created group;
  6. In formula editor, concatenate the name of your group with the | character and your TableA.Name field together;
  7. Drag and drop your new formula onto your Group Header place holder;
  8. Drag and drop your TableB.Data field on the Detail Section;
  9. Try and run the report to see if this result meets your need, and edit your answer so that it can be easy to see what was the result and say what is not correct.

Thanks for helping to help you. =)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜