Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic reports

Status
Not open for further replies.

Greenleaf

Programmer
Feb 14, 2002
93
IT
Hello, I use Crystal Reports XI and I would like to create reports dinamically i.e. runtime via delphi code. In particular I would like to add bitmaps and pages via code. How can I do this?
 
Reading the docs the best I can achieve is adding bitmaps dinamically by using CrystalActiveXViever but I cannot find a way to add pages dinamically and also I have to put the CrViewer in the main form; that's not good but if I put it in another form I get message errors.
 
I really need help and the documentation is not that clear.
I try to add sections in my code but how does the command
Crreport.sections.add() works?
My report has a variable number of pages and I would like to be able to force a new page whenever I chose; I thought that by adding sections and force a new page at the end of every section could work but I cannot do that.
Please do help me.
 
Crystal has sections, not pages.

I think that you need to understand the product better before proceeding.

There were samples at the link I supplied, try scanning those.

-k
 
I know it has sections but it is quite hard to handle them. I looked at the samples but I cannot modify them for my purposes. I don't have a database, so I don't have fields and can't manage to do groups.
What I need is the possibility to add bitmaps taken from another program. If in the other program I have say:
page 1: 3 bitmaps
page 2: 1 bitmap
page 3: 2 bitmaps
I'd like to have the same layout in the report.
Now I use just crreport.sections.item['D'] and the layout difficult to control. Anyway, Crystal does have pages, infact there is a method crreport.sections.newpageafter and also crreport.sections.newpagebefore.
How can I understand the product better if the documentation for the runtime part is so scarce?
 
New Page After/before is a page break, not a page.

Here's some VB samples using bitmaps:


Hopefully you can work it out from there.

Create additional report header sections, set the new page after for each, and place the bitmaps, it should work.

-k
 
I examined the code but cannot find examples of how to create additional report header sections.
crReport.sections.add(what kind of index shall I put here?);

I looked at some examples in vb where they simply put an integer but that does not work in delphi. I'm really getting crazy at this. If I managed to create these additional report header sections (or even detail sections) as suggested by you, the job would be done, but cannot realize how to do it.
 
I managed to add sections, it is a miracle but please wait for other updates because I know there's another problem.
 
Ok, now things are starting to work out fine. I found out a document from where I deduced that the way to add sections was:
crreport.areas.Item['RH'].sections.add(RH1);
At last! The "area' was the key to everything!
Now, I added the bitmaps and the layout is good (every bitmap is in the proper page) but for one thing. The quality of the bitmap is not very good. If I open the bitmaps with Paint or with Word the quality is normal but it seems that something happens when I put them in the report.
What could I do?
 
This issue is neverending.
I managed to do everything but now I've been requested to do things differently. I mean, I wrote a code that:
1) create bitmaps
2) save bitmaps to a file
3) load bitmaps and adds them to the report with the method AddPictureObjects

Of course saving a loading take too mucb time so I would like to know how could I add the bitmaps in a more direct way (i.e. without saving them to a file and the loadig them). Is this possible? Please do help me!
 
Please don't use the RDC. It is being deprecated. Check the crystal reports XI for futher information.

I saw this information on Crystal Reports XI Release 2 documentation.

Srinath
 
So it's not possible to add pictures say, pasting them from the clipboard with RCD? They dont' metion it in RAS documentation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top