cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter being ignored after upgrade to VS 2013 .Net 4

Former Member
0 Kudos

We have an application created in .NET 2 on VS 2005 that uses Crystal Reports.  After upgrading the application in VS 2013 to use .NET 4, the Crystal Report quit working properly.  The report has 3 parameters, and one of them is being ignored -- like it isn't even there.  The report runs, but acts like the third parameter doesn't exist.  When I click refresh on the report, it prompts me to enter 2 of the parameters, but not the 3rd ignored one...it is missing.  But when I run the report in preview mode, it prompts for all 3 parameters and runs properly.

I installed the latest release of Crystal for .NET (v. 10) this morning, but nothing changed.

Thanks!!

Joe

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Apparently, after running the report on a computer that runs it correctly, I see it is actually ALL the parameters that are being ignored.

I am sorry I didn't know this at the start.  But I wasn't aware as I do not run this report myself.

Anyway, wanted to add that important fact...

Joe

Former Member
0 Kudos

Joe,

I'm not sure if this will help but it was recommended to me about a month ago by Ludek and it worked for me.  In my scenario, the two parameters that were prompted were in fact displayed on the report, the last was only used in the RecordSelectionFormula and was not prompted until I made the changes in the document Ludek referred to me.

Former Member
0 Kudos

Dear rasinc,

You hit the nail on the head! Bingo!

Thanks a lot for taking the time to post your reply.  After hours and trying to make it work, you pointed me to the exact solution.

Thanks again!

Joe G.

Former Member
0 Kudos

Officially it was my head on the nail until Ludek Uher sent me to that solution.  I spent the hours back in July trying to figure it out.  For me I think it was introduced when I upgraded the engine.

Glad I could help out.  Everyone here has been helping me quite a bit lately as I do more complex things, so I am glad I could pass it back along.

Answers (3)

Answers (3)

Former Member
0 Kudos

I embedded the parameter value into the visible part of the report, and it is displayed correctly as "C", so it is being passed to the report.  However, the report data is supposed to be limited to where a field in the query (DEPT_TYPE) is equal to "C" only (see extract below taken from the Select Expert - Record in Crystal).  But the data being displayed in the report is data for all DEPT_TYPE's (T and C). So the parameter is passed okay, but ignored in the query when it runs.

{V_LEI_GT_TOOLLOOKUP.DEPT_TYPE} = {?Type1} and

{V_LEI_GT_TOOLLOOKUP.REQ_CAL} = "Y" and

{V_LEI_GT_TOOLLOOKUP.STATUS} = "Active" and

{LEI_GT_CAL.NEXT_CALIB} >={?StartDate} and

{LEI_GT_CAL.NEXT_CALIB} <={?EndDate}

0 Kudos

Hi Joe,

What type of parameter is it? SP or Crystal Parameter?

Can you attach your report so we can see how it's designed and I'll test it also. Use the Advanced Editor and rename the file to *.txt

How are you setting the parameter in code?

What DB are you using and how are you connecting, ODBC, OLE DB, etc.?

Don

Former Member
0 Kudos

Hi Don,

I have not used CR a lot, so I am not sure about your question "SP or Crystal Parameter?"  The data for the report comes from several tables and views setup in the Database Expert with links between them.  The parameters are setup into "where" clauses in the query, which runs against an Oracle DB.

The parameters are set using the following code:

for (int z = 0; z < GlobalSubs.reportParmName.Count; z++)

{

    GlobalSubs.DailyReport.SetParameterValue(GlobalSubs.reportParmName[z].ToString(), GlobalSubs.reportParmValue[z].ToString());

}

// GlobalSubs.DailyReport.SetParameterValue("StartDate","1/1/1900");

//GlobalSubs.DailyReport.SetParameterValue("EndDate","1/1/2019");

//GlobalSubs.DailyReport.SetParameterValue("Type", "T");

this.Crystal_ReportViewer.ReportSource = GlobalSubs.DailyReport;

I have verified the above code passes the parameter names and values as expected. I have even tested with hardcoded parameter names and values (as you can see from the commented lines) and no difference. The last parameter (named Type) is ignored completely.

Again, ALL of this code and report worked fine before the upgrade.  NOTHING was changed in the code or report...just the upgrade to .NET 4 and CR supporting VS 2013.

Report is attached...

Thanks!

Joe

DellSC
Active Contributor
0 Kudos

By "v 10" do you mean SAP Crystal Reports for Visual Studio SP 10 (version 13.x assemblies) or do you mean the older version of Crystal for .NET that worked with VS 2008 (version 10.x assemblies)?

If it's the version 13.x assemblies, take a look at the report design in VS.  In particular, look at the Parameters in the Field Explorer.  Does the parameter that's not appearing have an icon that is just a blue question mark (no green check or yellow cylinder in the icon)?  If so then the parameter is not being used in the report.  In this case, the newer version of the SDK will not even display the parameter because it's not used.

-Dell

Former Member
0 Kudos

Hello Dell,

Yes, I am sorry for not being clear...I meant I installed "SAP Crystal Reports for Visual Studio SP 10 (version 13.x assemblies)" this morning.

below is what the parameters look like...the last one "Type" is the one not working.

Thank you,

Joe

0 Kudos

Hi Joe,

Try renaming it and see what happens, could be a naming convention conflict.

What type of field is it based on? Or does it have a field attached to it?

Don

Former Member
0 Kudos

Hi Don,

Thanks for the replies.

I tried renaming the parameter to "Type1" and same thing occurred.

I also deleted it and re-added it...same thing.

Thanks,

Joe

0 Kudos

Hi Joe,

Thanks but it works for me:

Same in both CR Designer and my Windows Form app. And nothing  unique in the parameter type.

Check your references, make sure they are all version 13.x.xxxx.xx

If you open it in CR Designer can you change the order, try setting it to be the first one, I also added an A to the name to see if it made any difference also:

Another thought, may be ODBC driver related, who's Oracle ODBC driver are you using in your DSN? CR support the Oracle client directly alsom Set Location and use the Oracle Native Driver and see it that works.

Don