Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Creating new parameters to report with .net code Post Reply Post New Topic
Author Message
billux123
Newbie
Newbie


Joined: 03 Aug 2017
Online Status: Offline
Posts: 8
Quote billux123 Replybullet Topic: Creating new parameters to report with .net code
    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 !
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet 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
IP IP Logged
billux123
Newbie
Newbie


Joined: 03 Aug 2017
Online Status: Offline
Posts: 8
Quote billux123 Replybullet 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.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.