cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

vb.net Parameter Default Value

Former Member
0 Likes
1,420

Hi,

I have an application coded in vb.net that opens a crystal report in the crystal report viewer. I understand how to set parameter values in my vb.net code, but I also want to be able to access the default value of the parameter that is already assigned within the crystal report. Does anyone know how I access the default value of the parameter?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Hi Chris,

Build the project and test it and see what the various properties of the report it gets.

It will only get what is saved in the Report, what changes/updates you make in code will not return, you'll have to keep track of them yourself.

Don

Answers (4)

Answers (4)

0 Likes

As I mentioned, have a look at this project, it has routines on how to get the info:

Have a look at this test app: https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/

There are sites out there that will convert C# to VB... easy enough to do yourself though.

Don

Former Member
0 Likes

Hi Don,

Looking through the code I think this is the line that pulls in the value : getDiscreteValues(paramfield). Is this correct? Do you know if this pulls in the current values from a previous run of the report or the default value?

0 Likes

Yes, WIKI page tells you what versions support what versions...

Former Member
0 Likes

My code is working, I just don't know the syntax to pull in the default values for the parameters, where needed, in my code. Do you know the syntax to do this?

0 Likes

Ah, SP 13 is n ot supported in VS 2019, you need the latest SP 19 from here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Uninstall first, then install just the EXE, don't install the MSI's nat required on your DEV PC.

Wiki above has all of the latest info.

Don

Former Member
0 Likes

I installed the latest version, SP29, Will that work as well?

0 Likes

Hi Chris,

What version of the sDK are you using?

Have a look at this test app: https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/

It's C# but in the drop down list box there is a routine to get parameter values.

Don

Former Member
0 Likes

I am using Visual Studio 2019. The SDK I Installed was titled "crnet13_sp14_api_en". I looked through your code and I'm having trouble finding where you call the default value of the parameter. Can you assist?