Print Page | Close Window

Creating new parameters to report with .net code

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22418
Printed Date: 02 May 2024 at 6:29am


Topic: Creating new parameters to report with .net code
Posted By: billux123
Subject: Creating new parameters to report with .net code
Date Posted: 22 Aug 2017 at 8:01am
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 !



Replies:
Posted By: Sastry
Date Posted: 23 Aug 2017 at 1:36am
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.



-------------
Thanks,
Sastry


Posted By: billux123
Date Posted: 23 Aug 2017 at 3:05am
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.


Posted By: hilfy
Date Posted: 28 Aug 2017 at 8:44am
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

-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window