Click to See Complete Forum and Search --> : how can i pass a variable to crystal report
sajankk
May 7th, 2006, 12:09 AM
hi all,
am using crystal report 8.0, vb6.0 with Msaccess 2000 and ADODB. actually i did a report with all the fields coming from a table, and it is working fine . but one field still there blank and i want to fill that field that is coming from another table and these both tables didnt made any relationship. i want to know how can i pass the value of the variable to crystal report
thnx in advance
saj
RobDog888
May 7th, 2006, 03:03 AM
If you create a parameter in CR and then use the Parameters collection in vb6 to add and pass it to the report.
sajankk
May 8th, 2006, 05:29 AM
If you create a parameter in CR and then use the Parameters collection in vb6 to add and pass it to the report.
thanx for the reply
can u just brief parameters collection in VB6 and how can i create parameter in CR
saj
RobDog888
May 8th, 2006, 05:36 AM
In CR's Field Explorer, create a new Parameter Field and drag it to your report where you want the passed in parameter to be displayed. Then in VB6 add a reference to CXDRT or whatever it is, cant exactly remember but I do have a small example in my signature. Then under the report object is the parameters collection. Add the parameter and pass it and then set your datasource and display.
mabbas110
May 8th, 2006, 05:49 AM
You have two options
1. Just get that value by running command at the form level and then pass it on the formula field of crystal report
2. IF u r using the table for crystal report than try to use query and then in that query embed the sub query and get that field from another table.
I hope this may help u
sajankk
May 11th, 2006, 05:06 AM
You have two options
1. Just get that value by running command at the form level and then pass it on the formula field of crystal report
2. IF u r using the table for crystal report than try to use query and then in that query embed the sub query and get that field from another table.
I hope this may help u
can u pls explain this suggestion. by the time i will check robdogg's suggestion
saj
sajankk
May 13th, 2006, 12:54 AM
hi all,
i made a parameter field in CR. now my doubt is.. how can i get the value for that field from my present active VB form. bcs am using Crsytal report version 8.0 , it is not supporting some of the methods discussed by the posters in some other thread.
Set m_Rep = m_App.OpenReport(mRepName, 1)
m_rep.ParameterFields.GetItemByName("Owner").AddCurrentValue (gstrMarker)
this is the one am trying , but its not working
can anybody tell me the solution pls
saj
RobDog888
May 13th, 2006, 01:16 AM
Use the Patameters collection if you have it in 8.0.
With 8.5 I found that you needed to clear the parameter first before adding each one. Not sure if its the same in 8.0
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.