Creating new parameters to report with .net code

Printed From: Crystal Reports Book — Forum Name: Technical Questions

I have a situation where I have a report file currently with no parameter fields created in it. With .net code I want to create new parameter fields and assign values to them. I have done some research and so far it only looks like I can set values to existing parameter fields on report files. Anyone have any ideas?

Thanks !
HI

Why you want to pass parameter values through .net ? any reason for doing this ?

Actually, parameters will accept user input and filter report data. Better to create a parameter at report level and pass values through .net.

Originally posted by Sastry

HI

Why you want to pass parameter values through .net ? any reason for doing this ?

Actually, parameters will accept user input and filter report data. Better to create a parameter at report level and pass values through .net.



I was attempting to do this because I am in a situation where I have over 1000 rpt files that can be run in my app and I have to change data provider in the rpt file to a more recent version. I am trying to avoid having to update each individual file. I was hoping to find a global fix I could do with the crystal runtime. I have already attempted and failed trying to change the data provider with code at runtime. I have successfully been able to hydrate the data on the report with a .net data table at run time. The issue I am running into is that the parameters get removed from the report once I change the data source to the data table. I was hoping to be able to find a way to re add the parameters with code.
You will probably have to use the unmanaged RAS (Report Application Server) SDK to make any changes to the report structure. I have not actually done something like this but I know that the RAS SDK will let you design a report in code. This comes with the Crystal for .NET SDK and is reached through the "ReportClientDocument" object. You can find sample code here: https://wiki.scn.sap.com/wiki/display/BOBJ/NET+RAS+SDK+Samples

-Dell