Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report Designing Prob. Post Reply Post New Topic
Author Message
kuldevbhasin
Newbie
Newbie
Avatar

Joined: 07 May 2008
Location: India
Online Status: Offline
Posts: 22
Quote kuldevbhasin Replybullet Topic: Report Designing Prob.
     Posted: 03 Jun 2009 at 4:25am
hi
i am using vb.net 2008 pro. and cr bundled along with it i have created some reports using cr. but am no expert at it.
i have this scenario i have a bank form where in there are two types of entries.
1. the user can enter the data in a single ledger option
2. the user can enter data in a datagrid for multiple ledger.
let me describe in detail.
i have this datatable
 
1. BankEntry
Prd_code
VchNo
Lgr_Code
ChqNo
 
2. BankDet
Prd_Code
VchNo
Lgr_Code
Amount
 
3. LedgerMaster
Lgr_Code
Descrip
 
if the user wants to square off the bills then he will not select the ledger in at the top and if the lgr. code is not selected then the user can enter details in the datagrid. the top lgr. code will b stroed in BankEntry and the datagrid details in BankDet. now how do i design the report. both the lgr_code have to link to ledgermaster. so how do i do this ? can someone pls. guide me .
pls. reply at the earliest as i am stuck up in the middle of the package.
thankx
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Jun 2009 at 6:28am
since you are describing what the app does and not what crystal does the only thing that I can advise is to create a dataset of what the user has done and pass it to the report.  If the app saves the data to a DB first, then you can have the report call it via direct binding or stored proc. 
 
How to link the data, that is up to you.  You need to decide how the data relates.
 
Sorry to not be more specific
IP IP Logged
kuldevbhasin
Newbie
Newbie
Avatar

Joined: 07 May 2008
Location: India
Online Status: Offline
Posts: 22
Quote kuldevbhasin Replybullet Posted: 03 Jun 2009 at 8:20am

thankx lockwelle for ur prompt reply. sorry for not making my self clear. i wanted a report of the bank statement wherein the description should b shown from the ledgermaster table and the records combined from the bankentry and bankdet table i.e. if the lgr_code in bankentry is blank then the description for the lgr_code in the bankdet should show.

somehow in the report i cant link both the bankentry lgr_code and the bankdet->lgr_code to the ledgermaster table.
hope i am making myself clear now.
thankx
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Jun 2009 at 10:36am
make your life simple, use a stored proc.
 
you should be able to, unless they are different datatypes.  I haven't used the linking in Crystal for years...stored procs are way more versatile, and you don't have to worry about how Crystal handles the linking.
 
Again, sorry I can't be of more help.
IP IP Logged
kuldevbhasin
Newbie
Newbie
Avatar

Joined: 07 May 2008
Location: India
Online Status: Offline
Posts: 22
Quote kuldevbhasin Replybullet Posted: 04 Jun 2009 at 4:37am
thankx for ur reply lockwelle but how can i use stored procedure in the report ? can u pls. explain in detail pls. thankx
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Jun 2009 at 6:15am
create the stored proc, with whatever parameters are needed, or none if you want (Crystal can filter, but I prefer the stored proc...use the power of your database server and the logic of sets to speed things along).
 
When you create a report, you select a connection and then a database and then you get to tables.  Instead of tables, select Stored Procedures.  Find the one that you wrote and select it.  Now you can use it just like a table.
 
As for transfering the report to run from the stored procedure instead of the tables....
1) add the stored proc to the report as above.
2) for each field on the report, select the matching field from the stored proc, place it close by.
3) right click on the original field, select 'Format Painter'
4) click on the new field
5) delete the original field and move the new field into the same location.
6) repeat for all fields on the report.
Now for the fun part
7) check the original tables, if all of the checkmarks are gone, then go to the Database Expert and remove the table.
8) if checkmarks remain, start searching in formulas, Running totals, and Section Expert and replacing the old fields with the new fields...don't forget the Report/Selection Formulas as well.
 
Repeat 7 & 8 until all the tables are gone and all the remains is the stored proc.
 
You probably had parameters, update the new parameters created by Crystal to be passed to the stored proc with the verbiage in the old parameters, and you should be all set.
 
Keep a copy of the original report just for comparison.
 
Hopefully this is enough detail.
IP IP Logged
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