how can i pass a variable to crystal report
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
Re: how can i pass a variable to crystal report
If you create a parameter in CR and then use the Parameters collection in vb6 to add and pass it to the report.
Re: how can i pass a variable to crystal report
Quote:
Originally Posted by RobDog888
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
Re: how can i pass a variable to crystal report
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.
Re: how can i pass a variable to crystal report
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
Re: how can i pass a variable to crystal report
Quote:
Originally Posted by mabbas110
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
Re: how can i pass a variable to crystal report
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
Re: how can i pass a variable to crystal report
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