|
-
May 7th, 2006, 12:09 AM
#1
Thread Starter
Hyperactive Member
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
-
May 7th, 2006, 03:03 AM
#2
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 8th, 2006, 05:29 AM
#3
Thread Starter
Hyperactive Member
Re: how can i pass a variable to crystal report
 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
-
May 8th, 2006, 05:36 AM
#4
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 8th, 2006, 05:49 AM
#5
Addicted Member
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
Thanks and Regards,
Muhammad Abbas
-
May 11th, 2006, 05:06 AM
#6
Thread Starter
Hyperactive Member
Re: how can i pass a variable to crystal report
 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
-
May 13th, 2006, 12:54 AM
#7
Thread Starter
Hyperactive Member
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
-
May 13th, 2006, 01:16 AM
#8
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
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|