Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Inserting report details to a table Post Reply Post New Topic
<< Prev Page  of 2
Author Message
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 28 Jan 2014 at 6:48am
to create a table you need sequel server management studio
with appropriate rights.
you could also try to create a counter field in crystal
something like
numberVar ct;
Whileprintingrecords;
ct := ct + 1;
maybe use that in a formula
for example if you have constant number of records per page you could divide counter by that number and that should be your page number.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 28 Jan 2014 at 7:03am
yes, kostya is correct in that...the caveat is that Crystal by itself will not write out to the database. It will only query the database once per report, which is why if you use a stored procedure you could write to the database.

Again, what Kostya is saying about a constant number of records per page will allow you to 'guess'/'predict' what the page number will be. If you have fields that 'Can Grow' the results can be unpredictable. CR is a pain that way.

Again, the hard part is guessing what page a record is on, and then writing that to a table, just because the actual result will basically be unknown until it's too late (ie after CR has formatted the report).

Hopefully, your report will be 'well behaved' and you will be able to find an algorithm that closely matches the actual page printing. All sorts of things can affect this, 'Keep Together', 'New page before', 'new page after' different fonts/bold/italic. These are just the items off the top of my head that can help/confuse the algorithm.

How could they help? Let's say that you have a new page before each group, and that the details always stay on the same page, then it is pretty easy to predict what page each group will be on.

On the other hand, you several nested groups with new page before and can grow fields and keep together and unknown number of details, it would be a very complex task to determine what page anything is on.

Not meaning to scare you, just that this could be a very difficult task.
IP IP Logged
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Posted: 28 Jan 2014 at 10:13pm
Thanks for all your help.
I will take everything on board and give it a go.
 
Thanks again
IP IP Logged
<< Prev Page  of 2
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.